S32K314 Not sending CAN frame

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

S32K314 Not sending CAN frame

2,695 次查看
Shapan
Contributor I

Hello There,

I am trying to send CAN/FD frame from S32K314 based on FlexCAN_example, but no frames are visible on the CAN trace, below is my code, I have also attached the CAN configurations:

extern void CAN0_ORED_0_31_MB_IRQHandler(void);
 
int main(void)
{
    /* Write your code here */
 
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
 
 
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals,g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals);
 
IntCtrl_Ip_EnableIrq(FlexCAN0_1_IRQn);
IntCtrl_Ip_InstallHandler(FlexCAN0_1_IRQn, CAN0_ORED_0_31_MB_IRQHandler, NULL_PTR);
 
Flexcan_Ip_DataInfoType rx_info = {
.msg_id_type = FLEXCAN_MSG_ID_STD,
.data_length = 8u,
.is_polling = TRUE,
.is_remote = FALSE
};
Flexcan_Ip_MsgBuffType rxData;
FlexCAN_Ip_Init(INST_FLEXCAN_0, &FlexCAN_State0, &FlexCAN_Config0);
FlexCAN_Ip_SetStartMode(INST_FLEXCAN_0);
FlexCAN_Ip_ConfigRxMb(INST_FLEXCAN_0, RX_MB_IDX, &rx_info, MSG_ID);
while(1)
{
    rx_info.is_polling = TRUE;
FlexCAN_Ip_Send(INST_FLEXCAN_0, TX_MB_IDX, &rx_info, MSG_ID, (uint8 *)&dummyData);
}
    return exit_code;
}

 

Please let me know am I missing anything here ?

0 项奖励
回复
2 回复数

2,671 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Shapan,

Are you utilizing two nodes (two S32K314) or are you measuring the CAN Line with an analyzer? 

If using a CAN analyzer tool, make sure the CAN bit setting is configured to have the same sample point as configuration. It is recommended to have same prescaler and TDC is not needed for these rates. 

Best regards,
Julián

0 项奖励
回复

2,662 次查看
Shapan
Contributor I

Hi @Julián_AragónM ,
Thanks for the reply, Yes I am using the CANalyzer for this, I have tried the bit rate according to the tool but still no solution., tried with different baudrates (500k, 1MB etc,.)

I have attached the ESR1 register information, kindly look into this

0 项奖励
回复