[riot-notifications] [RIOT-OS/RIOT] boards/common/nrf52: add openocd support for 'nordic_softdevice_ble' (#11470)

Gaëtan Harter notifications at github.com
Wed Sep 11 14:25:54 CEST 2019


cladmi commented on this pull request.



> @@ -41,8 +41,24 @@ else ifeq (openocd,$(PROGRAMMER))
   # for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version
   # build from source (master > 2018, August the 13rd) is required.
   ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
-    # openocd doesn't work (yet) with softdevice
-    $(error Cannot use OpenOCD with nordic_softdevice module)
+    LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
+
+    export OPENOCD_PRE_FLASH_CMDS += -c 'flash write_image erase "$(BINDIR)/softdevice.hex"'
+    export OPENOCD_PRE_VERIFY_CMDS += -c 'verify_image "$(BINDIR)/softdevice.hex"'
+
+    # Cannot use the 'ELFFILE' here
+    # The segments are 0x10000 aligned so padding bytes are copied and verified
+    #
+    # Using 'LINKFLAGS += -Wl,--nmagic' prevents it but would require
+    # dedicated testing/review
+    FLASHFILE ?= $(HEXFILE)
+
+    # murdock: softdevice.hex file is used for flashing

I thought about it when I added the `murdock` fix with `jlink`.

The reason was that the flashing handling for the package was done in there.
So it is needed as the current flash command is done this way.
Also, the specification of a different linking is also done by matching the package in here without "configuration" mode so I just repeated the pattern.

Also, if flashing was done with merging the files, and changing `FLASHFILE`, the murdock handling would not be needed (except other bugs).

But here, it does its own uncommon specific way of flashing, so preferred keep the file here.

The part of saying the file needs to be taken into account could go in the package, and the "need upload" in that one, but there is only one variable for both…

-- 
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/11470#discussion_r323210956
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190911/d34e52c6/attachment-0001.htm>


More information about the notifications mailing list