VersaMCU/bootloader/platformio.ini
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

25 lines
803 B
INI

; VersaPad v2 -- UF2 bootloader
; Vendored + adapted from Microsoft uf2-samdx1 (https://github.com/microsoft/uf2-samdx1),
; trimmed to SAMD21 only, no self-update (SELF_EXECUTABLE) build, no Arduino framework.
; Programmer: Atmel-ICE via SWD, same as the app firmware in ../platformio.ini.
[env:versapad_bootloader]
platform = atmelsam
board = versapad_bootloader
build_flags =
-D__SAMD21G17A__
-DSAMD21
-DCRYSTALLESS
-DFLASH_NUM_ROWS=512 ; ATSAMD21G17D: 128 KiB / 256 B rows (uf2.h defaults to 1024, the 256 KiB G18A value)
-I.
-Iinclude
-Iinc
-Ilib/cmsis/CMSIS/Include
-Ilib/samd21/samd21a/include
-Ilib/usb_msc
board_build.ldscript = scripts/samd21g17a.ld
upload_protocol = custom
extra_scripts = ../upload_openocd.py
debug_tool = openocd