2022-11-03 5:25 PM
I want to write some data into flash memory on STM32G071 MCU as a part of a project. For that, I am using the function 'HAL_FLASHEx_Erase' to erase the pages before writing. While debugging it's working fine. But when I downloaded the code to MCU and started running, the execution stuck somewhere. I have found that the code runs smoothly till the line, CLEAR_BIT(FLASH->CR, FLASH_CR_PER); inside the function. But it didn't execute even the very next line.
How can I resolve the problem?
2022-11-09 5:04 AM
Hello @Community member,
I advise you to get inspired from the available FLASH_eraseProgram examples in the STM32CubeG0 MCU package. These examples may help you in the configuration by following the instructions in the readme file.
I hope this helps!
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.