SMT32G070CB : Flash page erase using registers doesn't seem to be working
- September 7, 2022
- 2 replies
- 1795 views
I'm using an STM32G070CB for a project and need to store 6 bytes worth of data to the flash memory. The MikroPascal PRO for ARM compiler that I'm using has a flash library for this (I assume it's their version of the HAL procedures that I've seen elsewhere), but it doesn't work so I'm trying to do it myself using the registers whilst I wait for a response from their developers. I've had a look through various forums and haven't seen anyone trying with just the registers.
I think I've initialised everything properly, then followed the process from section 3.3.7 of the reference manual, but the reset doesn't seem to occur. I've attached a copy of the code showing how I'm setting the registers. When I then go to write new data to the page, an error pops up saying "write to flash skipped".
If anyone has any ideas as to what I might have forgotten or why it may not be working let me know.
Regards,
James