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?
Solved! Go to Solution.
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.
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. ?
Thanks Frank for your suggestion I have tried the same and it works
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.
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.