S32K312 FlexCAN not working without debugger

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K312 FlexCAN not working without debugger

跳至解决方案
949 次查看
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 项奖励
1 解答
867 次查看
rakketi
Contributor II

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

在原帖中查看解决方案

3 回复数
868 次查看
rakketi
Contributor II

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

889 次查看
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 项奖励
918 次查看
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 项奖励