cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 memory out and how avoid that

SGian.1
Senior

Hi there,

here i'm for ask another help. I compile my program with keil and i read this data :

Program Size: Code=15988 RO-data=360 RW-data=24 ZI-data=2088  

How i can interpret ?

I use one STM32G031F4P6 wher i have 8K of RAM and 16K of program.

So i jus put one delay (just for test one thingh) and the compiler gave me that

Error: L6220E: Load region LR_IROM1 size (16424 bytes) exceeds limit (16384 bytes). Region contains 30 bytes of padding and 0 bytes of veneers (total 30 bytes of linker generated content)

Error: L6220E: Execution region ER_IROM1 size (16400 bytes) exceeds limit (16384 bytes). Region contains 24 bytes of padding and 0 bytes of veneers (total 24 bytes of linker generated content).

I'm sure i'm out of mememory i'm right ?

The question is i can do somethingh ? or i neeed the change the microontroller ?

Forgive me but when you start a project simpli of complicated what did you choise your microcontroller ? i don't talk about pin i talk about memory . Because my project is very easy i receive data from serial port (RS485) and afther i turn of or on led W2812B and i have I2C memory where i save a data

Thank a lot

Sergio

11 REPLIES 11
SGian.1
Senior

Thanks . Today i check everythingh

S.Ma
Principal

HAL maynot provide best route for small code size. Especially for uart. Use project settings compiler and linker optimisations. If desperate, fuse multiple c code having similar code content to help optimize overseeing larger code blocks. Look at the map file and rank .o files by decreasing sizd to prioritize.