Program counter inadvertently jump to Boot ROM location

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

Program counter inadvertently jump to Boot ROM location

711件の閲覧回数
aporvasrivastava
Contributor I

Hi Team,

I am using MKE18F512VLH16 controller for my project. I want to understand that if there is any prevention or mitigation present to inadvertently update program counter to ROM Boot location (other than loader entry point) while running application from flash and if there is this control jump is possible then what will be behavior of controller.

ラベル(1)
0 件の賞賛
3 返答(返信)

699件の閲覧回数
aporvasrivastava
Contributor I

My main question is regarding corrupted stack. What will be concurrence if stack is corrupted to ROM Loader location (other than loader entry point). Will this lead to any exception or execution will start from ROM?

0 件の賞賛

694件の閲覧回数
bobpaddock
Senior Contributor III

It can deepened on your CPU core to some degree.

M0+ do not allow unaligned access so they would cause a hardware fault exception on a odd (vs even) return value 'returned' from the stack.

Otherwise execution will go to the address 'returned' via the stack and hard to say what can happen.

One theoretical scenario is the part of the bootloader initialization gets missed by jumping past it, so the bootloader ends up in some endless loop.

These are the cases that Watchdogs where meant to handle.

 

0 件の賞賛

707件の閲覧回数
bobpaddock
Senior Contributor III

To be a little clearer, are you saying that you have running code now, that is randomly ending up in the bootloader?  The three most likely causes are a corrupted stack, a bad pointer-to-function, or hardware transients.

Or are you saying  that you want to control entry to the bootloader to prevent it from your application?
That is somewhat dependent on the CPU you are using.