Get Jump status after Jump to bootloader from Application

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Get Jump status after Jump to bootloader from Application

跳至解决方案
1,555 次查看
jtro
Contributor III

I'm using LPC845 Cortext M0+ chip. I'm able to jump from bootloader to application and application to bootloader. Once the microcontroller is power on first time it check whether application is present or not, if application is present is jump to application. When I would like to jump back to bootloader i'm using the same logic to jump to bootloader and it works well.

Now I would like to perform some specific task if bootloader is execute from application.

Is there any best way to check whether bootloader execution start from application or it is normal power on execution?

0 项奖励
回复
1 解答
1,546 次查看
frank_m
Senior Contributor III

I we talk about the same thing, the bootloader will always be executed first.

To stay in the bootloader, or signalize certain states/tasks from the application to the bootloader, you can use memory cells, a.k.a. variables.

But you need to make the addresses known to both applications (bootloader and main application), and exempt this address(es) from startup memory initialisation.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,469 次查看
niket_zope
Contributor III

Hello jtro,

working on mke15z256vll7.

I am newbie in bootloader I am developing the similar feature as yours. I did wrote separate linker & sample bootloader code.

I was able to jmp from bootloader to application. However i get one info displayed saying cstack pointer is outside stack region.

Can you share your code as ref. ?

0 项奖励
回复
1,536 次查看
jtro
Contributor III

Thanks Frank for your suggestion I have tried the same and it works

0 项奖励
回复
1,534 次查看
frank_m
Senior Contributor III

The bootloader and the main application are basically two separate applications. Thus, both need their own vector table. If I remember correctly, an M0+ has no VTOR register, thus has a fixed vector table.

The safest method to get back into the bootloader is a reset, which disables all interrupts.

Either by letting a watchdog trigger, or call the CMSIS function NVIC_SystemReset().

For our company's application, we use the first method, i.e. hold the ECU in a while loop until the watchdog triggers.

0 项奖励
回复
1,547 次查看
frank_m
Senior Contributor III

I we talk about the same thing, the bootloader will always be executed first.

To stay in the bootloader, or signalize certain states/tasks from the application to the bootloader, you can use memory cells, a.k.a. variables.

But you need to make the addresses known to both applications (bootloader and main application), and exempt this address(es) from startup memory initialisation.

0 项奖励
回复