cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 check if programmed previously

PWaser
Associate II

You can't reprogram flash double words on the stm32g4 even if the were programmed to 0xFFFF'FFFF'FFFF'FFFF.

Does anyone know if it is possible to check if the 0xFFFF'FFFF'FFFF'FFFF value I read from a specific flash position has previously been programmed or is the result of an erase (without trying to program it)?

1 REPLY 1
Uwe Bonnes
Principal III

Look at the reference manual: ```Note: For a virgin data: 0xFF FFFF FFFF FFFF FFFF, one error is detected and corrected but two

errors detection is not supported.``` So if you programm, the ECC gets set correctly resulting in some ECC bit set to 0. On the next programm, this ECC bit will interfere.