9 years, 10 months ago.

Can I redefine bigger RAM size from LPC1114FN28 to LPC1114FDB48/30x?

Projects introduction

Well, I am developing an LPC1114 based E-paper display project. The internal RAM is used as its display buffer, which requires 3096 Byte.

I reused a code called "lpc1114uart" as my code base. Keil was selected as its offline compiler.

RAM size issue

Since 3096B is huge for LPC1114FN28, at the final linking stage, it failed with following warnings:

.\build\lpc1114uart.axf: Error: L6407E: Sections of aggregate size 0x10c4 bytes could not fit into .ANY selector(s).

Then I realized that LPC1114FBD48/301/302/303 have 8KB RAM, but FN28/FDH28 have only 4KB RAM.

I changed the lpc1114uart\mbed\TARGET_LPC1114\TOOLCHAIN_ARM_MICRO\LPC1114.sct file, it can be build now.

Although online compiler has not silimiar issue, I do believe the dispbuf[] has been removed because I haven't implement and code for it. If I do, the online compiler will complain as well.

Future issue

I plan to share my source code on mbed with my hardware. However I have no idea how to modify the ram size definition in online compiler, since it is related to platform. Even I commit my code, the user can not build online, they have to download code and build offline.

How can I redefine it into bigger RAM size in short time? Should I pull request on mbed's source in github?

If I can only solve that, then mbed lost its value for my project. Please support me on this issue. Otherwise I have to change platform (silicon) or compiler (Keil only but with mbed API).

Question relating to:

The LPC1114FN28 is an ARM Cortex-M0 based, low-cost 32-bit MCU, designed for 8/16-bit microcontroller applications, offering performance, low power, simple instruction set and memory addressing together with reduced code size …

1 Answer

9 years, 10 months ago.

I'm not sure about the tricky way to redefine it. https://mbed.org/users/va009039/code/lpc810_helloworld/rev/9b94dbd65a21 could be a hint.

You can send pull request of your LPC1114FBD48 platform as new target, and report test result. If mbed team think it's useful for general mbed user, LPC1114FBD48 platform could be added to the online compiler. https://mbed.org/handbook/mbed-SDK-porting

Accepted Answer

Quick solution, the project can include mbed-src, redefine the RAM size in the linker script file for that target, state the reason why mbed-src are used and what's changed to the original.

posted by Martin Kojtal 30 May 2014

Mr. Tsuboi & Martin,

Thanks a lot for your replies,

I have checked the first one. It is interesting to find an assembly code in mbed platform since usually mbed hides low level details under C++ API. Usually we can only find startup.s in offline project, rather than online compiler IDE. Also I have no idea how online compiler imports the reset_handler to override default handler.

Additionally, the code changed from 4KB (812) to 2KB (810), so compiler will not complain. But my case is in the other way. So compiler will complain anyway.

I may try to include mbed-src in the project. I hope it will not introduce more problems during importing. I will ask more questions to Martin.

Even I added mbed src, but files in mbed\TARGET_LPC1114\TOOLCHAIN_ARM_MICRO contains many *.o files which are not allowed to upload the compiler.

  • cmsis_nvic.o
  • retarget.o
  • startup_LPC11xx.o
  • sys.o
  • system_LPC11xx.o

Addtionally, the LPC1114.sct is for Keil only. Maybe Martin can offer more references on how to add all of these files?

At last, the pull request on github is the official way although it takes time to go through it. Maybe I will do that, since our project and customers need it anyway. However it depends on mbed decision. I hope my efforts will not be in vain after doing all of these.

posted by Kai Liu 30 May 2014