Skip to content

Commit 446de69

Browse files
author
Cruz Monrreal
authored
Merge pull request #7145 from drahnr/master
NRF52: add a separate .nvictable section and allow .noinit to be used…
2 parents 34513f2 + 124e15f commit 446de69

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
3131
}
3232

3333
RW_IRAM0 MBED_RAM0_START UNINIT MBED_RAM0_SIZE { ;no init section
34-
*(*noinit)
34+
*(*nvictable)
3535
}
3636
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE {
3737
.ANY (+RW +ZI)

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_GCC_ARM/NRF52832.ld

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,20 @@ SECTIONS
199199

200200
__edata = .;
201201

202+
.nvictable (NOLOAD) :
203+
{
204+
PROVIDE(__start_nvictable = .);
205+
KEEP(*(.nvictable))
206+
PROVIDE(__stop_nvictable = .);
207+
} > RAM_NVIC
208+
202209
.noinit (NOLOAD) :
203210
{
204211
PROVIDE(__start_noinit = .);
205212
KEEP(*(.noinit))
206213
PROVIDE(__stop_noinit = .);
207-
} > RAM_NVIC
208-
214+
} > RAM
215+
209216
.bss :
210217
{
211218
. = ALIGN(4);

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
5454
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
5555

5656
initialize by copy { readwrite };
57+
do not initialize { section .nvictable };
58+
place at address mem:__ICFEDIT_region_RAM_NVIC_start__ { section .nvictable };
59+
5760
do not initialize { section .noinit };
58-
place at address mem:__ICFEDIT_region_RAM_NVIC_start__ { section .noinit };
61+
place in RAM_region { section .noinit };
62+
5963

6064
keep { section .intvec };
6165
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,19 @@ SECTIONS
198198

199199
__edata = .;
200200

201+
.nvictable (NOLOAD) :
202+
{
203+
PROVIDE(__start_nvictable = .);
204+
KEEP(*(.nvictable))
205+
PROVIDE(__stop_nvictable = .);
206+
} > RAM_NVIC
207+
201208
.noinit (NOLOAD) :
202209
{
203210
PROVIDE(__start_noinit = .);
204211
KEEP(*(.noinit))
205212
PROVIDE(__stop_noinit = .);
206-
} > RAM_NVIC
213+
} > RAM
207214

208215
.bss :
209216
{

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
#endif
4747

4848
#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
49-
__attribute__ ((section(".bss.noinit"),zero_init))
49+
__attribute__ ((section(".bss.nvictable"),zero_init))
5050
uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS];
5151
#elif defined(__GNUC__)
52-
__attribute__ ((section(".noinit")))
52+
__attribute__ ((section(".nvictable")))
5353
uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS];
5454
#elif defined(__ICCARM__)
55-
uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS] @ ".noinit";
55+
uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS] @ ".nvictable";
5656
#endif
5757

5858
extern uint32_t __Vectors[];

0 commit comments

Comments
 (0)