AnsweredAssumed Answered

Linker Script Changes Error in MCUxpresso 11.0.0

Question asked by Abhishek Vishwakarma on Aug 14, 2019
Latest reply on Aug 29, 2019 by LPCX presso support

Hey Guys, 

I faced a huge problem while exporting my projects from version 10.3.1 to version 11.0.0. 

Importing went good but the Project would not build. Showcasing the error


PROGRAM_FLASH: 324296 B 472 KB 67.10%
SRAM_UPPER: 124092 B 65472 B 189.53%
SRAM_LOWER: 0 GB 65520 B 0.00%

c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/ region `SRAM_UPPER' overflowed by 58620 bytes


The project is a FreeRTOS project using the HEAP 5 memory scheme which has different memory location we can assign. 

Anyhow, the issue was that the auto-generated Linker File(*.ld file) was adding '.' at the end of the section names, you describe in the MCU settings as shown below 


.noinit_RAM2 (NOLOAD) :
. = ALIGN(4) ;
. = ALIGN(4) ;


the same section in Version 10.3.1

.noinit_RAM2 (NOLOAD) : ALIGN(4)
. = ALIGN(4) ;


The FreeRTOS heap5 file is where we mention the array size and name 

static __attribute__ ((used,section(".noinit.$SRAM_LOWER_Heap5"))) uint8_t heap_sram_lower[60*1024]; /* placed in in no_init section inside SRAM_LOWER */
static __attribute__ ((used,section(".noinit_Heap5"))) uint8_t heap_sram_upper[20*1024]; /* placed in in no_init section inside SRAM_UPPER */

These arrays where not being recognized by the linker and hence producing the overflowed error. 

Once I changed the name of the arrays to add '.' it fixed the problem. 


changed Named

static __attribute__ ((used,section(".noinit.$SRAM_LOWER._Heap5"))) uint8_t heap_sram_lower[63*1024]; /* placed in in no_init section inside SRAM_LOWER */
static __attribute__ ((used,section(".noinit_Heap5."))) uint8_t heap_sram_upper[28*1024]; /* placed in in no_init section inside SRAM_UPPER */


I don't know why that addition of character "." was added to the linker scripts. Slightly annoying when you are exporting to an updated version.

Please give a way to remove that feature for backward compatibility. So we don't have to make this small change on all the projects and branches of them.