From 09f8a83a756c784e846d2acd9a929e4a45ea34b4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Sep 2020 13:54:03 -0500 Subject: [PATCH] samd: template.ld: put canram in its own output section --- ports/atmel-samd/boards/common.template.ld | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 19e4753f8b..b30a7a1d9f 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -43,6 +43,17 @@ SECTIONS _sidata = .; /* start of .data section */ } >FLASH_FIRMWARE + /* Data accessed by the CAN peripheral must be in the first 64kB RAM */ + /* place it at the very start of RAM, before the .data section */ + /* it is zeroed by reset_port */ + .canram (NOLOAD) : + { + . = ALIGN(4); + _scanram = .; + *(.canram) + _ecanram = .; + } > RAM + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH_FIRMWARE (inidata). @@ -67,10 +78,6 @@ SECTIONS . = ALIGN(4); _sbss = .; _szero = .; /* define a global symbol at bss start; used by startup code */ - /* Data accessed by the CAN peripheral must be in the first 64kB RAM */ - _scanram = .; - *(.canram) - _ecanram = .; *(.bss) *(.bss*) *(COMMON)