Commit graph

17 commits

Author SHA1 Message Date
f60a29137c Fix bootloader hardware bring-up and add key-based boot entry
Hardware-tested the UF2 bootloader end to end on a real VersaPad v2
board. Found and fixed a real bug: the bootloader's jump into the app
(__set_MSP -> SCB->VTOR -> bx) hard-faulted on every standalone boot,
even with the debugger fully disconnected; identical register/VTOR
values injected directly by a halted debugger ran fine, which pointed
at the missing __DSB()/__ISB() barriers ARM's own guidance requires
for this exact pattern. Also fixed a USB PID collision (0x0011 is
Adafruit's own Gemma M0 bootloader PID, misidentified by Windows as a
Circuit Playground COM port instead of exposing VERSABOOT).

This board has no dedicated reset/boot button, so add a hardware boot
entry that doesn't need one: holding the bottom-right Cherry MX key
(key_id 24) during reset/power-on drives its matrix row and reads its
column directly in the bootloader, before the app is even validated.

Also corrected the app-side flash_with_bootloader.ld (was missing the
NVM carve-out flash_without_bootloader.ld already has) and
boards/versapad.json (wrong flash/RAM size, wrong MCU macro, stale
PID), and enabled the previously-commented-out env:versapad_usb.

Documented findings in bootloader/README.md, bootloader/TESTING.md,
and doc/09_known_limitations.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 21:28:15 +02:00
cjjohn
4749adcd1d Add hardware bring-up instructions for bootloader testflash 2026-08-03 21:15:02 +02:00
cjjohn
de52b57041 Add UF2 bootloader for USB firmware flashing
Vendored and trimmed from microsoft/uf2-samdx1, adapted to the actual
ATSAMD21G17D (128 KiB flash / 16 KiB RAM), fixing the flash/RAM-size
mismatch that the previously commented-out SAM-BA bootloader target
had (it assumed a 256 KiB SAMD21G18A). Builds as a standalone
PlatformIO environment (bootloader/platformio.ini), no python2/make
dependency. Compiles clean, fits in the 8 KiB bootloader region
(7292/8192 bytes). Not yet flashed/verified on real hardware.
2026-08-03 20:56:58 +02:00
ce5db617a1 Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
50dbf8fbee Update firmware documentation and agent guidance 2026-07-24 09:27:07 +02:00
ac3b2aa90f Fixed encoder direction 2026-04-19 00:41:36 +02:00
24b349de26 Anpassung 16bit offset 2026-04-19 00:25:59 +02:00
802ab858e1 Added config, added factory reset functionality 2026-04-18 23:59:48 +02:00
433d61c29f 8 Step macro and profile switching fully working 2026-04-13 22:34:54 +02:00
098a166a9f Semi working profiles and longer macros 2026-04-13 21:42:02 +02:00
7169d3bbba Changed Anforderungskatalog 2026-03-31 22:05:59 +02:00
3e83758f05 Added hold function and updated doc 2026-03-31 21:46:20 +02:00
d6ed7cb81f Added mcu recommendation and merged project-context content from earlier 2026-03-30 19:53:34 +02:00
9079fefad8 Added doc 2026-03-30 19:52:37 +02:00
0b3c5f3217 Updated readme 2026-03-29 23:10:08 +02:00
59b3cb4dd1 Added Macro functionality, updated readme 2026-03-29 22:19:27 +02:00
b49984b9c0 Initial commit 2026-03-29 14:47:13 +02:00