Hardfault when we are not using debugger in S32K344

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

Hardfault when we are not using debugger in S32K344

Jump to solution
311 Views
MVR
Contributor V

Hello everyone,

I'm facing a weird issue. When I run my code in the debug mode, everything works properly (CAN, UART and so on).

But when I remove the debugger and reset the board, I can see that the CAN and other peripherals don't work as I expected.

Then, I attached the debugger activating this option:

MVR_0-1755031791882.png

And I could see that the system reaches the hardfault:

MVR_1-1755032079675.png

Before, I was facing the same issue (with debugger) and I could find out that the problem was the Interrupt Monitor into the Platform_Init(), when I removed this configuration on Tresos 29.0.0 (disable the INTM), I started to get hardfault in this new point into Mcl_Init(), showed below.

Also, I could see that if I commented out the Mcl_init(), I get hardfault as well in the Uart_Init(), in this point:

MVR_3-1755032834466.png

Again, using the system in debug mode, it doesn't happened. Can anyone help me with this problem? 

I could see some topics related this issue and the people saying that HSE_CLK should be CORE_CLK/2, but it is already configured this way:

MVR_2-1755032234658.png

Thank you,

MVR

0 Kudos
Reply
1 Solution
256 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@MVR

I tested your code, you need to use "MCU_SetMode()" to turn on the peripheral clock, this is the reason for entering hardfault

Senlent_0-1755160640927.png

 

View solution in original post

0 Kudos
Reply
3 Replies
286 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@MVR

"When I run my code in the debug mode, everything works properly (CAN, UART and so on)."

Most of these problems should be related to the clock configuration.

If you can provide a complete project, I can help you check it.

0 Kudos
Reply
277 Views
MVR
Contributor V

Sent you via private message due to confidentiality...

But as soon as we fixed this issue, I will post the solution here to help the community.

Thanks.

0 Kudos
Reply
257 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@MVR

I tested your code, you need to use "MCU_SetMode()" to turn on the peripheral clock, this is the reason for entering hardfault

Senlent_0-1755160640927.png

 

0 Kudos
Reply