2024-04-01 01:29 AM
My flash memory is getting erased in stm32 mcu after I power it off and on What could be the reason?
I'm using stm32l562vet6 on a custom PCB. Once I upload the program untill the power is on the program executes properly even if I disconnect the st-link keeping the power off. But once I turn it off and on the program is seemed to be erased.
Any help will be greatly appreciated!
Thank you in advance
with regards,
Giridhara Datta G
2024-04-01 01:31 AM
hello,
How are you sure the program is erased? did you check the flash content with STM32CubeProgrammer for example?
2024-04-01 01:36 AM
It's physically erased or doesn't appear to run?
Show memory space with STM32 Cube Programmer.
Use tool to write.
Check code build address and SCB->VTOR settings.
Have Error_Handler() and HardFault_Handler() outputting actionable information.
2024-04-01 01:40 AM
No Sorry, I had not checked with the stm32cube programmer before.
Now I did, I compared the memory with the .elf file. It turns out the program is not getting erased but it is just not executing the program.
I'm just running the blink LED program to debug the error.
2024-04-01 02:19 AM
No I'm sorry It's not getting erased physically..
As you said the program is not starting after the power off and on.
And also as I observed now , the program is getting halted even I i press the reset button.
Here is the SCB->VTOR value:
Where
VECT_TAB_BASE_ADDRESS = (0x08000000UL)
and
VECT_TAB_OFFSET = 0x00000000U
2024-04-01 02:36 AM
Check the boot configuration and boot pin
2024-04-01 02:45 AM
I tired to make it Zero and run again
but it's going back to HIGH state again