Skip to content

Commit ebcb656

Browse files
committed
boards/common/ada-nrf52-bootl: refactor and enhance documentation
1 parent ec6cd78 commit ebcb656

File tree

1 file changed

+70
-46
lines changed
  • boards/common/adafruit-nrf52-bootloader

1 file changed

+70
-46
lines changed

boards/common/adafruit-nrf52-bootloader/doc.md

Lines changed: 70 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,37 @@
22
@ingroup boards_common
33
@brief Common Flashing Description for the Adafruit nRF52 Bootloader
44

5-
## Flashing the Board
5+
## Introduction
66

7-
The board is flashed using its on-board UF2 boot loader by default.
8-
The boot loader will present a mass storage device that has to be mounted to /media/MDK-DONGLE so
9-
`uf2conv.py` can find it. If you have an auto-mounter installed this will happen automatically.
7+
The Adafruit nRF52 Bootloader is used by many Adafruit and Seeedstudio boards
8+
that are based on the Nordic Semiconductor nRF52 microcontroller family.
9+
It features a Mass Storage Device emulation, so that UF2 files can be uploaded
10+
via Drag and Drop. It is also backwards compatible to the BOSSA bootloader.
11+
With the Adafruit nRF52 Bootloader, no external debugger such as a J-Link is
12+
necessary for the normal usage.
1013

11-
The rest of the process is automated in the usual way with e.g. `BOARD=feather-nrf52840`.
14+
In some cases the bootloader may be too old to even mount on startup.
15+
Enter the bootloader mode (usually by double tapping the reset button for
16+
nRF52840 based boards) and check the `INFO_UF2.TXT` for bootloader information.
17+
If the version is less than `0.4.0`, please refer to @ref ada-nrf52-update.
18+
19+
Until and including RIOT Release 2025.01, the SoftDevice on `feather-nrf52840`
20+
and `feather-nrf52840-sense` boards got erased when flashing RIOT. To restore
21+
the ability of using i.a. Arduino and CircuitPython, the SoftDevice has to be
22+
flashed again. Please also refer to @ref ada-nrf52-update.
23+
24+
If the bootloader is not present on your board at all, an external debugger
25+
such as the J-Link has to be used. Please refer to @ref ada-nrf52-reflashing.
26+
27+
## Flashing the Board with RIOT
28+
29+
The board is flashed using its on-board UF2 bootloader by default.
30+
The bootloader will present a mass storage device that has to be mounted so
31+
the RIOT buildsystem can find it. If you have an auto-mounter installed this
32+
will happen automatically.
33+
34+
The rest of the process is automated in the usual way with e.g.
35+
`BOARD=feather-nrf52840`.
1236

1337
Example with `hello-world` application:
1438
```
@@ -39,63 +63,63 @@ for SoftDevice Version 6.1.1 and `SD730` for Version 7.3.0.
3963
make a reflash of the SoftDevice necessary. Do not change it unless you know
4064
what you're doing!**
4165

42-
Otherwise see the **Flashing** section in @ref boards_common_nrf52. The easiest way is to
43-
use an external Segger J-Link Programmer connected to the [SWD Connector].
66+
## Updating Old Bootloaders and Restoring the SoftDevice {#ada-nrf52-update}
4467

45-
[SWD Connector]: https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/pinouts#swd-connector-3-12
68+
If the Adafruit nRF52 Bootloader is still present on the board but outdated
69+
or the SoftDevice got erased (the `INFO_UF2.TXT` file will show
70+
`SoftDevice: not found`), you can flash the bootloader via DFU.
4671

47-
## (Re-)Flashing the UF2 Bootloader
72+
As prerequisites, the `arm-none-eabi-gcc` compiler (which is usually already
73+
present if you compiled something for your nRF52 board) and the
74+
`adafruit-nrfutil` have to be installed.
4875

49-
To flash the UF2 bootloader (if it is no longer present on your board),
50-
you need to have [`nrfjprog`][nrfjprog] installed,
51-
connect a jlink to your BOARD and execute the following commands.
76+
Details on the installation process can be found in [Adafruit's GitHub
77+
repository](https://github.com/adafruit/Adafruit_nRF52_Bootloader).
5278

5379
@note The Adafruit nRF52 Bootloader uses other board names than RIOT. The
5480
`feather-nrf52840` for example is called `feather_nrf52840_express`.
5581
Be sure to check the `boards/` subfolder in the bootloader directory
5682
to find out the correct board name.
5783

58-
~~~~~~~~~~~~~{.sh}
59-
git clone [email protected]:adafruit/Adafruit_nRF52_Bootloader.git
84+
With the following commands, the bootloader with SoftDevice will be compiled
85+
and flashed. For MacOS, you might have to select a different serial port.
86+
87+
```
88+
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader.git
6089
cd Adafruit_nRF52_Bootloader
61-
# only download what is needed, use
62-
# `git submodule update --init --recursive`
63-
# to download everything
6490
git submodule update --init
65-
git -C lib/tinyusb submodule update --init hw/mcu/nordic/nrfx/
6691
pip3 install --user adafruit-nrfutil
67-
make BOARD=feather_nrf52840_express all
68-
make BOARD=feather_nrf52840_express flash
69-
make BOARD=feather_nrf52840_express flash-sd
70-
~~~~~~~~~~~~~
71-
72-
[nrfjprog]: https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools
73-
74-
## Updating Old Bootloaders and Restoring the SoftDevice
92+
make BOARD=feather_nrf52840_sense SERIAL=/dev/ttyACM0 flash-dfu
93+
```
7594

76-
In some cases the bootloader may be too old to even mount on startup.
77-
Enter the bootloader mode (usually by double tapping the reset button for
78-
nRF52840 based boards) and check the `INFO_UF2.TXT` for bootloader information.
79-
If the version is less than `0.4.0` then one can use the
80-
[Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader)
81-
tool to update.
82-
83-
Until and including RIOT Release 2025.01, the SoftDevice on `feather-nrf52840` and
84-
`feather-nrf52840-sense` boards got erased when flashing RIOT. To restore the
85-
ability of using i.a. Arduino and CircuitPython, the SoftDevice has to be
86-
flashed again. This can be done in the same way as updating the bootloader.
8795
Sometimes the process has to be done twice until the SoftDevice is successfully
8896
restored.
8997

90-
For example, one can run the following if `arm-none-eabi-gcc` and
91-
`adafruit-nrfutil` are installed. Make sure to select the correct board for your
92-
application.
93-
```
94-
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader.git
98+
Further information about the update process can be found on the
99+
[Adafruit Website](https://learn.adafruit.com/adafruit-feather-sense/update-bootloader).
100+
101+
## (Re-)Flashing the UF2 Bootloader with an External Debugger {#ada-nrf52-reflashing}
102+
103+
To flash the UF2 bootloader (if it is no longer present on your board),
104+
you need to have the original [`nrfjprog`][nrfjprog] installed and a compatible
105+
debugger, such as a J-Link. Make sure to select the right board (see the note
106+
in @ref ada-nrf52-update).
107+
108+
~~~~~~~~~~~~~{.sh}
109+
git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader
95110
cd Adafruit_nRF52_Bootloader
96111
git submodule update --init
97-
make BOARD=feather_nrf52840_sense SERIAL=/dev/ttyACM0 flash-dfu
98-
```
112+
nrfjprog --recover
113+
make BOARD=feather_nrf52840_express flash
114+
make BOARD=feather_nrf52840_express flash-sd
115+
~~~~~~~~~~~~~
99116

100-
Further information can be found on the
101-
[Adafruit Website](https://learn.adafruit.com/adafruit-feather-sense/update-bootloader).
117+
More information about how to flash nRF52 microcontrollers can be found in the
118+
**Flashing** section in @ref boards_common_nrf52. Some variants of the
119+
Adafruit Feather feature an [SWD Connector], to which an external debugger can
120+
be connected. Other boards such as the Seeedstudio Xiao nRF52840 only have
121+
solder pads.
122+
123+
[SWD Connector]: https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/pinouts#swd-connector-3-12
124+
125+
[nrfjprog]: https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools

0 commit comments

Comments
 (0)