the Bootloader start address is 0x00004128, the application start address is 0x00000148,when the CPU Run, i want the CPU first run in Bootloader,then jump to application start address,this are two part separate software,so i set the resetvector address is the same as Bootloader start address, it can work,but when it jump to start adddress,it does't work,i don't know how to achieve jump function to make sure the application work normal? i just disable interprut and use function pointer to application start address, whether need to set other registers to achieve it? waitting for your help !
Hi Lukas,
Thanks for your reply, I am sure disable all interrupts,about the local enable bit,can you show me more details?
about put everything back to default status,do you have convenient operation to set it all back? i tried to set this registers i initialize in bootloader back,but it can't run in ASW, i use the same operation to jump from appication SW to Bootloader with only disable all interrupts, it runs normal,i don't know whick step is wrong,I waitting for your reply,Thanks again!
Hi,
"local enable bits" - for example, I mean bits like TCIE or RIE in SCI_CR1 register. These are bits which enable interrupts in the eSCI module. If you keep them enabled when jumping to app and if you disable interrupts only by EE bit in MSR then application is not aware of that, application can enable EE bit and SCI interrupt can be triggered even if application doesn't use it...
To set everything back to default state - this can be done manually by writing to registers or by reset. There's no other option.
Regards,
Lukas
Hi,
when jumping from bootloader to user application, did you disable all interrupts? I mean also by local enable bits. I always recommend to put everything back to default state when jumping to user application. Or the user application must know exactly that the chip is not in default reset state. Another option is to jump to user application right after reset when bootloader just checks some condition if application should be started or not.
Regard,
Lukas