Get Jump status after Jump to bootloader from Application

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Get Jump status after Jump to bootloader from Application

ソリューションへジャンプ
1,440件の閲覧回数
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,431件の閲覧回数
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,354件の閲覧回数
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,421件の閲覧回数
jtro
Contributor III

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

0 件の賞賛
返信
1,419件の閲覧回数
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,432件の閲覧回数
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 件の賞賛
返信