s32k CAN-FD Tx Error

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

s32k CAN-FD Tx Error

3,599 次查看
soonhwanjung
Contributor I

Hi NXP team,

I tested CAN-FD with S32K146 EVM board and CANAnalyzer get data correctly.

But, crc error has occurred. 

It is my FLEX CAN0 setting for CAN-FD as below,

I tested it with 500 KHZ/1MHz.

CAN0->CBT = 0x802FB9EF; /* Configure nominal phase: 500 KHz bit time, 40 MHz Sclock */
CAN0->FDCBT = 0x00730083; // 1MHz BTL:10, TSEG1: 5(4), TSEG2: 4(3), Prescaler: 8, sync jump width: 4(3)
CAN0->FDCTRL = 0x80031400;

CANAnalyzer setting as follows,

Sample point: 60, BTL Cycle: 10, TSEG1: 5, TSEG2: 4, Prescaler: 8

Tx has error issue. While, Rx seems to work well(CANAnalyzer sends a data, EVM seems to receive it correctly).

Please let me know whether the setting is correct.

Thanks in advance.

Br,

Soon.

标签 (1)
0 项奖励
回复
4 回复数

3,442 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

CAN bit timing looks correct. you did not mentioned bit timing setting on CAN tool for nominal phase, but I guess it will be fine.

What message is transmitted? Are all bits in the MB properly set (for example SRR=1 for extended ID)?

BR, Petr

0 项奖励
回复

3,342 次查看
francescovico
Contributor III

Hello,

to use extended CAN ID, I have done a modification in flexcan_hw_access.c:

in function FLEXCAN_SetTxMsgBuff :

Original:

 /* Clear SRR bit */
flexcan_mb_config &= ~CAN_CS_SRR_MASK;

After my modification:

flexcan_mb_config |= CAN_CS_SRR_MASK;

It's correct?

0 项奖励
回复

3,442 次查看
soonhwanjung
Contributor I

Hi Peter,

Sorry for the late reply.

It is Rx message which CAN tool received as below.

CANFD_Tx_log.png

Nominal phase configuration as follows,

Sample point: 70, BTL Cycle: 80, TSEG1: 55, TSEG2: 24, Prescaler: 2

I do not know whether the configuration correct. 

For information, I am testing CAN FD with FlexCAN_FD_s32k144 (no changes except header for S32K146). 

Thanks in advance.

BR, Soon

0 项奖励
回复

3,442 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

- you should have same sample point setting on MCU and CANtool, for both nominal and data phases. You have 80%  for MCU and 70% for CAN tool. Try to modify it on CAN tool.

- it is recommended to have the same prescaler for both nominal and data phases. So you can try to use for example below setting

CANx_CBT = 0x808721A7;  // bitrate=500kbps, CPI clk=80 MHz; Prescaler= 5, PROPSEG=9, PSEG1=14, PSEG2=8, RJW=8, smp=75%

CANx_FDCBT = 0x004310C3;  // bitrateFD=1000kbps, CPI clk=80 MHz; fPrescaler= 5, fPROPSEG=4, fPSEG1=7, fPSEG2=4, fRJW=4, smp=75%

Again set the same sample point on CAN tool

BR, Petr

0 项奖励
回复