UsageFault: The processor has attempted to execute an undefined instruction.

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

UsageFault: The processor has attempted to execute an undefined instruction.

ソリューションへジャンプ
1,822件の閲覧回数
aadyaa
Contributor II

I am reaching out to seek assistance with a usage fault issue that I am facing while attempting to jump from a custom bootloader to an application on an NXP platform.

Error message: 

UsageFault: The processor has attempted to execute an undefined instruction.
HardFault: A fault has been escalated to a hard fault.

Here are some key details regarding my setup:

Bootloader located at address: 0x00400000
Application located at address: 0x00500000
Function pointer address used for jumping to the application: ((0x00500800)+1) (VTABLE address) but faced usage fault which is leading to hardfault.

I have also tried jumping directly to the reset handler address [Reset handler address attempted: 0x00500c20], but the issue persists. 

I would greatly appreciate any guidance or insights from the community on potential pitfalls or areas where I might be overlooking crucial details. If anyone has experience with a similar scenario or can provide troubleshooting advice, it would be immensely helpful.

0 件の賞賛
返信
1 解決策
1,790件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @aadyaa,

Can you try with this code?

ADDR_APP = 0x00500000

func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);
func = (((UINT32)func) & 0xFFFFFFFEU);
(* (void (*) (void)) func)();

Please read the memory first.

At ADDR_APP there should be 0x5AA55AA5
At ADDR_APP + offset 0xC, there is the Cortex-M7_0 core start address.
(RM rev7, Table 189. Image vector table).

 

Regards,

Daniel

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,791件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @aadyaa,

Can you try with this code?

ADDR_APP = 0x00500000

func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);
func = (((UINT32)func) & 0xFFFFFFFEU);
(* (void (*) (void)) func)();

Please read the memory first.

At ADDR_APP there should be 0x5AA55AA5
At ADDR_APP + offset 0xC, there is the Cortex-M7_0 core start address.
(RM rev7, Table 189. Image vector table).

 

Regards,

Daniel

 

0 件の賞賛
返信
1,762件の閲覧回数
aadyaa
Contributor II

Hello @danielmartynek 

Thank you for your reply, I made small change to your code snippet and it started working.

Here is the updated code:

 

ADDR_APP = 0x00500000

func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);
func = ((((uint32_t)func) & 0xFFFFFFFEU) | 1u);
(* (void (*) (void)) func)();

0 件の賞賛
返信