mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-22 13:03:54 +01:00
Merge pull request #11127 from bergzand/pr/nrf52/ref_ldscripts
nrf52: use cortexm.ld script when applicable
This commit is contained in:
commit
de720730f6
@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
|
|
||||||
*
|
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
|
||||||
* General Public License v2.1. See the file LICENSE in the top level
|
|
||||||
* directory for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup cpu_cortex_common
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* @file
|
|
||||||
* @brief Offset definitions for cortex MCUs
|
|
||||||
*
|
|
||||||
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
||||||
*
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
boot_offset = DEFINED( offset ) ? offset : 0x0 ;
|
|
||||||
rom_length = DEFINED( length ) ? length : rom_length ;
|
|
||||||
@ -7,6 +7,21 @@ export MCUBOOT_SLOT0_SIZE = 0x8000
|
|||||||
export MCUBOOT_SLOT1_SIZE = 0x3C000
|
export MCUBOOT_SLOT1_SIZE = 0x3C000
|
||||||
export MCUBOOT_SLOT2_SIZE = 0x3C000
|
export MCUBOOT_SLOT2_SIZE = 0x3C000
|
||||||
|
|
||||||
|
# Set ROM and RAM lengths according to CPU model
|
||||||
|
ifneq (,$(filter nrf52832xxaa,$(CPU_MODEL)))
|
||||||
|
ROM_LEN ?= 0x80000
|
||||||
|
RAM_LEN ?= 0x10000
|
||||||
|
endif
|
||||||
|
ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL)))
|
||||||
|
ROM_LEN ?= 0x100000
|
||||||
|
RAM_LEN ?= 0x40000
|
||||||
|
endif
|
||||||
|
|
||||||
|
ROM_START_ADDR ?= 0x00000000
|
||||||
|
RAM_START_ADDR ?= 0x20000000
|
||||||
|
|
||||||
|
LINKER_SCRIPT ?= cortexm.ld
|
||||||
|
|
||||||
ifneq (,$(filter nrf802154,$(USEMODULE)))
|
ifneq (,$(filter nrf802154,$(USEMODULE)))
|
||||||
CFLAGS += -DGNRC_NETIF_MSG_QUEUE_SIZE=16
|
CFLAGS += -DGNRC_NETIF_MSG_QUEUE_SIZE=16
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 Freie Universität Berlin
|
|
||||||
*
|
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
|
||||||
* General Public License v2.1. See the file LICENSE in the top level
|
|
||||||
* directory for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup cpu_nrf52
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* @file
|
|
||||||
* @brief Memory definitions for the NRF52832XXAA
|
|
||||||
*
|
|
||||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
||||||
*
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
rom_length = 512K;
|
|
||||||
|
|
||||||
INCLUDE multislot.ld
|
|
||||||
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
rom (rx) : ORIGIN = 0x00000000 + boot_offset, LENGTH = rom_length
|
|
||||||
ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 64K
|
|
||||||
}
|
|
||||||
|
|
||||||
INCLUDE cortexm_base.ld
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017 Freie Universität Berlin
|
|
||||||
*
|
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
|
||||||
* General Public License v2.1. See the file LICENSE in the top level
|
|
||||||
* directory for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup cpu_nrf52
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* @file
|
|
||||||
* @brief Memory definitions for the NRF52840XXAA
|
|
||||||
*
|
|
||||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
||||||
*
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
rom (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
|
|
||||||
ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 256K
|
|
||||||
}
|
|
||||||
|
|
||||||
INCLUDE cortexm_base.ld
|
|
||||||
@ -22,13 +22,12 @@ $(MCUBOOT_KEYFILE):
|
|||||||
$(Q)$(IMGTOOL) keygen -k $@ -t rsa-2048
|
$(Q)$(IMGTOOL) keygen -k $@ -t rsa-2048
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
mcuboot: ROM_OFFSET=$$(($(MCUBOOT_SLOT0_SIZE) + $(IMAGE_HDR_SIZE)))
|
||||||
mcuboot: mcuboot-create-key link
|
mcuboot: mcuboot-create-key link
|
||||||
@$(COLOR_ECHO)
|
@$(COLOR_ECHO)
|
||||||
@$(COLOR_ECHO) '$(COLOR_PURPLE)Re-linking for MCUBoot at $(MCUBOOT_SLOT0_SIZE)...$(COLOR_RESET)'
|
@$(COLOR_ECHO) '$(COLOR_PURPLE)Re-linking for MCUBoot at $(MCUBOOT_SLOT0_SIZE)...$(COLOR_RESET)'
|
||||||
@$(COLOR_ECHO)
|
@$(COLOR_ECHO)
|
||||||
$(Q)$(_LINK) $(LINKFLAGPREFIX)--defsym=offset="$$(($(MCUBOOT_SLOT0_SIZE) + $(IMAGE_HDR_SIZE)))" \
|
$(Q)$(_LINK) -o $(ELFFILE) && \
|
||||||
$(LINKFLAGPREFIX)--defsym=length="$$(($(MCUBOOT_SLOT1_SIZE) - $(IMAGE_HDR_SIZE)))" \
|
|
||||||
$(LINKFLAGPREFIX)--defsym=image_header="$(IMAGE_HDR_SIZE)" -o $(ELFFILE) && \
|
|
||||||
$(OBJCOPY) $(OFLAGS) -Obinary $(ELFFILE) $(BINFILE) && \
|
$(OBJCOPY) $(OFLAGS) -Obinary $(ELFFILE) $(BINFILE) && \
|
||||||
$(IMGTOOL) sign --key $(MCUBOOT_KEYFILE) --version $(IMAGE_VERSION) --align \
|
$(IMGTOOL) sign --key $(MCUBOOT_KEYFILE) --version $(IMAGE_VERSION) --align \
|
||||||
$(MCUBOOT_IMAGE_ALIGN) -H $(IMAGE_HDR_SIZE) $(BINFILE) $(SIGN_BINFILE)
|
$(MCUBOOT_IMAGE_ALIGN) -H $(IMAGE_HDR_SIZE) $(BINFILE) $(SIGN_BINFILE)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user