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.
7 years, 9 months ago.
Error: code size too large for linker when adding new target board to mbed-os
Hi,
I have been very busy trying to add a new target board (Nucleo-F413ZH) to mbed-os. I have been following the instructions here:
https://developer.mbed.org/teams/ST/wiki/steps-to-create-a-new-STM32-platform
However, I get the following error on running mbed test or mbed compile:
"Fatal error: L6047U: The size of this image (35416 bytes) exceeds the maximum allowed for this version of the linker"
note: the image size varies depending on the test from around 35k to 40k bytes).
I am using the ARM compiler which I have installed with Keil uVision. The strange thing is if I compile this library in Keil I do not get this error and it compiles fine with no errors.
Please can someone help me, because I believe I am on the verge of adding a new target board here :)
1 Answer
7 years, 9 months ago.
Guessing here based on symptoms. Your Keil uVision license is code limited to 32K? I suspect your settings for optimization are higher (O3?) than what the mbed settings are (O0,O1). Poke around in your uVision and see if you can turn down optimization and see if it results in the same error message. Somewhere in the Python scripts I bet they are calling uVision with a list of external flags - one of which is optimization...
I think you are right, so I've switched to GCC_ARM instead as its free. Thanks for the info, I had assumed that my uVision didn't have a limit, but at some point I ended up getting the same error when compiling in uVision. I now have a working version of the mbed source for my stm32f413zh board :)
posted by 16 May 2017