S32K312 FlexCAN not working without debugger

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

S32K312 FlexCAN not working without debugger

Jump to solution
1,481 Views
rakketi
Contributor II

I'm using an S32K312 EVB and trying to use FlexCAN as bare metal.

Everything works fine when I run the EVB with debugger mode in S32DS. All communication and GPIOs work as intended.

But if I exit S32DS debug mode and reset the EVB so the EVB is running by itself, CAN communication does not work.

I've added a LED to be blinking so I know that I'm my application is running. I'm guessing I'm missing something simple, but I cannot see it. I haven't changed the linkers or startup code.

0 Kudos
Reply
1 Solution
1,399 Views
rakketi
Contributor II

Hi, I found the solution. After changing the clock speed to HSE everything works as expected.

View solution in original post

3 Replies
1,400 Views
rakketi
Contributor II

Hi, I found the solution. After changing the clock speed to HSE everything works as expected.

1,421 Views
rakketi
Contributor II

Hi Daniel, we are using the PEmicro mutlilink unviversalFX debugger. When I attach the debugger to a running target it works as normal again but not before.

I added a send CAN frame after CAN init and I can see that we send that frame every 1 second which means that we reset the MCU every second. It should be related to watchdog I guess? I don't see why SRAM or PLL resets every 1 second. 

I added a watchdog with Swt driver and kicked it when needed. The watchdog resets the ECU much quicker if I don't kick the watchdog to confirm that the Swt is OK. 

cansendinit.png - CAN send from the init function every second.

without_SWT.png - Resets the MCU much quicker since the watchdog is timeout window is small and we don't kick the dog.

 

 

0 Kudos
Reply
1,450 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Dawid,

What debugger do you use? Can you attach the debugger back to the running MCU, halt it and check the state of it?

What does it mean the CAN communication does not work? Can you scope the CAN bus?

The debugger can typically disable the WDOG or initialize SRAM ECC.

Something similar was reported in the thread below, and the PLL was the issue:

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

 

BR, Daniel

 

 

 

0 Kudos
Reply