LPC1756 has 16KB SRAM but overflowed by 3504 bytes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1756 has 16KB SRAM but overflowed by 3504 bytes

789 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuockal on Thu May 07 00:36:16 MST 2015
Dear friends, experts,

I am working on LPC1756, use LpcXpresso 7.6.2, C++ programming language.

the memory of LPC1756 is listed as below:

MEMORY
{
  /* Define each memory region */
  MFlash256 (rx) : ORIGIN = 0x0, LENGTH = 0x40000 /* 256K bytes */
  RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x4000 /* 16K bytes */
  RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x4000 /* 16K bytes */


}

but while I built my project C++, the LpcXpresso announce an error like:

c:/nxp/lpcxpresso_7.6.2_326/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: LPC1756.axf section `.bss' will not fit in region `RamLoc16'
c:/nxp/lpcxpresso_7.6.2_326/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: region `RamLoc16' overflowed by 3504 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [LPC1756.axf] Error 1

I wonders why RamLoc16 has 16KB but overflowed by 3504 bytes.
Please help me
Labels (1)
0 Kudos
2 Replies

631 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu May 07 00:48:22 MST 2015
Because you have 19.5 KB of data/bss that you are trying to place into 16KB of RAM  :~

http://www.lpcware.com/content/faq/lpcxpresso/application-flash-ram-size

You need to look at what is consuming the space and potentially move some of your variables into the other RAM bank:

http://www.lpcware.com/content/faq/lpcxpresso/data-different-ram-blocks

As you are using C++, you might also need/want to switch to using NewlibNano rather than the default Newlib library, as this has lower memory requirements:

http://www.lpcware.com/content/faq/lpcxpresso/newlib-nano-support

Regards,
LPCXpresso Support
0 Kudos

631 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu May 07 00:48:21 MST 2015
It means that you are trying to fit 19k bytes of data into a 16k memory region. i.e. you have too much data!
0 Kudos