cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 built-in bootloader does not respond: how to debug?

SemS
Associate

I have STM32F103T6Ux. I'm trying to communicate with the built-in bootloader, so we can do software update via UART. I'm setting BOOT0 pin high and it seems the system is in bootloader, since our normal code doesn't come up. I'm setting my side of UART to 8-bit, 1 stop bit, even parity per AN2606. I'm sending 0x7f to booloader, but not getting any reply. I've tried all speeds from 14400 to 115200 and nothing. Our normal software can comminicate via the same UART interface just fine. Our UART pins are PA10-RX and PA9-TX per spec. Is there any way to get source for the build-in bootloader, so I can step through it via debugger and see what's going on? Also, if I understand it correctly, bootloader should be at address 0x1fffff000. I've tried to jump to it from my code, but it the code there generated an exception.

2 REPLIES 2

Debuggers don't need source code to step code. The source to the loader is not provided, but can be read/disassembled.

0x1FFFF000 is the address of a Vector Table, not code, you need to load the second address in the vector table into a register, and then jump to that address. Note also that EVEN addresses will fault a CM3 as it doesn't execute 32-bit ARM code, only 16-bit THUMB code.

The F1 is problematic because you can't remap the ROM into the ZERO address space, so a software call can't perfectly emulate a reset via BOOT0 low. Watch also what you're doing with BOOT1, lest you're trying to run code from RAM.

Check AN2606, the part is likely checking multiple sources of connectivity. If you have another device, like a GPS/GNSS receiver that squawks immediately at start-up, the loader will recognize that as it's master.

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

Ok. Thanks for the info!