I am writing software to OMAP-L138 and after I updated compiler from version 7.4.2 to version 7.4.4 I got following error message:
program will not fit into available memory. placement with alignment fails for section ".magic_number" size 0x4 . Available memory ranges:
NUMBER size: 0x4 unused: 0x4 max hole: 0x4
My linker file looks like this:
-stack 0x2000 /*8 kBytes */
-heap 0x1000 /*4 kBytes*/
MEMORY
{
DSPL2ROM o = 0x00700000 l = 0x00010000 /* 1MB L2 Internal ROM */
DSPL2RAM o = 0x00800000 l = 0x00040000 /* 256kB L2 Internal RAM */
DSPL1PRAM o = 0x00E00000 l = 0x00008000 /* 32kB L1 Internal Program RAM */
DSPL1DRAM o = 0x00F00000 l = 0x00008000 /* 32kB L1 Internal Data RAM */
SHDSPL2ROM o = 0x11700000 l = 0x00010000 /* 1MB L2 Shared Internal ROM */
SHDSPL1PRAM o = 0x11E00000 l = 0x00008000 /* 32kB L1 Shared Internal Program RAM */
SHDSPL1DRAM o = 0x11F00000 l = 0x00008000 /* 32kB L1 Shared Internal Data RAM */
SHDSPL2RAM o= 0x11800000 l= 0x00020000 //l= 0x00040000 /* 256kB L2 Shared Internal RAM, can be also used as cache */
EMIFACS0 o = 0x40000000 l = 0x20000000 /* 512MB SDRAM Data (CS0) */
EMIFACS2 o = 0x60000000 l = 0x02000000 /* 32MB Async Data (CS2) */
EMIFACS3 o = 0x62000000 l = 0x02000000 /* 32MB Async Data (CS3) */
EMIFACS4 o = 0x64000000 l = 0x02000000 /* 32MB Async Data (CS4) */
EMIFACS5 o = 0x66000000 l = 0x02000000 /* 32MB Async Data (CS5) */
SHRAM o = 0x80000000 l = 0x00010000 /* 64kB Shared RAM, bootloader uses last 64kB */
VERSION o = 0xC0000000 l = 0x00000004
NUMBER o = 0xC0000004 l = 0x00000004
BOOT_POINT o = 0xC0000020 l = 0x00000080 /*Do not change this*/
APPLICATION o = end(BOOT_POINT) l = 0x00100000 f=0xffffffff/* 1MB for application, defined also in memory_map.h*/
EXTERN_RAM o = end(APPLICATION) l = 0x08000000-(size(BOOT_POINT)+size(APPLICATION)+0x20)
ARMROM o = 0xFFFD0000 l = 0x00010000 /* 64kB ARM local ROM */
ARMRAM o = 0xFFFF0000 l = 0x00002000 /* 8kB ARM local RAM */
}
SECTIONS
{
.sw_version LOAD = VERSION
.magic_number LOAD = NUMBER
boot > BOOT_POINT
{
-l rts6740_elf.lib<boot.obj>(.text)
}
.text > APPLICATION /*Executable code, ROM*/
.switch > APPLICATION /*Tables for switch statement, ROM*/
.const > APPLICATION /*Far const data, ROM*/
.cinit > APPLICATION /*Boot-time init tables, ROM*/
.init_array > APPLICATION /*data, used to register C++ global variable constructors, ROM*/
.name_load > APPLICATION /*Compressed image of section name, ROM*/
.c6xabi.exidx > APPLICATION /*data, index table for C++ exception handling, ROM*/
.c6xabi.extab > APPLICATION /*data, unwinding instructions for C++ exception hand, ROM*/
.binit > APPLICATION /*Boot-time copy tables, ROM*/
.vecs > APPLICATION /* Interrupt Vectors, RAM*/
.cio > SHDSPL2RAM//EXTERN_RAM /*Handshaking buffer for host-based stdio*/
.data > SHDSPL2RAM//EXTERN_RAM /**/
.args > SHDSPL2RAM//EXTERN_RAM /*Command arguments for host-based loader*/
.ppinfo > SHDSPL2RAM//EXTERN_RAM /*Correlation tables for compiler-based profiling*/
.ppdata > SHDSPL2RAM//EXTERN_RAM /*Data tables for compiler-based profiling*/
GROUP (NEAR_DP_RELATIVE)
{
.neardata /*initialized near read-write data, RAM*/
.rodata /*initialized read-only data, RAM*/
.bss /*Global and static variables, RAM*/
}>SHDSPL2RAM//EXTERN_RAM
.stack > SHDSPL2RAM//EXTERN_RAM /*Program stack, RAM*/
.sharedram > SHRAM
GROUP (FAR_RAM_DATA)
{
.fardata /*Initialized far data, RAM*/
.far /*Uninitialized far data, RAM*/
.sysmem /*Dynamic data (heap),RAM*/
}>EXTERN_RAM
}
I have declared .sw_version and .magic_number in my main.c file and it looks like this:
const U8 ucSwVersion[4]=FIRMWARE_VERSION;
#pragma DATA_ALIGN ( ucSwVersion , 4 );
#pragma DATA_SECTION (ucSwVersion , ".sw_version");
#pragma RETAIN(ucSwVersion);
const U8 ucMagicNumber[4]=MAGIG_NUMBER;
#pragma DATA_ALIGN ( ucMagicNumber , 4 )
#pragma DATA_SECTION (ucMagicNumber , ".magic_number");
#pragma RETAIN(ucMagicNumber);
If I change compiler back to version 7.4.2 everything works fine.What I am doing wrong?
Best regards
Joni