VersaMCU/doc
Julian Appel 01c5e0930e Guard env:versapad's upload against overwriting the bootloader
pio run -e versapad --target upload writes the app starting at
0x0000 and silently destroyed the installed UF2 bootloader twice
today during testing -- no warning, no error, just a board that
stopped responding to the boot-key hold.

upload_openocd.py now checks for the bootloader (verify_image against
the locally built bootloader/.pio/build/versapad_bootloader/firmware.bin)
before an env:versapad upload and refuses if one is present, pointing
at env:versapad_usb instead. Fails closed: an inconclusive check (e.g.
bootloader not built locally, SWD not responding) blocks rather than
proceeding on a guess -- confirmed necessary the hard way, since a
"fail open" first attempt let the destructive upload through silently.
Scoped to PIOENV == "versapad" only, since bootloader/platformio.ini's
own upload reuses this same script and must always be allowed to write
0x0000. A new erase-bootloader-and-flash custom target remains as the
explicit, deliberate override.

Documented the workflow (bootloader is its own PlatformIO project,
flashed once via SWD; versapad_usb is the normal path afterward;
versapad's upload is now guarded) in README.md and
doc/10_usb_bootloader.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 23:27:02 +02:00
..
00_architecture.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
01_matrix.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
02_encoder.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
03_action_engine.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
04_macro_system.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
05_led_system.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
06_nvm_config.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
07_serial_protocol.md Harden firmware state and transfer handling 2026-07-24 09:49:21 +02:00
08_development.md Fold bootloader documentation into the main doc/ index 2026-08-05 22:49:56 +02:00
09_known_limitations.md Fold bootloader documentation into the main doc/ index 2026-08-05 22:49:56 +02:00
10_usb_bootloader.md Guard env:versapad's upload against overwriting the bootloader 2026-08-05 23:27:02 +02:00
INDEX.md Fold bootloader documentation into the main doc/ index 2026-08-05 22:49:56 +02:00