[riot-notifications] [RIOT-OS/RIOT] boards: add support for nrf52840-dongle (#13146)

Alexandre Abadie notifications at github.com
Fri May 8 11:21:05 CEST 2020


@aabadie requested changes on this pull request.

I have a few comments.

> @@ -3,7 +3,7 @@ CPU = nrf52
 # Put defined MCU peripherals here (in alphabetical order)
 FEATURES_PROVIDED += periph_rtt
 FEATURES_PROVIDED += periph_timer
-ifeq (,$(filter nordic_softdevice_ble,$(USEPKG)))
+ifeq (,$(filter nordic_softdevice_ble,$(USEPKG))$(filter bootloader_nrfutil,$(FEATURES_PROVIDED)))

I don't think it's necessary to change that file.

> @@ -0,0 +1,11 @@
+ifneq (,$(filter saul_default,$(USEMODULE)))
+  USEMODULE += saul_gpio
+endif
+
+# ethos only works on the UART-based stdio; when present, don't attempt to use CDC-ACM...
+ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))

```suggestion
ifeq (,$(filter-out stdio_cdc_acm,$(filter stdio_% slipdev_stdio,$(USEMODULE))))
  FEATURES_REQUIRED += bootloader_nrfutil
```

> @@ -0,0 +1,11 @@
+ifneq (,$(filter saul_default,$(USEMODULE)))
+  USEMODULE += saul_gpio
+endif
+
+# ethos only works on the UART-based stdio; when present, don't attempt to use CDC-ACM...

```suggestion
# use nrfutil-bootloader/stdio_cdc_acm only if no other stdio_% other than stdio_cdc_acm
# is requested
```

> @@ -0,0 +1,28 @@
+# This board uses the vendor's serial bootloader
+
+PROGRAMMER ?= nrfutil
+
+ifeq (nrfutil,$(PROGRAMMER))
+
+# Using nrfutil implies using the Nordic bootloader described at

indentation should be 2 spaces in this `ifeq block`

> +# Using nrfutil implies using the Nordic bootloader described at
+# <https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial>.
+#
+# It has a static MBR at the first 4k, and an ample 128k Open USB Bootloader at
+# the end, leaving 892k for the application. This overwrites any SoftDevice,
+# but that's what the minimal working example for the dongle does as well.
+
+ROM_OFFSET = 0x1000
+FW_ROM_LEN = 0xdf000
+
+FLASHFILE = $(HEXFILE)
+FLASHDEPS += $(HEXFILE).zip
+FLASHER = nrfutil
+FFLAGS = dfu usb-serial --port=${PORT} --package=$(HEXFILE).zip
+
+%.hex.zip: %.hex

This target could be moved outside the ifeq block.

> +
+### Links
+
+- [nRF52840 web page](https://www.nordicsemi.com/?sc_itemid=%7BCDCCA013-FE4C-4655-B20C-1557AB6568C9%7D)
+- [documentation and hardware description](https://infocenter.nordicsemi.com/topic/ug_nrf52840_dongle/UG/nrf52840_Dongle/intro.html?cp=3_0_5)
+
+### Flash the board
+
+The board is flashed using its on-board boot loader; the
+[nrfutil](https://github.com/NordicSemiconductor/pc-nrfutil) program needs to
+be installed. That can turn the binary into a suitable zip file and send it to the
+bootloader.
+
+The process is automated in the usual `make flash` target. For that process to
+complete, you need to enter the bootloader manually by pressing the board's
+reset button. Readiness of the bootloader is indicated by LD2 pulsing in red.

> I'd prefer not to introduce that hack onto platforms where it's not the default convention of the hardware.

The board is not provided by default with the nrfutil bootloader ?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13146#pullrequestreview-408108913
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200508/c8c6e27c/attachment.htm>


More information about the notifications mailing list