2020-06-17 04:18 PM
I am working on the Nucleo F429ZI, and I'm working on a dual bank configuration, and I have a function that erases the flash of the other bank and loads in a new user application. I'm wondering if there's an easy way, or available function call, to find out how much memory the user application in the other bank takes up before erasing it.
Solved! Go to Solution.
2020-06-17 04:58 PM
There isn't a function that does this.
You can get the size of the flash and look for the last word that isn't 0xFFFFFFFF. This takes tens of milliseconds to do--pretty quick.
2020-06-17 04:58 PM
There isn't a function that does this.
You can get the size of the flash and look for the last word that isn't 0xFFFFFFFF. This takes tens of milliseconds to do--pretty quick.
2020-06-17 06:40 PM
You could embedded as value in an unused vector table entry, allowing the linker to compute/place the value/symbol.
Should also consider signing the image with a CRC or HASH so the loader can validate the image before jumping into it. A signing tools could also embedded a size as part of the packaging process.
Basically you've got to facilitate the functionality you want.
2020-06-17 11:27 PM
The STM32CubeIDE does this by default (and shows static ram consumption). Look in the "Build Analyzer" window. Note it will only show you this after successful compilation.
2020-06-17 11:36 PM
What about erasing the size required by the new application which is usually known when installing ?
I‘m using signature data located right after fixed exception table reserved in linker script for image verification and ‚already installed‘ check.