1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #11127 from bergzand/pr/nrf52/ref_ldscripts

nrf52: use cortexm.ld script when applicable
This commit is contained in:
Francisco Acosta 2019-03-13 19:41:13 +01:00 committed by GitHub
commit de720730f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 83 deletions

View File

@ -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 ;

View File

@ -7,6 +7,21 @@ export MCUBOOT_SLOT0_SIZE = 0x8000
export MCUBOOT_SLOT1_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)))
CFLAGS += -DGNRC_NETIF_MSG_QUEUE_SIZE=16
endif

View File

@ -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

View File

@ -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

View File

@ -22,13 +22,12 @@ $(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)'
@$(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)