[riot-notifications] [RIOT-OS/RIOT] nrf52: use cortexm.ld script when applicable (#11127)

Gaƫtan Harter notifications at github.com
Thu Mar 7 16:42:05 CET 2019


You would need to add this before changing the linker to have both suppported:

``` diff
diff --git a/makefiles/mcuboot.mk b/makefiles/mcuboot.mk
index 09987798c..a20cc686b 100644
--- a/makefiles/mcuboot.mk
+++ b/makefiles/mcuboot.mk
@@ -22,6 +22,7 @@ $(MCUBOOT_KEYFILE):
        $(Q)$(IMGTOOL) keygen -k $@ -t rsa-2048
 endif

+mcuboot: ROM_OFFSET=$$(($(MCUBOOT_SLOT0_SIZE) + $(IMAGE_HDR_SIZE)))
 mcuboot: mcuboot-create-key link
        @$(COLOR_ECHO)
        @$(COLOR_ECHO) '$(COLOR_PURPLE)Re-linking for MCUBoot at $(MCUBOOT_SLOT0_SIZE)...$(COLOR_RESET)'
```

And then after changing the linker script you can remove these lines as the old one is unused.

```diff
diff --git a/makefiles/mcuboot.mk b/makefiles/mcuboot.mk
index 09987798c..86bf9b092 100644
--- a/makefiles/mcuboot.mk
+++ b/makefiles/mcuboot.mk
@@ -26,9 +26,7 @@ mcuboot: mcuboot-create-key link
        @$(COLOR_ECHO)
        @$(COLOR_ECHO) '$(COLOR_PURPLE)Re-linking for MCUBoot at $(MCUBOOT_SLOT0_SIZE)...$(COLOR_RESET)'
        @$(COLOR_ECHO)
-       $(Q)$(_LINK) $(LINKFLAGPREFIX)--defsym=offset="$$(($(MCUBOOT_SLOT0_SIZE) + $(IMAGE_HDR_SIZE)))" \
-       $(LINKFLAGPREFIX)--defsym=length="$$(($(MCUBOOT_SLOT1_SIZE) - $(IMAGE_HDR_SIZE)))" \
-       $(LINKFLAGPREFIX)--defsym=image_header="$(IMAGE_HDR_SIZE)" -o $(ELFFILE) && \
+       $(Q)$(_LINK) -o $(ELFFILE) && \
        $(OBJCOPY) $(OFLAGS) -Obinary $(ELFFILE) $(BINFILE) && \
        $(IMGTOOL) sign --key $(MCUBOOT_KEYFILE) --version $(IMAGE_VERSION) --align \
        $(MCUBOOT_IMAGE_ALIGN) -H $(IMAGE_HDR_SIZE) $(BINFILE) $(SIGN_BINFILE)
```

You can also remove `cpu/cortexm_common/ldscripts/multislot.ld` when you remove `cpu/nrf52/ldscripts/nrf52832xxaa.ld`.

-- 
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/11127#issuecomment-470576268
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190307/c45c0d36/attachment.html>


More information about the notifications mailing list