Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 8 months ago.
64KB or 32KB SRAM?
Note: while there are IMHO still unclear things, the issue here are not showstoppers anymore.
(Edited) Issues that we have:
- Switching from C027 to mbed-LPC1768 in the online compiler changes the RAM usage (under Build) from to 129%, even the same MCU is used (is it really the same?). Can someone clarify if this is expected behaviour?
- BTW: Even if the RAM usage is 129%, the online compiler does not report an error.
- Is it correct that the file GCC ARM exported file LPC1768.ld is the same for mbed-LPC1768 and C027, even so the online compiler shows different RAM usage?
the C027 page https://mbed.org/platforms/u-blox-C027/ says:
- NXP LPC1768 is used
- 64 kB available
this pages https://mbed.org/platforms/mbed-LPC1768/ says:
- NXP LPC1768
- 32KB RAM
The NXP data sheet says: 32kB + 2x 16kb AHB SRAM0/1 RAM (in different address range). http://www.nxp.com/documents/data_sheet/LPC1769_68_67_66_65_64_63.pdf
The online compiler says:
- LPC1768 board: 32kb
- C027: 64kb
The offline ARM GCC compiler export says: https://mbed.org/users/mbed_official/code/mbed/file/824293ae5e43/TARGET_LPC1768/TOOLCHAIN_GCC_ARM/LPC1768.ld
- 16KB used for USB
- 16KB used for Ethernet
Our program uses 44KB :-)
Not being an expert, my initial guess from this is:
The online compiler for C027 is wrong for C027 BTW: Where is the LPC1768.ld file used by the online compiler if it is not the one linked above?
Question relating to:
6 years, 7 months ago.
Some clarification about RAM usage. The LPC1768 MCU has 64k of RAM split into multiple regions. The memory map file passed to the linker determines what code gets placed in a particular section.
These code snippets are from the latest as of 4th March 2014 and are subject to change
Why the platforms and compiler says 32k RAM. The scatter load file only places RW and ZI code in one section that is 32k-0xc8 bytes in size. Your application without any special attributes only has 32k of RAM available. Beyond that the linker will complain that there isn't enough room to place xx bytes. As before mentioned, the LPC1768 has 64k. The additional 32k comes in two 16k chunks and is allocated for the EthernetInterface and USBHost libraries.
6 years, 8 months ago.
Additional note: When using the off-line compiler for our program, we get:
/usr/local/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: MbedSmartRestMain.elf section `.AHBSRAM1' will not fit in region `ETH_RAM' /usr/local/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: region `ETH_RAM' overflowed by 256 bytes collect2: error: ld returned 1 exit status
So in contrast to my assumptions above: the offline compiler complaints about the ETH_RAM memory region, not the RAM region.
6 years, 5 months ago.
I think my solution should help:
Happy offline debugging!