AnsweredAssumed Answered

STM32F103 family branch from my Application to Bootloader in System Memory

Question asked by Neumann.Andreas on Jun 23, 2016
Latest reply on Dec 7, 2016 by Clive One
Hello,
I am trying to branch to the STM bootloader from my application, but it doesn't work. I use the STM32F103VFT6 and USART1. If I pull-up the pin BOOT0 and then switch on the power supply, the Flash Loader Demonstrator gets contact to the STM32F103VFT6 with 11520 Baud, 8 data bits, even parity, 1 stop bit.
I checked the hints in AN2606:
- Disable all peripheral clocks
- Disable used PLL
- Disable interrupts
- Clear pending interrupts
- Start address of bootloader: 0x1FFF.E000

And then I want to branch with this C / assembly code:
  SCB->VTOR = 0x1FFFE000;                  // Vector table relocation in system

  __asm ("movw r0, #0xE000");
  __asm ("movt r0, #0x1FFF");
  __asm ("ldr  sp, [r0, #0]");                        // Set main stack pointer of bootloader

  __asm ("movw r0, #0xE004");
  __asm ("movt r0, #0x1FFF");
  __asm ("bx   r0");                                      // Branch to bootloader
That results in hard fault and the debugger finds me in that interrupt handler.

Can you help me to find my mistake? Thanks in advance!

Outcomes