2024-08-27 10:07 AM
Dear All,
I'm using STM32G0 with 64KB of flash memory and 8KB of RAM
if optimization is OFF, its giving error as below
and if optimization is ON Level-1
its not giving any error
So let me know what kind of error i'm facing
Compiler - keil
2024-08-27 10:35 AM
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.
2024-08-27 10:37 AM
> 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:
2024-08-27 08:58 PM
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
2024-08-27 11:35 PM
Hello,
Maybe you need to contact ARM for such kind of behaviour over this link:
https://community.arm.com/support-forums/f/keil-forum
2024-08-28 12:17 AM
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.