Commit graph

10340 commits

Author SHA1 Message Date
f68ffa5954 chore: remove upstream CI workflows (not our CI infrastructure) 2026-06-30 17:44:31 +02:00
bunnie
bc9e2131bc
Merge pull request #901 from betrusted-io/alt-uf2-serial
Add extended UF2 command set for large serial uploads
2026-06-24 15:38:28 +08:00
bunnie
53c92df8a5 add uf2-spim feature to bootloader
All the changes here (except one print statement change) are
intended to be feature-gated behind `uf2-spim` in the bootloader.
So, in theory, this should have no boot1 regressions.

The uf2-spim feature is intended for alt-boot and alternate
compiled boot1's and extend the serial-only upload path with
the following features:

1. ability to write SPIM (spi flash memory) using the same
.uf2 files as the USB path
2. requirement of CRC's on blocks
3. a quick test to determine if CRC has been enabled or not
via the `has-crc` command (returns `true` if required, an
error/unknown command message if not).

The CRC makes long/large file uploads reliable, allowing
full device provisioning to happen via serial only, in
cases where USB for whatever reason is not present or available.
2026-06-24 15:08:12 +08:00
bunnie
97b2d2b0da modify alt-boot uf2 path to allow for updating of boot1 over uf2 serial 2026-06-23 18:00:38 +08:00
bunnie
515dd586b3
Merge pull request #900 from betrusted-io/pddb-erase
factory utilities
2026-06-15 23:17:35 +08:00
bunnie
f8162c3d9f add some baremetal factory modes 2026-06-15 23:03:45 +08:00
bunnie
0dc2c133f5 add pddb erase on altboot for oem mode 2026-06-15 23:03:20 +08:00
bunnie
8964027fff
Merge pull request #899 from betrusted-io/fix-deps
add mising dependency on owc-inc feature flag
2026-06-11 11:48:22 +08:00
bunnie
f720314dc4 add mising dependency on owc-inc feature flag 2026-06-10 14:37:49 +08:00
bunnie
8876a8d7b7
Merge pull request #898 from betrusted-io/bio-loader
BIO loader stability improvements
2026-06-09 19:41:40 +08:00
bunnie
6e28127cae cleanup local echo during BIO loading - makes it a bit more reliable 2026-06-09 17:52:20 +08:00
bunnie
dc7ac598dc fix warning 2026-06-09 16:23:17 +08:00
bunnie
e96d47f5cf
Merge pull request #897 from betrusted-io/bio-loader
BIO loader
2026-06-09 00:18:15 +08:00
bunnie
8e86a02521 update lockfile with bio loader deps 2026-06-09 00:01:09 +08:00
bunnie
0ac03dfd2b wire in the bio loader implementation 2026-06-09 00:00:50 +08:00
bunnie
d010f07dd7 add bio loader implementation 2026-06-09 00:00:40 +08:00
bunnie
69c68db711 remove a warning in dabao build 2026-06-09 00:00:23 +08:00
bunnie
a3e7a9fc9c add note documenting app-keys feature gate 2026-06-08 23:59:32 +08:00
bunnie
9f4421dadd add AppKey implementation
this adds, with a feature-gate, the option for userspace
programs to use & access keys in the APPLICATION data slots.

The implementation bounds-checks the requested indices to ensure
sensitive data in slots around the APPLICATION region cannot
be accessed. Even with corrupted AppKeyOp packets, it shouldn't
be possible to access other slot ranges, but because this code
is so intimate with importan secrets it's recommended to
gate the feature off unless required by the end user application
code.
2026-06-08 23:55:35 +08:00
bunnie
df22ecd989 add apis for application keys 2026-06-08 23:54:52 +08:00
bunnie
87fb3d16fb note some decisions made in the implementation of data slots
this will hopefully help prevent future disasters
2026-06-08 23:51:41 +08:00
bunnie
509bf08c0a make application slot range explicit
also start tracking application slot usage in dabao target
2026-06-08 23:47:19 +08:00
bunnie
b8f3aad1d9
Merge pull request #896 from betrusted-io/multiple-mbr
#882 Reconstructed
2026-06-08 23:43:52 +08:00
bunnie
97fe7f45b9
Re-instate review comments
These were comments added during review, re-constructed.
2026-06-03 03:04:09 +08:00
bunnie
214ccb6dd5 reconstruct #882 based on file diffs from gh 2026-06-03 02:53:35 +08:00
bunnie
2005a801c9
Merge pull request #877 from tunnell/pr-net-encoding-fix
Write NetError code at byte 1 too, so std-recv decode works
2026-06-03 00:41:58 +08:00
bunnie
7736076742
Merge pull request #894 from rowr111/fix-bao1x-gdb-stub-compile
fix cfg gating for gdb-stub in xous-log
2026-05-30 16:38:59 +08:00
Jeanie
e9058268ce fix cfg gating for gdb-stub in xous-log 2026-05-30 17:18:38 +09:00
bunnie
b9d4b0578d
Merge pull request #888 from finnmglas/finn/constant-time-pw-verify
use constant-time password verification
2026-05-30 01:36:02 +08:00
bunnie
42b2fcf313
Merge pull request #831 from sockbot/docs/tools-pddbci-testing-instructions
docs: add pddbci testing instructions to tools README
2026-05-30 01:27:15 +08:00
bunnie
ed4160d825
Merge pull request #889 from betrusted-io/cam-fixes
More camera stability improvements
2026-05-30 01:11:49 +08:00
bunnie
a421b7abfa replace watchdog hack with an atomicbool; reset cam on setup
This patch replaces the watchdog thread with a spin-wait on
an atomicbool that is set by the IRQ handler once an IRQ
triggers. This is a much cleaner, lower-overhead way to handle
the time out.

This patch also puts the camera setup into a retry loop, and
by default on setup it does a hardware reset of the display
subsystem (this includes the OLED screen). This hopefully
gives the subsystem a much better chance of recovering from
the camera being in a scrambled state. The working theory
for why the camera might get scrambled is that it assumes
it is a sole I2C device, and when its init sequence is
interrupted by other devices handling requests it does
not handle this situation gracefully.
2026-05-29 00:08:02 +08:00
bunnie
542bec7541 make I2C writes retry instead of unwrap-failing 2026-05-29 00:06:55 +08:00
Finn Glas
2eeacada70 use constant-time password verification
The password verification in RootKeys compared hashed passwords
byte-by-byte with an early return on mismatch. This leaks how many
leading bytes match through timing, weakening the protection that
bcrypt provides.

Replace the loop with subtle::ConstantTimeEq::ct_eq, which is
already used elsewhere in this crate (backups.rs, FPGA key check).

Signed-off-by: Finn Glas <finn@finnmglas.com>
2026-05-27 23:29:40 +02:00
bunnie
0b3b481322
Merge pull request #887 from betrusted-io/wdt-opt
gate camera wdt behind a feature flag
2026-05-27 13:35:04 +08:00
bunnie
db60bca7fb fix formatting 2026-05-27 13:30:13 +08:00
bunnie
d325f80e31 gate camera wdt behind a feature flag
not needed in all scenarios
2026-05-27 13:19:11 +08:00
bunnie
5882bc7b71
Merge pull request #886 from betrusted-io/tweaks
adjust camera wakeup params
2026-05-26 12:10:15 +08:00
bunnie
f0c80a17fa adjust camera wakeup params 2026-05-26 02:22:01 +08:00
bunnie
8dd5e5ec00
Merge pull request #885 from betrusted-io/dry-run
add dry-run api to gfx
2026-05-24 17:05:14 +08:00
bunnie
a4316e2aa7 add dry-run api to gfx
dry-runs are useful for warming up "hot paths" in UI code
to improve latency. This is specifically a feature for tuning
interactions on systems that have swap memory.
2026-05-24 00:45:13 +08:00
Chris Tunnell
1f08ab57fc
Merge branch 'dev' into pr-net-encoding-fix 2026-05-18 21:26:05 +02:00
bunnie
b439d312a4
Merge pull request #881 from betrusted-io/u2f-concurrency
remove potential race condition in sending U2F packets over USB
2026-05-18 17:58:41 +08:00
bunnie
9232b87139 fix camera inconsistent start issue
on first boot, camera may not always start (some boards it never starts)
it always starts on a second prompting

the issue is related to the relevant code being swapped out, it seems;
i think an event fires and gets missed in the fray of all the data
being swapped in from off-chip storage.

this patch:

- re-orders the pipe warming and system bring-up
- adds a watchdog thread that ensures the camera interrupt fires,
and if it does not, issues a manual camera interrupt to kick
start the system

This greatly improves the reliability of first-start success. Across
several trials on many units i had only one misfire - not sure what
it was, can't reproduce, but this is much better than the roughly
80-90% misfire rate I was seeing before.

ship it.
2026-05-18 17:51:32 +08:00
bunnie
d3970eaa80 remove potential race condition in sending U2F packets over USB
The hardware handler structure passes through an interrupt
request boundary that breaks assumptions around the borrow
handler due to the unsafe transmutation of the record pointer
at the interrupt handler entry. This means that records shared
between the userspace and machine handler space are not part
of the borrow-checker's review.

This patch adds an AtomicBool flag that indicates if the ISR
has completed running, and forces the userspace to wait until
the ISR has completed before returning. This does potentially
slow down the rate of packet transmission but it ensures that
the `fido_tx_queue` structure does not have concurrency issues
in the case where the following happens:

1. U2fTx opcode encountered
2. fido_tx_queue has a u2f_msg put on it
3. ISR triggered
4. in the process of handling the ISR, a page fault is hit, so
the ISR doesn't start for some time.
5. Before the ISR returns, another U2FTx opcode is encountered
6. fido_tx_queue is being modified by userspace
7. The ISR is able to resume
8. You have a simultaneous modification to the fido_tx_queue
which is UB.

I think it's maybe possible that this scenario above can't
structurally happen due to an ISR page fault not allowing
the system to resume through to "normal" code running (iirc
the swapper will handle a page fault in ISR and resume directly
into the ISR routine) but this patch guards against incorrectness
in that implementation.

for what it's worth, later tests show that this bug was not
actually at the root cause of the behavior I was chasing down,
so in fact this was not happening. However I think it's still
a good idea to fix this potential problem.
2026-05-18 12:54:17 +08:00
Chris Tunnell
84aa303605
Merge branch 'dev' into pr-net-encoding-fix 2026-05-17 12:06:48 +02:00
bunnie
bcfdca4048
Merge pull request #879 from betrusted-io/release-fixups
fixup error messages
2026-05-14 02:18:23 +08:00
bunnie
635bead758 fixup error messages 2026-05-14 01:30:59 +08:00
bunnie
302ef46ea0
Merge pull request #878 from betrusted-io/update-name
update the descriptive name
2026-05-13 01:34:55 +08:00
bunnie
3d05954f95 fix broken test case 2026-05-13 00:26:04 +08:00