2017-03-01 08:07 AM
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 #stm32f1Solved! Go to Solution.
2017-03-02 08:13 AM
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.
2017-03-01 08:27 AM
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.
2017-03-01 09:01 AM
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
2017-03-01 10:14 AM
I'm not sure how I'm supposed to solve this with the information presented.
2017-03-02 01:37 AM
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;
2017-03-02 08:13 AM
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.