I encountered a strange problem, when I test the operation of C40 Flash with HSE function enabled, I found that when I use JLINK to debug, the C40 can operate the Flash normally, but after I remove JLINK, power off and re-power, the C40 Demo does not work.
Attached is my test project。
What is going on here?
Hello @liangyouchao,
Something similar was discussed here:
Can you please check the clock configuration?
Is it set to one of the clock options:
24.7.2 Clocking use case examples
There is a not below Table 141.
"The frequencies in the table above are maximum frequencies for a specific clock. However, any clock frequency
selected must adhere to the same clock divider ratios shown in Clocking use case examples."
60.4.2 Clocking
"In general, you must set AIPS_SLOW_CLK to one-fourth or one-half the frequency of CORE_CLK."
Thank you,
Regards,
Daniel
This is my clock configuration, please help me to see if there is a problem. Also, which document is the information you describe, I can't find it in the reference manual, can you provide me with your document?
Hello @liangyouchao,
I don't see any issue in the clock configuration.
Can you please implement this handler in the project
void HardFault_Handler(void)
{
while(1){}
}
Attach the debugger back to the MCU after the POR.
If you find the execution in this loop, please check the type of the exception, find the fault instruction on the stack etc.
https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447
Thank you,
BR, Daniel
After the device is powered off and re-powered, the J-LINK connection will reboot the device and I can't get in the non-working state. Recently I have made other attempts, for example, according to the block diagram of S32K312, I modified the clock frequency to 120MHZ, this is my clock configuration diagram, but it still doesn't solve the problem.
The J-link can be attached without rebooting the MCU:
BR, Daniel