s32k312 can error passive

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

s32k312 can error passive

1,427 次查看
coo
Contributor I

messageImage_1708653257397.jpg

I want to use CAN 0-5 channel using s32ds 3.4 RTD 2.0.3 version.

The picture below is an error phenomenon as seen by Pcan view.
Data is transmitted and received on all CAN channels, but error passing occurs at irregular intervals.
I am sending and receiving CAN TX RX in 100ms.


I think the cause of this is in the process of controlling the controller.

void v_canCh0ControllerMode(void)
{
static uint8_t u8_canCh0ControllerStart = 0U;
 
if(0U == u8_canCh0ControllerStart)
{
Can_SetControllerMode(0, CAN_CS_STARTED);
u8_canCh0ControllerStart = 1U;
}
else
{
if(TRUE == b_canCh0TxFlag)
{
Can_SetControllerMode(0, CAN_CS_STOPPED);
b_canCh0TxFlag = FALSE;
u8_canTxStart[0] = 0U;
u8_canCh0ControllerStart = 0U;
}
}
}
 
After declaring b_canCh0TxFlag as FALSE, it is changed to TRUE when the transmission is completed.
No controller control was created for reception.

I controlled the controller as above, but do I have to do CAN_CS_STARTED and do CAN_CS_STOPPED so that the next transmission and reception can come in? 
 
0 项奖励
回复
3 回复数

1,397 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you need not to stop controller between transmission/reception.
Try to check CAN bit timing if it is set similarly on both sides, means same bitrate and sample point. If PE clock is selected to be running from FIRC, select rather FXOSC.

BR, Petr

0 项奖励
回复

1,390 次查看
coo
Contributor I

@PetrS
I changed the CLOCK from FIRC to FXOSC, but I still get an Error Passive error.
The bit rate and sample point are set to 500 and 87.5.
If you don't need to stop the controller between transmitting and receiving, do you mean that you can do TX and RX every 100ms without having to do CAN_CS_STOPPED after you first do Can_SetControllerMode(0, CAN_CS_STARTED)?

I want to use all channels, but does this apply to all channels?

0 项奖励
回复

1,383 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes you can do TX and RX every 100ms without stopping module.

BR, Petr

0 项奖励
回复