S32K312 after Boot jump Clock_Ip_Init hardfault

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K312 after Boot jump Clock_Ip_Init hardfault

3,704 次查看
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,692 次查看
jichengyou
Contributor I

here is the code

0 项奖励
回复

3,661 次查看
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,654 次查看
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,614 次查看
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,605 次查看
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,586 次查看
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,630 次查看
jichengyou
Contributor I
@petervlna
Hello petervlna,please refer to my previous reply.
0 项奖励
回复