S32K312 after Boot jump Clock_Ip_Init hardfault

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

S32K312 after Boot jump Clock_Ip_Init hardfault

3,702件の閲覧回数
jichengyou
Contributor I

When I use S32K312, after I use Boot jump to app, call Clock_Ip_Init, it goes into hardfault.
I tried for a few days without finding the problem, and as you can see from the logs, the jump was successful, but the call to Clock_Ip_Init leads to hardfault.
Attached are the relevant project codes and screenshots. Please help me confirm the problem.

0 件の賞賛
返信
7 返答(返信)

3,690件の閲覧回数
jichengyou
Contributor I

here is the code

0 件の賞賛
返信

3,659件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have loaded your example and had quick look at the issue. I can see tour Hardfault is escalation of

petervlna_0-1739519479093.png

petervlna_1-1739519514779.png

UNDEFINSTR - Indicates an undefined instruction was executed. This can happen on exception exit if the stack got corrupted.

 

but the call to Clock_Ip_Init leads to hardfault.

Furthermore: looking at clock_ip_init I can call it successfully.

petervlna_0-1739523894585.png

Your code is crashing at my side on address:

petervlna_1-1739524610909.png

Once I execute it the code is going to userfault - >hardfault because that is unknown instruction.

Do you see the same?

Best regards,

Peter

0 件の賞賛
返信

3,652件の閲覧回数
jichengyou
Contributor I

I can't understand what you mean. Could you explain it in more detail?
As I was debugging I found that the address of the function Clock_Ip_pfkNotificationsCallback was set to 0x0, and I think that is why it went into hardfault.
But I can't find where it changed to 0x0.

jichengyou_0-1739525796168.png

 

0 件の賞賛
返信

3,612件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

For me it is going to hardfault on the settings of waitstates as you can see from my screenshot.

You can simply debug it by following the guide below:

https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://community.nxp.com/pwmxy876...

To me it seems like incorrect clock settings, which can produce faulty instructions.

But please do debug on your side according to guide to see what is exact reason.

Best regards,

Peter

0 件の賞賛
返信

3,603件の閲覧回数
jichengyou
Contributor I

hello @petervlna

I found that this problem seems to be related to the size of my BSS. Now I want to try to expand its storage area, but I don't know how to deal with it. Could you help me check it?

0 件の賞賛
返信

3,584件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Hmm, this is strange. If you do not have large enough section BSS to fit code there, compiler would rise errors for your linker. And I was able to compile the code here.

I am bit confused here.

Nevertheless, please refer to you compiler documentation on how to work with sections in linker.

For example I see size of your BSS in DCU project:

petervlna_0-1739951637162.png

 

Best regards,

Peter

0 件の賞賛
返信

3,628件の閲覧回数
jichengyou
Contributor I
@petervlna
Hello petervlna,please refer to my previous reply.
0 件の賞賛
返信