Hardfault doesn't appear in debug

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

Hardfault doesn't appear in debug

ソリューションへジャンプ
1,443件の閲覧回数
Armageddon
Contributor I

Hello,

I program on MKV56F1M0 and I want to debug a program whose role is to call a second program stored at another address of the chip.

I have two distinct projects but the second one is only to increment a variable at an address shared with the main program.

So I have :

SOFT_1 --> call --> SOFT2

SOFT_2 --> var increment --> SOFT_1

 

The problem is that when my SOFT_1 calls SOFT_2, my program returns a HardFault with an INVSTATE.

When I use the debugger in step by step with "Instruction Stepping Mode", my program enters well at the good address and increments my variable but on the other hand, if I let the program enter WITHOUT the step by step, then HardFault.

INVSTATE Indicates that the processor has tried to execute an instruction with an invalid Execution Program Status Register value. Ok... but what do I have to do to make sure this is not the case?

I don't know much about ARM so how can I debug this problem? Thank !

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

Hi

I'm not very familiar with the ARM Cortex core, but I searched for keywords in the Arm Cortex-M7 Devices Generic User Guide and found: Restrictions when using PC or SP. Maybe this is the reason.

Restrictions when using PC or SP.png

By the way:
This problem seems to be related to the use of ARM Cortex. I am afraid that you can get a more accurate answer by contacting ARM's technical support.


Best Regards,
Robin

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,423件の閲覧回数
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will by supporting your case, I am reviewing your case, but could you elaborate further about your case?

Best regards,
Pavel

 

0 件の賞賛
返信
1,413件の閲覧回数
Armageddon
Contributor I

I think I have the beginning of a solution but I'm still trying to figure it out for now.

My SOFT_1 calls my SOFT_2 which starts at address 0x10081000. In step by step mode, everything goes well but in normal execution I have a HardFault with the PC register at 0x10081000.

The problem does not appear if I call my program at address 0x10081001. And so I try to understand what is the impact of the thumb mode and the EPSR register.

For example here is what I have at address 0x10081000:

Screenshot2.png

If I scroll up just a little bit, I get this pop:

Screenshot1.png

So I understand I shall avoid to call the address 0x10081000 and start to 0x10081001 but without explained it yet.

0 件の賞賛
返信
1,402件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

I'm not very familiar with the ARM Cortex core, but I searched for keywords in the Arm Cortex-M7 Devices Generic User Guide and found: Restrictions when using PC or SP. Maybe this is the reason.

Restrictions when using PC or SP.png

By the way:
This problem seems to be related to the use of ARM Cortex. I am afraid that you can get a more accurate answer by contacting ARM's technical support.


Best Regards,
Robin

0 件の賞賛
返信