Commit graph

79 commits

Author SHA1 Message Date
bunnie
3d05954f95 fix broken test case 2026-05-13 00:26:04 +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
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
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
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
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
8fcca4f873 cleanup bitrot 2025-10-06 01:34:13 +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
f2c61e44cc add aes test options to command environment 2025-08-10 22:28:32 +08:00
bunnie
4eacde470f add commands for AES testing and for calibrating delay loop 2025-08-10 22:27:30 +08:00
Sam Chin
04bf756b8e theoretically clean version which has been tested with and without the feature 2025-06-11 15:05:59 +08:00
Sam Chin
0412a401d8 no more deadcode 2025-06-10 21:51:55 +08:00
Sam Chin
2659fc0894 wip'
'
2025-06-10 21:51:55 +08:00
bunnie
59db16aa99
remove debug message 2025-06-09 18:49:28 +08:00
Sam Chin
a25f20d045 making console flags happy 2025-06-09 17:47:00 +08:00
Sam Chin
90d88820dd dropped a ; 2025-06-09 17:37:12 +08:00
Sam Chin
d1b5a41e82 fixing help text 2025-06-09 17:37:12 +08:00
Sam Chin
c291b6a11f now passing the linter 2025-06-09 17:37:12 +08:00
Sam Chin
e5cdeaf2ca adding some cute command line arguments 2025-06-09 17:37:12 +08:00
Sam Chin
1b8554b8f2 removing the BMP180 code 2025-06-09 17:37:12 +08:00