-
Notifications
You must be signed in to change notification settings - Fork 0
All about Flash module
-
First of all, it must be taken into account that the FLASH is quite delicate, a power failure or that it is unstable during a erasion or writing process or even when it is not performing any operation could cause problems.
-
When you want to program from the STM32Programmer it is very important to disable the Execute after programming option because this option for some reason that could not be determined causes the MCU to enter a hard fault.
- If the above happens (the MCU goes into hard fault every time we want to use a module function) the normal solution is to go to the STM32Programmer, select the Erasing&Programming window in the Erase flash memory section, we will select the sectors from 4 to 7 or those that we were modifying (we do not recommend modifying any lower ones to avoid writing above the program) and finally we will click on the Erase selected sectors button.
-
A common indicator that the FLASH has a problem is to look at it from the STM32Programmer and see patterns of 0x00000000 and 0xFFFFFFFF alternating every few bytes.
-
If you have done and verified the above and the board continues to go into hard fault, it is probably not caused by the FLASH memory.
-
It would be nice if the boards had some way to indicate that some operation on the FLASH is running to prevent operations that could corrupt the FLASH.
-
It is also important that when a board receives the order to jump to the bootloader, it first checks that no operation is being carried out in the FLASH and waits for it to finish if one is running before jumping.
When writing on two different pages at the same time, it consumes 256KB of ram instead of the 128KB that it consumes when writing only one. This inefficiency can be corrected if necessary, although for the expected use of this library it should not be a problem.