cancel
Showing results for 
Search instead for 
Did you mean: 

Over flow flash memory

vchau.2
Associate III

Dear All,

I'm using STM32G0 with 64KB of flash memory and 8KB of RAM

if optimization is OFF, its giving error as below

vchau2_0-1724778215817.png

 

and if optimization is ON Level-1 

its not giving any error

vchau2_1-1724778336673.png

So let me know what kind of error i'm facing 

Compiler - keil

 

5 REPLIES 5
SofLit
ST Employee

Hello,

Simply you are exceeding the flash memory size.

In fact your application is at the limit of the flash size 64kB. If you enable the optimization your binary < 64kB and that fits in the Flash and if you disable the optimization, the binary > 64kB exceeding the memory size of the MCU.

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.
TDK
Guru

> Over flow flash memory

> So let me know what kind of error i'm facing 

You answered it yourself. The code is larger than the flash size you have available.

Potential solutions:

  • Refactor the code to use less memory
  • Compile with optimizations on
  • Buy a chip with more flash
If you feel a post has answered your question, please click "Accept as Solution".

But when optimization is of level-1 than occupy flash size is 27KB only, how its possible to optimize the code size more than half 

Hello,

Maybe you need to contact ARM for such kind of behaviour over this link:

https://community.arm.com/support-forums/f/keil-forum

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.
gbm
Lead III

My guess is: you are using trial/resrticted version of MDK-ARM with 32 KiB size limit.

Solutions:

1. Switch to STM32CubeIDE.

or

2. Enable STM32F0/G0 license. This will unlock the size limit but lock your MDK-ARM to F0/G0, so you won't be able to use it with any other microcontroller.