2019-05-22 06:53 AM
I have bootloader initial position 0x08000000 and IAP 0x08004000 now.
First, I form bootloader jump to IAP code and it works fine.
But my jump back to bootloader will stop.
Maybe I have a lot of IAP function enable.
So I want to ask, besides __disable_irq() close NVIC, and any other way to deinit other functions?
Because I use __disable_irq(),but it seem isn't effect.
when i back to bootloader code of GPIO inti funaction , it already haven't stop.
Solved! Go to Solution.
2019-05-22 02:13 PM
Please take a look at the following information:
ARM: How to write a bootloader
2019-05-22 07:38 AM
Understand that __disable_irq() has a different effect than actually disabling the interrupts in the peripherals which you have enabled.
You're going to need an __enable_irq() somewhere if you ever want to see them again.
The loader/app need to set SCB->VTOR appropriately.
You can't transfer control from within an IRQ Handler, or related Callback function. Similarly an RTOS using System/User execution contexts.
2019-05-22 02:13 PM
Please take a look at the following information:
ARM: How to write a bootloader
2019-05-22 06:26 PM
Thank you, the problem has been solved.
2019-05-23 06:31 AM
Good!
Please let us know how you fixed the issue, as this helps the community if someone runs into the same issue in the future.
Thanks.
2019-05-23 06:29 PM
I refer to the URL provided by Alex: How to write a bootloader
Before the jump,first you must Disable all enabled interrupts in NVIC.
code : NVIC->ICER[ 0~7 ] = 0xFFFFFFFF ;
After Disable SysTick and clear its exception pending bit, if it is used in the bootloader.
code : SysTick->CTRL = 0 ;
SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk ;
finally the user application into SCB->VTOR register.
This site has more detailed content.
If you are interested, you can refer to it.
THX.