Merge pull request #11620 from cladmi/pr/softdevice/ensure_memory_value

pkg/nordic_softdevice_ble: reset memory in the .hex file
This commit is contained in:
Alexandre Abadie 2019-09-10 14:38:33 +02:00 committed by GitHub
commit 3059e03c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -21,7 +21,7 @@ ifeq (jlink,$(PROGRAMMER))
# special options when using SoftDevice
ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex
export JLINK_PRE_FLASH := loadfile $(BINDIR)/softdevice.hex
export FLASH_ADDR := 0x1f000
export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
# murdock: softdevice.hex file is used for flashing

View File

@ -21,8 +21,11 @@ prepare: $(PKG_SRCDIR)/.extracted
$(BINDIR)/ble_6lowpan.a: $(PKG_SRCDIR)/.extracted
cp $(PKG_SRCDIR)/$(BLE_6LOWPAN_LIB) $@
# softdevice.hex has the `[0x8bc, 0x3000[` addresses not set.
# However, it requires that the value at `0x2000` is 0xFFFFFFFF
# We just put all the undefined memory to 0xff as it is the rom reset value anyway.
$(BINDIR)/softdevice.hex: $(PKG_SRCDIR)/.extracted
cp $(PKG_SRCDIR)/$(SOFTDEVICE) $@
$(Q)$(OBJCOPY) $(OFLAGS) -Oihex --gap-fill 0xff $(PKG_SRCDIR)/$(SOFTDEVICE) $@
$(PKG_SRCDIR)/.extracted: $(PKG_BUILDDIR)/$(PKG_FILE)
rm -rf $(@D)