S32K312 C40_Ip Can't work with HSE activated.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 C40_Ip Can't work with HSE activated.

834 Views
liangyouchao
Contributor I

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?

0 Kudos
5 Replies

792 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @liangyouchao,

 

Something similar was discussed here:

https://community.nxp.com/t5/S32K/The-program-runs-normally-with-a-debugger-but-the-program-runs/m-p...

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

0 Kudos

789 Views
liangyouchao
Contributor I

Snipaste_2023-06-13_19-39-44.png

 

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?

0 Kudos

770 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos

729 Views
liangyouchao
Contributor I

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.

 

liangyouchao_0-1687766612433.png

liangyouchao_1-1687766637155.png

 

0 Kudos

719 Views
danielmartynek
NXP TechSupport
NXP TechSupport

The J-link can be attached without rebooting the MCU:

https://mcuoneclipse.com/2015/03/20/attaching-to-a-running-target-with-segger-j-link-gdb-and-eclipse...

 

BR, Daniel

0 Kudos