A project based on mbed-blink compiles and links for lpc11u24, but for lpc11c24 I get the message 'firmware.elf section
.text will not fit in region
This probably has to do with the addional requirement from the can driver.
(The only change I made to the project was commenting out all options from platform.ini and add one [env:lpc11c24] based on what was in section for env:lpc1768)
How do I fix this?
Could you build your project with mbed on-line compiler?
I have not tried the on-line compiler (I am unfamiliair with that; where can I find it?)
I just created an example project and changed the processor to one that is said to be supported. As in the original message: setting the U variant compiles, but the C variant does not. It is just the blink projects, so nothing fancy.
I use lpcxpresso to build for this processor and that has always worked (both on a dev-board and a separate chip on soldered ona break-out board).
I just started using platformio and was looking at the processors that I work with (albeit through different tool chains) and want to see how platformio compares. I am not doing actual work with platformio, yet.
I have found the on-line compiler and spent some time looking around
The lpc11c24 is not an option for the on-line compiler (there are no board that carry this chip), so that might be an issue.
However, the lpc11u68 is an option on-line and builds, but this does not work with my local platformio build (linker error)
I spent way too much time trying to get platformio to work with my lpcxpresso boards and getting nowhere. I will try platformio with other boards (when they arrive)
Please file an issue here
I think it really is a matter of the result not fitting the flash.
When I change the ld file and set the flash to 64K, it does build and creates an elf file of about 62K. This means that the mbed platform (as platformio builds it) it way too large for the lpc11c24, even for simple projects like mbed-blink or mbed-serial)
I am not familiair enough with the mbed platform, so I don’t know if trimming or slimming is possible. For the lpc11c24 I’ll stay with lpcxpresso.
I do like platformio, so for other chips (ESP, STM and other LPC) I will evaluate usages further.
I also fixed the link error for the lpx11u68. File
defines __aeabi_atexit and this creates a double define. Commenting this function out helps build successfully (although I have not yet uploaded the project to a board to test)
I installed mbed-cli and tried building for different boards.
Building a simple hello-world app for the lpc11U68 is about 16K. I would expect that the size for the lpc11c24 would be about the same and well within the size of the flash (i.e. 32K)
However, the size is about 62K and seems to come from linking lwip, ethernet and sockets into the binary.
I assume that the error comes from the fact that on Linux CAN is actually part of the network stack (on a SoC it is not, it has its own API).
I have looked around, but can not find how features in target.json or other description files are related to the build process, so I don’t see how I can fix this.
However, the lpc11c24 seems to become obsolete. I have ordered other boards (from the NUCLEO series). When they arrive, I’ll give it another go.
If you don’t use these libraries in the code, GCC Linker will ignore objects from these libs. Also, you can ignore mbed-libs from build process using Redirecting... option.
I am aware that a linker strips unused functions.
However, the lpc11U68 does not end up with the Ethernet.o file, but the lpc11C24 does. This is the exact same project, just compiled for a different target.
The question then is: where in the mbed framework is the distinction made that the Ethernet driver should be used (probably RTOS)? Disabling features (e.g. in embed_app.json) does not work.
The results I mentioned were from directly using mbed-cli (running on a server over command-line).
My assumption is that there is a mistake in the meta data for the lpc11C24 board.