dist/tools/uf2: integrate flashing of adafruit bootloader #21330
+46
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
Since #21281, boards using the adafruit nrf52 uf2 bootloader will default to keeping the SoftDevice (although not using it) and are checked to have the expected SoftDevice version present. If it is not, a warning is presented to the user requiring them to (re)install the bootloader manually.
This PR offers an automated way of installing the bootloader. Currently it doesn't work as intended though since the bootloader is for some reason required to be flashed twice (for the softdevice to be properly installed), and a second flashing fails unless the board was power-cycled in-between. We could certainly add interactive instructions for the user, but maybe there is a better way?
Also, the
flash-dfucommand requirespip3 install --user adafruit-nrfutilwhich is currently not checked for nor installed automatically. Maybepipxwould be an option.Would be nice to have some kind of solution before the next RIOT release though, as previous users will otherwise need to perform the inconvenient manual bootloader reflash.
Testing procedure
make -C examples/basic/hello-world BOARD=feather-nrf52840-sense UF2_SOFTDEV=DROP flash, press enter to continue.make -C examples/basic/hello-world BOARD=feather-nrf52840-sense flash, press enter to continue and install the bootloader.Issues/PRs references
Follow-up of #21281.