Repository navigation
Conversation
The single-bank DFU erased bank 0 as soon as the start packet arrived and checked the device type, revision and installed SoftDevice only later, with the init packet. A package built for another SoftDevice was refused after the application was already gone, leaving the board in the bootloader. RRAM is written without an erase, so the bulk erase is dropped. The start packet is acknowledged at once, and bank 0 is marked invalid in the settings only after dfu_init_prevalidate() accepts the init packet. A refused package now leaves the application in place.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@cvaldess could you have a look at this? |
|
Tested on my nRF54L15-DK (s145 9.0.0, previously on v0.3.0). I flashed only this bootloader over SWD (1bbbadb,
Read over SWD after step 4: the application is running and bank 0 is valid with the size of the step 3 image (437048 B). The rest of the settings page is unchanged, and the application region matches that image byte for byte. Then I repeated step 2 and read the board while it sat in the bootloader: bank 0 is Not covered: serial DFU (the VCOM on this DK doesn't deliver bytes). |
Description of Change
The single-bank DFU erased bank 0 when the start packet arrived and checked the device type, revision and installed SoftDevice only later, in
dfu_init_prevalidate()with the init packet. A package built for another SoftDevice (for example--sd-req 0x310Don a board with s145 9.0.0) was refused after the application was already gone, leaving the board in the bootloader without an application.RRAM is written without an erase, and both write paths (
flash_nrf5x_write()on serial,sd_flash_write()through pstorage on BLE) already write without one, so the bulk erase is dropped:dfu_init_prevalidate()accepts the init packet. The settings write goes through the same pstorage queue as the data writes, so it lands before the first data packet.The transports are unchanged. adafruit-nrfutil waits after the start packet for the old erase and then sends the image right after the init packet, so the erase could not simply move to the init packet without risking ACK timeouts on large images. The dual-bank variant (
DUALBANK_FW, off by default) is not changed.Boards that already run v0.3.0 keep the old behavior until their bootloader is updated. This should go in before the bootloader release for s145 10.0.1.
Testing
Not yet tested on hardware. To check on an nRF54L15-DK:
--sd-req, over serial and over BLE: refused, and the board boots the existing application afterwards.Summary by CodeRabbit