When using the code generated by CAN PAL to receive messages, all information of the first received message is displayed as 0 (the corresponding message is refreshed after exiting the interrupt). The data in the second receive interrupt works normally. Thank you for your help!
CAN_Init(&can_pal2_instance, &can_pal2_Config0);
CAN_InstallEventCallback(&can_pal2_instance, &CAN2_RXTXMsgHandle, (void*)0);
CAN_ConfigRxBuff(&can_pal2_instance, gs_CANRxIDMsgInfo.buffIdx, &gs_CANRxIDMsgInfo.config, 0x02160000);
CAN_SetRxFilter(&can_pal2_instance,CAN_MSG_ID_EXT,0,0x1fffe200);
CAN_Receive(&can_pal2_instance, 0, &gs_RXCANMsg);
void CAN2_RXTXMsgHandle(uint32_t instance,
can_event_t eventType,
uint32_t objIdx,
void *driverState)
{
switch(eventType)
{
case CAN_EVENT_RX_COMPLETE:
//CAN_Receive(&can_pal2_instance, 0, &gs_RXCANMsg);
id_can_rx[id_count++] = gs_RXCANMsg.id;
//When powered on, the breakpoint here shows all zeros for the first time.
//CAN_Receive(&can_pal1_instance, RX_MAILBOX, &gs_RXCANMsg);
#if 1
CAN_Receive(&can_pal2_instance, 0, &gs_RXCANMsg);
CAN_Receive(&can_pal2_instance, 4, &gs_RXCANMsg);
//CAN_Receive(&can_pal1_instance, gs_CANRxPhyIDMsgInfo.buffIdx, &gs_RXCANMsg);
#endif
break;
case CAN_EVENT_TX_COMPLETE:
//TP_DoTxMsgSuccesfulCallback();
break;
default:
break;
}
}