2022-01-14 07:50 AM
Hello everybody,
I'm having big troubles attempting to erase flash memory of my NUCLEO-G491RE. The message I'm getting after calling "HAL_FLASHEx_Erase" function is "Break at address "0xfffffffe" with no debug information available, or outside of program code".
If I debug and execute code from NUCLEO-G431 everything goes fine and I'm able to erase and write flash, if I copy-paste the same exact code on a project generated by the same .ioc file I get stuck to that message and the FLASH is not erased.
2022-01-14 10:02 AM
You could be erasing the vector table or other flash code your program is using. See what interrupt it’s in, if any, by looking at VECTACTIVE.
2022-01-17 01:12 AM
Hello @TDK , thank you very much for your precious help. Actually my Flash Code was mapped in Main Flash Memory and trying to erase single pages works fine. However I'm not succeding yet in writing onto the erased sectors. Should it be possible to write Flash just erasing the proper desired sector without having to erase it all? Do you suggest to keep my Program in Main Flash or to map it in an other area? Thank you!
2022-01-17 05:37 AM
2022-01-17 05:51 AM
Ok, the only thing that I've not understood yet is if it is possible to erase a single page without erasing all the flash and writing only on that page...
2022-01-17 06:01 AM
2022-01-17 06:10 AM
Ok, thank you.
Even if the destination address in FLASH seems all erased however with the debugger I'm noticing that the highlighted piece of code is not transferring data from the origin address to flash. Here is a screen of the segment of code and flash that I'm trying to write to.
2022-01-17 06:21 AM
2022-01-17 07:03 AM
This is the structure of my flash management function, it is basically copy-pasted from the example provided by ST.
So all the proper bits are set and managed by HAL libraries. This is perfectly identical (even the data to copy) to the ST example but is not writing anything while running the example itself works fine. I can't understand what is going on since they are identical...