Compiled code size and flashed code size are different in STM32CUBEIDE v1.15.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-06 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-07 5:44 AM - edited ‎2024-06-07 6: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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-07 5:52 AM
@Simo_Sappo wrote:I have code until 0x08009974,
Are there gaps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-07 5:56 AM
Nope, until 0x08009974 there are no gaps, no "FFFF" is written before the one you see in the picture. I checked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-08 2: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

- « Previous
-
- 1
- 2
- Next »