2024-06-06 09:24 AM
Hi everyone, I created an HID bootloader for the STM32G4xxx, it works and now I am trying to optimize the size. After compiling I can read this on the Build Analyzer a flash memory usage of 17.85 kB.
After compiling I get this:
When I flash this compiled code and read the flash memory I canclearly see that the memory usage is around 38 kB.
I also used the STM32CubeProgrammer to look at the actual memory (I didn't manage to use this function directly on STM32CubeIDE) and I can see that more than 38 kB are used in the memory
Can somebody explain why? Am I missing something about the Build Analyzer function?
Solved! Go to Solution.
2024-06-07 05:44 AM - edited 2024-06-07 06:08 AM
Yes, but as I said I looked in the flash memory with the STM32 Programmer, and as you can also see I have code until 0x08009974, which is page 19 of the Flash memory. So the actual occupied memory size is more than 38 kB (each page is 2 kB in dual bank mode).
Edit: I said single bank mode but I meant dual bank mode)
2024-06-07 05:52 AM
@Simo_Sappo wrote:I have code until 0x08009974,
Are there gaps?
2024-06-07 05:56 AM
Nope, until 0x08009974 there are no gaps, no "FFFF" is written before the one you see in the picture. I checked
2024-08-08 02:18 AM
I found the problem, somehow even if I set the Release mode as active (with the size optimization) it was still flashing the Debug version of the code which is not optimized for size. I discovered this only after deleting the Debug and Release folders and staring the flashing process again. Thank you everyone for your help