Commit graph

10340 commits

Author SHA1 Message Date
bunnie
351830c7d0 implementation side of non-blocking dimming 2026-05-05 23:54:51 +08:00
bunnie
4d505f188d add non-blocking version of screen brightness dimming
this is useful for dimming "animations" where it's not
critical if a dimming step is missed and you're spamming
the graphics server with dim requests
2026-05-05 23:54:06 +08:00
bunnie
d46fa5a153 fix windows related regression in hosted mode run 2026-05-05 23:53:40 +08:00
bunnie
8440706279 reduce debug 2026-05-05 23:53:18 +08:00
bunnie
e9a0b59ab0 soft-fail on request for console 2026-05-05 23:53:02 +08:00
Chris Tunnell
752d26885a
Merge branch 'dev' into fix/kernel-increase-heap-checked-add 2026-04-29 11:45:33 +02:00
Chris Tunnell
9e76e0d15f
Merge branch 'dev' into fix/root-keys-fpga-key-ct-eq 2026-04-29 11:42:05 +02:00
Chris Tunnell
afd814166d
Merge branch 'dev' into fix/gam-token-ct-eq 2026-04-29 11:36:50 +02:00
hanatonikkou
d69a03393b fix formatting, fix bitfield offsets 2026-04-28 20:01:34 +02:00
hanatonikkou
4bb8b55777 add dali library to bio-lib 2026-04-28 15:20:48 +02:00
hanatonikkou
d26b04f043 allow changing fclk through susres server 2026-04-28 15:16:33 +02:00
bunnie
31590c4c77
Merge pull request #855 from betrusted-io/display-stability
improve display boot stability
2026-04-27 00:08:26 +08:00
bunnie
1df3f38b4b
Merge pull request #854 from tunnell/fix/renode-v1.16-litex-timer-cast
emulation: cast frequency to ulong for Renode v1.16+ compatibility
2026-04-26 23:55:32 +08:00
tunnell
dd45a11c7b emulation: cast frequency to ulong for Renode v1.16+ compatibility
Renode v1.16 changed the LimitTimer constructor signature from
`long frequency` to `ulong frequency`. Without this cast, the
LiteX_Timer_32 peripheral fails to compile against current Renode
versions, causing emulation to exit immediately with a peripheral
build failure rather than booting Xous.

Tested with Renode v1.16.1.4499 (build 9d55b4e6-202604170227)
against the standard emulation/xous-release.resc startup. With
the cast, Xous boots through to the main loop. Without it,
Renode exits before any boot output appears.
2026-04-26 08:39:01 -05:00
bunnie
6a7caff54c improve display boot stability
an instance of the SPI interface timing out was observed on boot.
It's rare, but it happens.

This wraps those early calls with a retry loop and then
fail to reboot in case something really goes wrong.

Assisted-by: qwen3.6:27b (local)
2026-04-26 17:32:05 +08:00
bunnie
b0f5c5a4ce
Merge pull request #853 from betrusted-io/transition
Add bitmap transition
2026-04-24 03:18:30 +08:00
bunnie
4d1dc33ef1 add a diffusive transition option to the graphics library
makes changing between bitmaps less jarring
2026-04-23 15:14:27 +08:00
bunnie
c8528747e9 adjust other configurations stack limit 2026-04-23 15:13:11 +08:00
bunnie
fb5c8649aa
Merge pull request #852 from betrusted-io/loader-tweak
fix guard memory error in CI
2026-04-23 12:52:49 +08:00
bunnie
0850e0d7af fix guard memory error in CI 2026-04-23 12:29:59 +08:00
bunnie
1046566230
Merge pull request #851 from betrusted-io/ui-fixes
UI fixes
2026-04-23 02:11:56 +08:00
bunnie
9815e33f4e fix missing packet issue due to storage overflow 2026-04-23 00:34:35 +08:00
bunnie
4319faa9d0 improve layout for modals 2026-04-23 00:34:15 +08:00
bunnie
4102cfd3a5 move locales macro to blitstr2
this keeps font features in a single crate
2026-04-23 00:33:47 +08:00
bunnie
16073c9cf8 refactor to cleanup font inclusions
allows more degrees of freedom to free up space
2026-04-23 00:32:43 +08:00
bunnie
fe75bc7bbb
Merge pull request #845 from sockbot/sockbot/ai-contribution-policy
Add AI contribution policy.
2026-04-22 21:29:38 +08:00
bunnie
e94b804fc7
Update CONTRIBUTING.md 2026-04-22 21:24:01 +08:00
bunnie
cbd8fa0ea7
Update CONTRIBUTING.md 2026-04-22 20:39:18 +08:00
bunnie
a40eba8199 fix hosted mode warnings 2026-04-22 12:07:49 +08:00
bunnie
8f16270efa fix handling of orientation inputs 2026-04-22 03:05:00 +08:00
bunnie
fbe6aad8bb try to improve suspend/resume stability 2026-04-22 01:22:31 +08:00
bunnie
d020bda4be ignore accelerometer "keys" in video loop 2026-04-22 01:22:18 +08:00
bunnie
4a236cfd68 add explicit power-off command to display 2026-04-22 01:21:47 +08:00
bunnie
d94041bfeb add wdt driver
translated from C SDK with help of Claude Sonnet 4.6
2026-04-22 01:21:08 +08:00
bunnie
8521d698d7 add hooks for pre-clock transition on bio
this hook allows the application logic to warn the BIO
app that a clock transition is coming so that glitches can be
suppressed.
2026-04-21 16:27:10 +08:00
tunnell
f22f276ead Use constant-time compare for FPGA key check
The BIP-39 backup-key confirmation flow compared the entered
key against the in-memory FPGA key with `==`, which
short-circuits on the first mismatching byte and leaks
prefix-length information through timing.

Switch to `subtle::ConstantTimeEq`. The `subtle` crate is
already a direct dependency and used in the same crate's
`backups.rs` for the same purpose.

Signed-off-by: tunnell <tunnell@users.noreply.github.com>
Assisted-by: Claude Code (Opus 4.7)
2026-04-21 03:11:44 -05:00
bunnie
2ec739e54e fix orientation flipping during QR scan mode
turns out you don't just flip everything all the time! when
you flip the board upside down, the camera also flips. so then
you end up with a flipped image which is super-confusing.

however, the overlay text needs to flip. so this adds the
cases to handle that.
2026-04-21 01:21:51 +08:00
bunnie
0d2c7233d6 improve stability of USB when not plugged in
don't try to use the USB stack when nothing is plugged in
2026-04-21 01:21:13 +08:00
bunnie
b10b7e6309 add serdes for VbusIrq to usize 2026-04-21 01:20:42 +08:00
tunnell
5e42a656cf Check for overflow in IncreaseHeap syscall
`process_inner.mem_heap_size + delta` can wrap on RV32 if a
client requests a `delta` close to `usize::MAX`. A wrapped
value can land below `mem_heap_max` and pass the cap check,
letting the call proceed with a bogus heap size.

Use `checked_add` and return `Error::OutOfMemory` on overflow.

Adds a hosted-mode behavioral test that sends `usize::MAX` as
`delta` and asserts the syscall rejects it. The test doesn't
cleanly distinguish patched from unpatched code on 64-bit hosted
(both paths reject absurd deltas, just at different layers), but
it locks in the expected behavior as regression coverage.

Signed-off-by: tunnell <tunnell@users.noreply.github.com>
Assisted-by: Claude Code (Opus 4.7)
2026-04-20 09:13:47 -05:00
tunnell
e19ba9973f Use constant-time compare for GAM auth tokens
GAM auth tokens are 128-bit capabilities bound to their owning
process. The previous `==` compare on `[u32; 4]` short-circuits
on the first mismatching element, leaking prefix-length information
through timing.

Switch to `subtle::ConstantTimeEq`, which is already present in
the dep graph via ed25519-dalek and used elsewhere in the crypto
stack.

Signed-off-by: tunnell <tunnell@users.noreply.github.com>
Assisted-by: Claude Code (Opus 4.7)
2026-04-20 08:15:32 -05:00
bunnie
a642095c55
Merge pull request #848 from betrusted-io/rtc-wake
Add RTC wakeup support and improve RTC APIs
2026-04-13 00:17:26 +08:00
bunnie
aaad119bcc add local-sign variant to baosign.ps1 2026-04-13 00:04:14 +08:00
bunnie
0c23c5e5bc add eternal-scan feature
this is useful for aligning factory test features
2026-04-13 00:03:42 +08:00
hanatonikkou
19df2d3cf8 read clock muxes when calculating clock frequencies 2026-04-07 17:43:33 +02:00
bunnie
b1870e51ea make it so that bootwait option is skipped if warm boot
this prevents warm boot hold-up in case of latent key press
during wakeup option: for warm boot it's assumed that when
the user presses a key the intention is to wake up and go
to normal operation, not wake up and wait for an update.
2026-04-07 18:03:16 +08:00
bunnie
6eecc52961 rollover handling in rtc wake alarm routine 2026-04-07 18:02:47 +08:00
bunnie
47f00a0d45 add chrono to deps 2026-04-07 15:59:30 +08:00
bunnie
b8194e7c83 add RTC wakeup alarm handling
a bit convoluted:

- RTC wakeup goes through the "always on" subsystem
- keyboard routes through "always on" because the system can wake
on keyboard press
- thus the keyboard mechanism is abused/re-used to pass wakeup
events throughout the system.

Other notes - a wakeup alarm sent within 2 seconds of the current
time will trigger an assert. It's not recommended to use the RTC
for very near-term wakeups because if you e.g. hit swap or have
something else going on that's very "busy" (like QR code scanning)
the system might not get to waking things up in time.

Some code can be written to handle this and set up a degenerate
wakeup, maybe, but for now, I am leaving it as an assert because
I want to remind myself that there is an edge case here.
2026-04-07 15:57:19 +08:00
bunnie
b522993ae9
Merge pull request #847 from betrusted-io/ux-work
UX work
2026-04-07 01:01:52 +08:00