cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Jump back to Bootloader Application

gkennerknecht
Associate II
Posted on February 25, 2016 at 16:18

Hello,

i know there are many Posts about Problems with Memory Jumping and Bootloaders. But no one of this posts could solve my problem.

I am using an STM32F103VCT6 Mic. Bootloader placed at 0x8000000, Application at 0x8010000. No problem to jump from Bootloader to Application, Vector Relocation works, thats all ok. But if i want to jump back to my Bootloader based at Adress 0x8000000 i´v get a Problem with initialisiation. I couldn´t use a Systemreset, because there are some ports that need to be kept in hi state.

After Jump to Bootloader (i know it works, because i could debug it, and pull a led hi) i won´t get systick and irq´s get running. Vector Table is relocated at 0x8000000.

are there any missing things regarding vector relocation, PSP, MSP?

Gerhard
2 REPLIES 2
Posted on February 25, 2016 at 16:52

I don't understand why this is materially different for any other transfer of control.

You should probably get the peripherals into a non-interrupting state rather that disabling interrupts in a blanket fashion, and then have the loader reassert its vector table and enable the interrupts/functions it needs. You might want to review the code in and called by SystemInit() and make sure it doesn't tread on things as you have the currently configured, ie clocks, plls, flash, etc.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gkennerknecht
Associate II
Posted on February 26, 2016 at 10:42

Hey,

thanks for advice. I think the Problem is solved.

The solution for jumping back to bootloader:

  • disable/deinitialize all peripherals in application
  • disable specific interrupts
  • stop systick
  • jump to bootloader at adress 0x8000000
  • init necessary irq´s again
  • reset pending irqs
  • init modules, init systick
  • run bootloader

Good job in front of weekend.