2022-04-27 08:21 AM
I have a strange issue with a STM32G030 and Flash writes.
I am trying to change a 64-bit (double word) value from erased 0xFFFFFFFFFFFFFFFF to 0xFFFFFFFFFFFFFF00.
I have three scenarions:
For Scenario #1 and #2, my application can modify the value without an error (as expected).
But if I program my MCU with a PEMicro Cyclone, my application cannot modify the value and I get a PROGERR flag. I have discussed this with PEMIcro support and they said they write whatever is in the srec to flash so we had to do a read before write make sure writing all FF's over erased flash didn't mess with the hidden ECC bits but this is still not working.
Any ideas?
I am using the ST Hal write functions.
2022-04-27 03:01 PM
You can only write each double word once before needing to erase the flash page, even if you write all 0xFFs. Reading all 0xFFs doesn't tell you it wasn't written to after the erase, only that it might not have been.