"Ram overflowed by...": CubeMX generated code is too bloated for STM32L011G4?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-21 10:35 AM
Hello Community,
I'm a newly user and have a custom PCB.
Now with having set up the Cube IDE I'm struggling that I can't compile just the code like it came out of the CubeMX's code generator.
Can you give me a hint to start?
I already set the compilers optimization for size and varied the min heap and min stack variables, but no improvement.
If the code really is too big, is there any option how to reduce it's size in CubeMX?
Best regards,
Hannes
- Labels:
-
STM32CubeIDE
-
STM32CubeMX
-
STM32L0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-21 01:52 PM
Yes, 16KB FLASH is pretty tight.
I'm building HAL based code into them.
Watch for the floating point library.
Check for initialized memory, if things are constant make sure they like in FLASH, and not both FLASH and RAM
Trick might be to tell linker it has more resources, so it can get closure on what you're trying to build,and then figure out whose eating all the memory resources via the .MAP file
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-21 10:19 PM
As said Clive, this stm32 flavor is tight in memories. Maybe the stack size needs to be optimized. The map file wilk tell you the memory cost of each object file to know where to optimize. If your code needs compiler optimisation to fit, debug witg breakpoints will be painful down the road....
For ram l, " union " is your friend....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-23 08:15 AM
Hello @Johannes Hofmann​
I advise you to check first the memory detail in the Build Analyzer.
Also you can try using the LL library.
Finally if it is possible could you send me the IOC file or the project for further analysis.
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-30 06:49 AM
Hello @Johannes Hofmann​
Did the previous replies helped to resolve the issue?
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.