2025-03-17 7:48 AM
Hi all,
I'm trying to adapt stm32loader python script to use it with stm32wl5 chip. So for now it's working i'm able to flash my stm, but for now after flashing Id like to run my firmware.
Here is my step procedure :
- Put BOOT0 to 1
- RESET mcu
- Put BOOT0 to GND
- Right now I'm in bootloader mode I'm able to flash my mcu with my python script
I've read AN3155 stm pdf and here is my python function to send go command
def send_go_command(self, address=0x08000000):
self.serial.write(bytes([0x21, 0xDE]))
self._wait_for_ack("0x21 0xDE go failed")
address_bytes = address.to_bytes(4, 'big')
checksum = address_bytes[0] ^ address_bytes[1] ^ address_bytes[2] ^ address_bytes[3]
self.serial.write(address_bytes + bytes([checksum]))
self._wait_for_ack("address go failed")
it's seem it's doesn't work well, I got no error, I received all ACK byt my STm doesn't run my new flash firmware.
Should I do something with VTOR?
Maybe I missunderstood something ?
2025-03-17 8:03 AM
After you execute this command, do future bootloader commands fail? If they still work, you're still in the bootloader.
If your program uses interrupts at all, which it probably does, yes it will need to set SCB->VTOR on startup. Typically this is done in the system_stm32*.c file.