adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
427 stars 380 forks source link

Tool to merge application firmware with bootloader for factory SWD/JLINK-programming #290

Open levpopov opened 1 year ago

levpopov commented 1 year ago

Is your feature request related to a problem? Please describe. It'd be great to be able to flash both the bootloader and initial application firmware in one go when connected over SWD. AFAICT the only way to properly write bootloader settings is by actually performing a firmware update, which is inconvenient since this requires reconnecting target over USB (vs just using already connected SWD/JTAG).

Describe the solution you'd like A CLI tool for merging application hex with bootloader hex that will configure the settings page to point to the bundled firmware.

Describe alternatives you've considered A potentially simpler option would be to just have a build flag for the bootloader to assume that a valid firmware has already been flashed (vs assuming empty). Application firmware would still be written over SWD but can be in a separate hex.

Additional context N/A

vivek-pai commented 12 months ago

I wrote a script to generate the correct bootloader settings from app firmware. With mergehex, I'm able to merge the bootloader, settings, and app into a single hex and flash that. I'm using it in my circuitpython build and it seems to be working great.