2021-08-12 09:20 AM
Hello Dear Experts,
I have strange behavior on my STM3210 board.
I flash my binary using STLink and it works well.
Then I toggle BOOT0 pin in order to use the standard bootloader in the system memory and I reset the system.
The bootloader starts and listens UART.
I send the "GO" command over UART from the CubeProgrammer app (no flashing/reading, only "GO" command).
In debugger I see that it jumps to the main() function as expected.
BUT after calling a few functions it crashes somewhere and the PC register becomes "0x1fffeade".
If I disable the BOOT0 pin and restart - everything works well again.
I've no idea how to debug that, please help.
Thank you.
UPD: Thanks to @Community member just realized that "0x1fffeade" address is in the system memory region => Looks like the "crash" is actually "restart".
By why does it restart?
Solved! Go to Solution.
2021-08-12 10:26 AM
>>I don't enable it in my code.
But your code isn't starting the device is it? If you inherit the watchdog, you're going to have to keep kicking it otherwise the CPU will restart and reenter the ROM based on the BOOT0 pin state.
>>..and is not disabled automatically?
As I understand the functionality you specifically CAN'T disable it
Make sure you get SCB->VTOR set early in your code, the ROM is mapped at zero, the default for SCB->VTOR is zero, and you want it pointing at FLASH at 0x08000000
>>STM3210 board
?? One of the early series F103 EVAL boards (C, D, E..)
2021-08-12 09:54 AM
Might need to kick the watchdog
2021-08-12 10:05 AM
Do you mean the IWDG? I don't enable it in my code.
Or is there another watchdog that is activated for the bootloader and is not disabled automatically?
In the doc I see the following
2021-08-12 10:08 AM
Also, the "crash" I observe happens immediately (doesn't seem to be a watchdog "configured to its maximum value")
2021-08-12 10:26 AM
>>I don't enable it in my code.
But your code isn't starting the device is it? If you inherit the watchdog, you're going to have to keep kicking it otherwise the CPU will restart and reenter the ROM based on the BOOT0 pin state.
>>..and is not disabled automatically?
As I understand the functionality you specifically CAN'T disable it
Make sure you get SCB->VTOR set early in your code, the ROM is mapped at zero, the default for SCB->VTOR is zero, and you want it pointing at FLASH at 0x08000000
>>STM3210 board
?? One of the early series F103 EVAL boards (C, D, E..)
2021-08-12 10:50 AM
(The board is STM3210E-EVAL)
Thank you, I think that's the right direction.
The SCB->VTOR == 0x1fffe000 in my case. If I manually change it to 0x0800000 - it works!
Now two questions:
2021-08-12 11:05 AM
Thanks a lot @Community member !
Fixed by enabling the USER_VECT_TAB_ADDRESS that forces initialization of SCB->VTOR with the base FLASH address in SystemInit() function.