S32K312 FlexCAN not working without debugger

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K312 FlexCAN not working without debugger

ソリューションへジャンプ
986件の閲覧回数
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 解決策
904件の閲覧回数
rakketi
Contributor II

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

元の投稿で解決策を見る

3 返答(返信)
905件の閲覧回数
rakketi
Contributor II

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

926件の閲覧回数
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 件の賞賛
955件の閲覧回数
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 件の賞賛