cancel
Showing results for 
Search instead for 
Did you mean: 

jump from user application to custom bootloader

moustaid jamal
Associate II
Posted on March 01, 2017 at 17:07

Hi

I have a custom bootloader that I flash to the first sector (0x8000000)  and when it receives a new program it loads it to 0x8003000. I can jumps to the user application,however  when It from user application jumps to the bootloader it seems to have problems because i can't display the menu in hyper terminal (send data via USART),but i can blink a led .

Do you have any idea ?

Thank you in advance !

Turvey.Clive.002

#custom-bootloader #stm32f1
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on March 02, 2017 at 16:13

You'll need to provide it with conditions that match the code expectations (peripherals and clocks reset). A lot of SystemInit() related code sets the SCB->VTOR, but also expects to be running off the HSI, and not have random interrupts enabled and firing.

Use some common sense, and try to understand why it fails currently. It's a lot easier to review code than try and guess what you've screwed up, as imaginative as I am.

Can you use NVIC_SystemReset() back into the loader? How and where do you transfer control now? Present some debugging analysis you've done so far? Assume I'm not telepathic, or capable of distant viewing.

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

View solution in original post

5 REPLIES 5
Posted on March 01, 2017 at 17:27

You'll need to be more specific about the part and code in question. How is control transferred? Is it done from interrupt context? Are interrupts running (SysTick, USART, etc)? Are you configuring the clocks correctly, ie do hardware and software expectations align?

Use a debugger, step the code, look at the peripheral registers, and make some determination about what is happening and why.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
moustaid jamal
Associate II
Posted on March 01, 2017 at 18:01

When I jump to the custom bootloader I can't communicate with the hyperterminal anymore, i don't use interrupt, i just jump to bootloader custom  from user application

Posted on March 01, 2017 at 18:14

I'm not sure how I'm supposed to solve this with the information presented.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 02, 2017 at 09:37

can you tell me what i should do before jumping from user application to custom bootloader, and if i should change the vector table in custom bootloader?

thank you;

Posted on March 02, 2017 at 16:13

You'll need to provide it with conditions that match the code expectations (peripherals and clocks reset). A lot of SystemInit() related code sets the SCB->VTOR, but also expects to be running off the HSI, and not have random interrupts enabled and firing.

Use some common sense, and try to understand why it fails currently. It's a lot easier to review code than try and guess what you've screwed up, as imaginative as I am.

Can you use NVIC_SystemReset() back into the loader? How and where do you transfer control now? Present some debugging analysis you've done so far? Assume I'm not telepathic, or capable of distant viewing.

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