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.
Hello,
I have loaded your example and had quick look at the issue. I can see tour Hardfault is escalation of
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.
Your code is crashing at my side on address:
Once I execute it the code is going to userfault - >hardfault because that is unknown instruction.
Do you see the same?
Best regards,
Peter
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.
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:
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
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?
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:
Best regards,
Peter