Skip to content

boards/adafruit-{clue,itsybitsy-nrf52}: Convert to Common adafruit-nrf52-bootloader module #21395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 8, 2025

Conversation

crasbe
Copy link
Contributor

@crasbe crasbe commented Apr 11, 2025

Contribution description

The aim of this PR is twofold:

  1. It would be nice to not have the SoftDevice version hard-coded, which prevents using the adafruit-nrfutil with boards such as the seeedstudio-xiao-nrf52840(-sense).

  2. Migrate the only two boards using the adafruit-nrfutil to the common boards_common_adafruit-nrf52-bootloader.
    In the process, the Makefile of the adafruit-itsybitsy-nrf52 can be decluttered, a lot of duplicate code is present and it abuses the nrfutil programmer target.

2a) Change the default bootloader to uf2conv.

The Magic Double Tap values of the Clue and Itsybitsy-nRF52 don't enable the MSD feature which uf2conv would use, so they are in-fact adafruit-nrfutil only.

Open Discussion Points: The Clue and Itsybitsy-nRF52 should work with uf2conv as well, that would drop the requirement to install adafruit-nrfutil, which has it's own quirks...

ToDos:
1) Change the documentation to hint to the common Adafruit nRF52 Bootloader documentation in both the doc.txt of the clue and itsybitsy as well as the common Flashing documentation: doc/doxygen/src/flashing.md

2) Make the common reset.c more universal so that different Magic Double Tap values can be set (0x4E for the adafruit-nrfutil and 0x57 for uf2conv).

Testing procedure

BOARD=adafruit-clue make -C tests/sys/shell flash term should still work. If you don't have a Clue or Itsybitsy-nRF52, you can flash the Adafruit nRF52 Bootloader to an nRF52840DK as well.

Issues/PRs references

None.

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 11, 2025
@github-actions github-actions bot added Area: build system Area: Build system Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Apr 11, 2025
@riot-ci
Copy link

riot-ci commented Apr 11, 2025

Murdock results

✔️ PASSED

a7536df boards/ada-nrf52-bl: add note about Automounting for uf2conv

Success Failures Total Runtime
10337 0 10337 12m:28s

Artifacts

@crasbe crasbe requested review from aabadie and jia200x as code owners April 12, 2025 20:52
@github-actions github-actions bot added the Area: doc Area: Documentation label Apr 12, 2025
@crasbe
Copy link
Contributor Author

crasbe commented Apr 12, 2025

Make the common reset.c more universal so that different Magic Double Tap values can be set (0x4E for the adafruit-nrfutil and 0x57 for uf2conv).

I thought about this some more and it probably doesn't make sense to do that. The value 0x57 to enable the MSD is also compatible with adafruit-nrfutil, but the value 0x4E that only enables the serial interface is not compatible with uf2conv.
The only downside might be that 0x57 could not be compatible with ooooooold bootloader versions. But there is a long tutorial on how to update the bootloader.

@crasbe crasbe removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Apr 12, 2025
crasbe added 4 commits May 7, 2025 15:31
The Adafruit Clue and Itsybitsy nRF52 also use the Adafruit nRF52
Bootloader which has a common module that can be used.
Especially the Itsybitsy nRF52 (mis)uses the nrfutil programmer
target and has a lot of redundant code.

Furthermore, the Double Tap Magic Value used by both boards
is incorrect for using the USB Bootloader.
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit. I trust your testing.

@crasbe crasbe force-pushed the pr/ada-nrfutil branch from c5cc806 to a7536df Compare May 8, 2025 08:46
@crasbe
Copy link
Contributor Author

crasbe commented May 8, 2025

@maribu let me know if the new change satisfies you, then we can merge (or you hit the merge button if you're happy).

@maribu maribu added this pull request to the merge queue May 8, 2025
Merged via the queue into RIOT-OS:master with commit 098bc8d May 8, 2025
26 checks passed
@crasbe
Copy link
Contributor Author

crasbe commented May 8, 2025

Thank you for the review :)

@crasbe crasbe deleted the pr/ada-nrfutil branch May 8, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants