Get Jump status after Jump to bootloader from Application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Jump status after Jump to bootloader from Application

Jump to solution
1,206 Views
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 Kudos
Reply
1 Solution
1,197 Views
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.

View solution in original post

0 Kudos
Reply
4 Replies
1,120 Views
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 Kudos
Reply
1,187 Views
jtro
Contributor III

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

0 Kudos
Reply
1,185 Views
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 Kudos
Reply
1,198 Views
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 Kudos
Reply