nrf52: use cortexm.ld script when applicable#11127
Conversation
|
It looks like the So need to adapt |
|
Indeed |
Thanks! |
|
Testing command: have You would need to add this before changing the linker to have both supported: 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: 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 |
|
I can push them to your branch if you want. |
Please do so, I think you should know by now how skilled I am with makefiles :-) |
|
Although I should be able to manage this much, anyway feel free to push :-) |
|
I checked just in case, it cannot currently be used for the |
|
I will run the whole test suite with this configuration on |
|
The test suit have the same failure as master:
|
|
I tested for the Are there other things that need to be checked ? |
|
For me the changes look ok and good on my local tests with the |
|
I don't have anything specific for this. I would assume that if the binaries still work it should be okay. @kYc0o Do you have any suggestions for testing this? |
|
I will check all examples with |
CI should do most if the flag is enabled, for nrf52dk. |
sorry, no, not the examples... |
It looks ok for me and if the test |
|
I meant checking the .bin sha1 for examples. And no worry |
|
I compared the The |
cladmi
left a comment
There was a problem hiding this comment.
I agree with the changes and tested. Please squash.
|
As I also contributed to this PR maybe somebody else should also |
Hack and ACK? 😆 |
|
Please squash for the final check. |
Prepare mcuboot for changing `nrf52` to use `cortexm.ld`. It sets the offset for linking the image.
The common linker script is not used when the nordic_softdevice_ble is included
Linkerscript for `nrf52dk` has been updated to use `cortexm.ld` so does not need the configuration anymore for the removed `cpu/nrf52/ldscripts/nrf52832xxaa.ld`.
5daeede to
a3df00c
Compare
|
@cladmi Squashed, please verify if I put the commits in the right order :) |
|
The order is good for me. I re-tested Small non related issue:For some reason, my board was in a state where I needed to erase the rom to have it working. But after that, it worked properly |
|
Seems to be an issue with the nrf52dk board hooked up to the CI here. |
|
All green, who would like to press the big green button‽ |
|
Everything good here -> go! |
Contribution description
Split off from #11126, this reworks the nrf52840 and nrf52832 makefiles to use the
cortexm.ldscript when thenordic_softdevice_bleis not included in the build. The common linker script is not used when the nordic_softdevice_ble isincluded
the
nrf52832xxaa.ldincluded aboot_offsetin the calculation, not sure if it was used or not.Testing procedure
Builds with the nrf52840 and nrf52832 should still work.
Issues/PRs references
Required for #11126