cancel
Showing results for 
Search instead for 
Did you mean: 

Flash erase function HAL_FLASHEx_Erase issues with STM32L072cz

Sshan.1
Associate II

Hi ,

I am using the STM32L072Cz LoRa discovery Board and I am doing the flash erase by using the HAL function "HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError)"

I given the Start address 0x08000000 and No of pages to be erased to be 400 .

then only page one has got erased and other pages didn't erased !!!

for testing i have given random page address and No of pages to be 1,then this function has erased.

please suggest me here why this function is not able to erase the more pages ???

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Typically your code is at 0x08000000. Erasing FLASH currently in use by your code will lead to undefined or at least unsupported behavior.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2

All the source is provided, you could inspect / analyze

If passing a local variable/array ensure it is fully initialized.

Check for error/status returned.

Are you erasing code that's executing, or contains the active vector table?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

Typically your code is at 0x08000000. Erasing FLASH currently in use by your code will lead to undefined or at least unsupported behavior.

If you feel a post has answered your question, please click "Accept as Solution".