Commit graph

103 commits

Author SHA1 Message Date
bunnie
3d05954f95 fix broken test case 2026-05-13 00:26:04 +08:00
bunnie
f774522e62
remove testing API that never actually worked
there was a thought to speed up CI testing by introducing a
"cheater" routine that allowed us to re-initialize the keystore.
Turns out this doesn't work because it's not possible to fully
revert a system out of developer mode - because, in my infinite
previous-self wisdom, I realized that this is something someone
might try and there is a one-way counter that logs if the
system has *ever* been in developer mode, and that has no
known bypass.

This means that even if you could repopulate the keystore, it
would be cleared on the next boot by merit of the developer
flag being set.

So - we did it the hard way, every single test we have to
re-image the system from scratch. C'est la vie.

Removing this patch eliminates a code path that could later be
abused for unforeseen ill purposes.
2026-02-08 12:55:10 +08:00
bunnie
f9ef3217f0 add test command to overwrite keys 2026-02-04 15:58:20 +08:00
bunnie
3f869ca389 bump utralib version for publication 2026-01-29 19:12:00 +08:00
bunnie
b2cf705c59 bump ticktimer version to drop susres dependency 2026-01-28 20:53:57 +08:00
bunnie
c2640458f5 fix hosted mode and warnings 2026-01-28 15:21:39 +08:00
bunnie
3b0edbb442 add some more test routines - some of these will be culled shortly 2026-01-28 15:09:52 +08:00
bunnie
45632385d5 downgrade susres to a common api
doesn't make sense to push this to crates.io because it's not
common across all platforms, I think.
2026-01-28 00:36:05 +08:00
bunnie
f6c7d9c89e enable USB console by default
this helps with production & ci
2026-01-17 16:23:53 +08:00
bunnie
5a73d17a0a handle the no-arg case correctly 2026-01-16 17:40:17 +08:00
bunnie
2a7cffb86e add bootwait command line API to test
also refactor the test argument parsing so that i can use the
more modern version of the api
2026-01-16 17:35:41 +08:00
bunnie
fba011db3a commit version bump so that we may publish our packages 2026-01-08 03:04:19 +08:00
bunnie
42e96d723a hook the debug info output in the "test" command
this command and its dependencies will probably be stripped out
or modified for production, so i think this is a good place to hang
these.
2026-01-08 03:02:04 +08:00
bunnie
0487d5a2a3 add shipmode and deepsleep mode tests
- shipmode is for long-term storage. it disconnects the battery
from the system so that the shelf life can be ~years
- deep sleep effectively shuts down the system but leaves the
real time clock running. Requires a full reboot to recover
from deep sleep.
2025-12-22 02:10:26 +08:00
bunnie
d874c3e5c2 commit for version bump 2025-12-16 02:02:37 +08:00
bunnie
d261090f31 convert test routine to use susres api to enter sleep 2025-12-16 01:07:16 +08:00
bunnie
e2d15e26e6 expand test routines 2025-12-11 02:21:02 +08:00
bunnie
8950a24327 move i2c in bao1x-hal-services into bao1x-hal
this makes i2c accessible without having to rely explicitly
on the server itself, making the library callable in more contexts.
necessitated avoiding a name space collision and moving the
I2C hardware drivers to a stucture named I2cDriver; the I2C
object now unambiguously refers to the userspace interface
to I2C.
2025-12-11 02:13:21 +08:00
bunnie
c3757248a8 fix hosted mode 2025-12-07 20:52:46 +08:00
bunnie
9ade5a4a0d add notes about coding capacity:
40 bytes gives 320 bits which fits nicely into a version 3 code,
which allows 4 pixels per module rendering.

if we have to move to 3 pixels per module, the next code up that optimally
uses the full screen is version 6. This would give 102 bytes of transfer
in a single scan.

The equation for capacity is:
`binary_bytes = floor((alphanumeric_capacity / 3) × 2)`

where `alphameric_capacity` is the capacity of the QR code version
per spec lookup table.
2025-12-07 19:08:06 +08:00
bunnie
c3a0a50c9e add test routine for QR code generation/scan
a 40-byte message can be encoded in a version 3 code with
medium ECC. This is pretty optimal because it allows 4 pixels
per module in the QR code, which is a nice size for viewing.

base45 is added as a dependency to the project. Base45 is weird but
apparently it's the most efficient way to code binary data into a
QR code.

40 bytes (320 bits) is enough to exchange a 256-bit key plus
64 bits of sideband data. I think this is going to be enough for
basic device-to-device handshaking.
2025-12-07 19:01:14 +08:00
bunnie
6ecaa36d98 cleanup warning 2025-12-07 19:00:44 +08:00
bunnie
3663ea1276 revert inadvertent testing flag that was checked in
this only makes sense for testing on specific builds.
2025-12-02 02:39:28 +08:00
bunnie
01475137bb add code to test the random seed 2025-12-02 01:40:39 +08:00
bunnie
5b4d6c1932 add benchmark data on chaffing
unchaffed AES is 5.36us/block
chaffed AES is 10.27us/block

so ~2x overhead for chaffing - about what we expect for the
implementation.
2025-12-02 01:05:26 +08:00
bunnie
d9a65a51d9 fix hosted mode 2025-11-30 21:56:32 +08:00
bunnie
b702a68c1c test what local time returns 2025-11-29 01:01:24 +08:00
bunnie
41f750163f change timing of PDDB mount
moving it a shy later into the boot makes the mount process faster
because it's not fighting for swap memory with everything else
trying to initialize at the time.
2025-11-25 01:08:47 +08:00
bunnie
62b656db8a add some test routines for checking RTC functions 2025-11-24 18:28:50 +08:00
bunnie
90362b2604 fix hosted mode 2025-11-18 23:59:17 +08:00
bunnie
0723306085 update docstring 2025-11-18 22:40:36 +08:00
bunnie
0942858bbc add test cases for trng 2025-11-18 19:35:48 +08:00
bunnie
8c421c6050
Merge branch 'main' into vault2 2025-11-11 08:47:10 +08:00
bunnie
54f476edd3 fixup hosted mode emulation for baosec 2025-11-08 04:20:30 +08:00
bunnie
9336bdab6a
Merge branch 'main' into vault2 2025-10-28 23:15:41 +08:00
bunnie
b557cd5ebc
add some trng tests to the console 2025-10-28 18:02:33 +08:00
bunnie
6a548de693
Merge branch 'main' into vault2 2025-10-27 00:02:26 +08:00
bunnie
3a02dc125c add rram debug commands & duart-debug mode for the HAL in std 2025-10-26 22:22:46 +08:00
bunnie
c32dde7b06
Merge branch 'main' into vault2 2025-10-06 13:45:17 +08:00
bunnie
dbb0a75118 bump versions
have to absorb a version change due to xous-semver change

might as well also update the utra/svd generator dependencies
since that's been held off for a long time now.
2025-10-06 13:23:18 +08:00
bunnie
8fcca4f873 cleanup bitrot 2025-10-06 01:34:13 +08:00
bunnie
4069b623c4 add note about where to get dabao console from in bao-console 2025-10-05 17:17:07 +08:00
bunnie
d265ce3398 note deprecated pin config 2025-10-01 02:56:40 +08:00
bunnie
179e178e96 fix up formatting that changed due to the flag day 2025-09-18 21:31:54 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
edf5206846 test code for shutdown/keep-on
at the moment not working, will resume debug once new rev of board
is back.
2025-09-18 20:19:48 +08:00
bunnie
7f5a288090 add some commands for testing the serial console & port setup 2025-09-13 15:36:16 +08:00
bunnie
08aa40e557 add ctap protocol testing routines 2025-09-09 23:11:30 +08:00
bunnie
9931daf131 fix broken links from rename 2025-09-08 17:21:49 +08:00
bunnie
75a9373fea fix AES dependencies so that the correct acceleration is enabled
This relies on a trick I was not aware of previously, which is
that transitive dependencies absorb the additive set of features
enabled within a crate.

see

https://doc.rust-lang.org/cargo/reference/features.html#feature-unification

for the full description. but basically by referring to the feature
required in "aes" despite not being used in the crate but pulled
in by aes-gcm-siv, i can ensure that the transitive dependency
is in fact used.

I think this was always there but previously I just didn't understand
it correctly or didn't use it right when I tried to deploy it, but
this time I think I got it right.
2025-09-07 11:50:12 +08:00