CAN1 issue using S32K344 - Error Frame (stuff error)

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

CAN1 issue using S32K344 - Error Frame (stuff error)

跳至解决方案
3,491 次查看
MVR
Contributor V

Hello everyone,

I have two codes using CAN0 and CAN1, the first code using RTD (S32K3_RTD_2_0_1_D2207_ASR_REL_4_4_REV_0000_20220707) both channels are working properly with this configuration on S32DS:

MVR_0-1729190610129.png

MVR_1-1729190718903.png

When I configure the same baudrate on EB Tresos 29.0, only the CAN0 is working, the CAN1 is returning error on BUSMASTER tool:

MVR_2-1729190948305.png

This is the configuration on Tresos for CAN0 and CAN1:

MVR_3-1729191021584.pngMVR_4-1729191054213.pngMVR_5-1729191084801.png

MVR_14-1729199943852.png

 

MVR_13-1729199889766.png

MVR_8-1729191175262.png

MVR_11-1729199731391.png

 

This is the code that I`m using for test:

MVR_9-1729191308590.png

When I select the instance 0, I can see the message reaching the BUSMASTER correctly:

MVR_10-1729191541450.png

Note: The transceiver is being configured correctly and as I said, using the RTD code it is working properly, so the hardware is validated.

Anyone can help me with this issue?

Thanks,

MVR

 

标记 (6)
0 项奖励
回复
1 解答
3,263 次查看
MVR
Contributor V

Hello @PetrS,

I found the issue. We have a mosfet in the hardware to control the terminator resistor. If the mosfet is activated, the terminator circuit will be working.

The CAN0 doesn't have this mosfet. I didn't know about it... Also the registers are different, so these two things fooled me.

Thank you.

在原帖中查看解决方案

0 项奖励
回复
9 回复数
3,361 次查看
MVR
Contributor V

Anyone can help me?

0 项奖励
回复
3,455 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to use same bit timing setting, even that the one you use in EB would be correct too.
Compare values actually written to bit timing registers.
Finally, do not use FIRC as PE clock source, select FXOSC, or PLL running from FXOSC.

BR, Petr

0 项奖励
回复
3,446 次查看
MVR
Contributor V
I checked the registers and they are the same for bit timing setting, even with different values set in EB... I will test with the another clock that you recommended.
0 项奖励
回复
3,437 次查看
MVR
Contributor V

Hello @PetrS ,

I changed the clock but still the channel 1 is not working... Do you have another idea?

0 项奖励
回复
3,352 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to share simplified project so can be tested on EVB.
Maybe other try could be testing behavior on latest RTD.

BR, Petr

0 项奖励
回复
3,327 次查看
MVR
Contributor V

Hello @PetrS ,

The generated code are the same, using the RTD 2.0.1 and the last version of AUTOSAR HF02 (S32K3_RTD_4_0_0_HF02_D2407_ASR_REL_4_7_REV_0000_20240725), but looking the registers, they are different:

Into the "FlexCAN_Ip_Vs_0_PBcfg.c" in both generated code we can see these values (this is one example about bitrate, but the other configuration are the same):

MVR_0-1729744910477.png

But the registers we can see different values:

MVR_5-1729745181047.png

MVR_6-1729745194254.png

MVR_7-1729745202668.png

MVR_8-1729745213193.png

MVR_1-1729745107341.png

MVR_3-1729745122469.png

MVR_4-1729745129613.png

How is it possible since the generated code is the same? Again, the CAN0 is working with the new version, but CAN1 is not working.

Note: Left side is the RTD 2.0.1 for S32DS - SW32K3_RTD_4.4_2.0.1 (S32K3_RTD_2_0_1_D2207_ASR_REL_4_4_REV_0000_20220707) and in the right side is the new library version for Tresos - SW32K3_RTD_R21-11_4.0.0_HF_02 (S32K3_RTD_4_0_0_HF02_D2407_ASR_REL_4_7_REV_0000_20240725).

Thank you,

MVR

 

 

0 项奖励
回复
3,312 次查看
MVR
Contributor V

Ops, I made a mistake. CBT registers are not different, they are the same:

MVR_0-1729747003273.png

Sorry, I took a screenshot when I was changing the bitrate. But with the bitrate the same, CBT are the same.

0 项奖励
回复
3,303 次查看
MVR
Contributor V

Note: I set manually the bitrate only to see if this is the problem, but the generated code for bitrate are different...

0 项奖励
回复
3,264 次查看
MVR
Contributor V

Hello @PetrS,

I found the issue. We have a mosfet in the hardware to control the terminator resistor. If the mosfet is activated, the terminator circuit will be working.

The CAN0 doesn't have this mosfet. I didn't know about it... Also the registers are different, so these two things fooled me.

Thank you.

0 项奖励
回复