From 3b594f7b27881818645a52d7aa9469c97ef10ecf Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sun, 13 Dec 2020 22:03:18 +0100 Subject: [PATCH] nrf/boards/common.ld: Calculate unused flash region. Calculate the unused flash area on the target device. The values will be exposed by _unused_flash_start and _unused_flash_length. The start address and the length are not aligned to either word or pages. --- ports/nrf/boards/common.ld | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index d2e5eef762..866336fa02 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -81,3 +81,5 @@ SECTIONS /* Define heap and stack areas */ _ram_end = ORIGIN(RAM) + LENGTH(RAM); _estack = ORIGIN(RAM) + LENGTH(RAM); +_unused_flash_start = (_sidata + (_edata - _sdata)); +_unused_flash_len = (ORIGIN(FLASH_TEXT) + LENGTH(FLASH_TEXT)) - _unused_flash_start;