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.
Solved! Go to Solution.
Hi, I found the solution. After changing the clock speed to HSE everything works as expected.
Hi, I found the solution. After changing the clock speed to HSE everything works as expected.
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.
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:
BR, Daniel