HI
If the CAN message ID set to FIFO0 is received, HAL_CAN_RxFifo0MsgPendingCallback will be called correctly.
but,
HAL_CAN_RxFifo1MsgPendingCallback is not called even if the CAN message ID set in FIFO1 is received.
The following is strange.
step1
Send CAN message set in FIFO1 from CANoe
step2
HAL_CAN_RxFifo1MsgPendingCallback is not called.
step3
Send CAN message set in FIFO0 from CANoe
step4
HAL_CAN_RxFifo0MsgPendingCallback is called.
After this, HAL_CAN_RxFifo1MsgPendingCallback is called! !
The data received in FIFO1 is from FIFO1 and is correct.
Below is the code.
Any help is welcome.
#define FILTER_ID(id) ((id << 5) | (REMOTE_FRAME << 4))
HAL_CAN_DeactivateNotification( &hcan, CAN_IT_RX_FIFO0_MSG_PENDING );
HAL_CAN_DeactivateNotification( &hcan, CAN_IT_RX_FIFO1_MSG_PENDING );
HAL_CAN_Stop( &hcan );
/* FilterBank0 */
sFilterConfig.FilterBank = 0; /* FilterBank0 */
sFilterConfig.FilterMode = CAN_FILTERMODE_IDLIST; /* ID LIST */
sFilterConfig.FilterScale = CAN_FILTERSCALE_16BIT; /* 16bit */
sFilterConfig.FilterIdLow = FILTER_ID(0x000007E8UL); /* ID Filter Num 0 */
sFilterConfig.FilterMaskIdLow = FILTER_ID(0x00000514UL); /* ID Filter Num 1 */
sFilterConfig.FilterIdHigh = FILTER_ID(0x00000766UL); /* ID Filter Num 2 */
sFilterConfig.FilterMaskIdHigh = FILTER_ID(0x00000766UL); /* ID Filter Num 3 (dummy) */
sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0; /* FIFO0 */
sFilterConfig.FilterActivation = CAN_FILTER_ENABLE;
sFilterConfig.SlaveStartFilterBank = 0; /* */
(void)HAL_CAN_ConfigFilter( &hcan, &sFilterConfig );
/* FilterBank1 */
sFilterConfig.FilterBank = 1; /* FilterBank1 */
sFilterConfig.FilterMode = CAN_FILTERMODE_IDLIST; /* ID LIST */
sFilterConfig.FilterScale = CAN_FILTERSCALE_16BIT; /* 16bit */
sFilterConfig.FilterIdLow = FILTER_ID(0x00000511UL); /* ID Filter Num 0 */
sFilterConfig.FilterMaskIdLow = FILTER_ID(0x00000762UL); /* ID Filter Num 1 */
sFilterConfig.FilterIdHigh = FILTER_ID(0x00000511UL); /* ID Filter Num 2 (dummy) */
sFilterConfig.FilterMaskIdHigh = FILTER_ID(0x00000511UL); /* ID Filter Num 3 (dummy) */
sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO1; /* FIFO1 */
sFilterConfig.FilterActivation = CAN_FILTER_ENABLE;
sFilterConfig.SlaveStartFilterBank = 0; /* */
(void)HAL_CAN_ConfigFilter( &hcan, &sFilterConfig );
/* FilterBank2~13 */
for ( i = 2; i < BXCAN_FILTERBANK_NUM; i++ ) {
sFilterConfig.FilterBank = i; /* FilterBanki(i=2~13) */
sFilterConfig.FilterMode = CAN_FILTERMODE_IDLIST; /* ID LIST */
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT; /* 32bit */
sFilterConfig.FilterIdHigh = 0x00000000UL;
sFilterConfig.FilterIdLow = 0x00000000UL;
sFilterConfig.FilterMaskIdHigh = 0x00000000UL;
sFilterConfig.FilterMaskIdLow = 0x00000000UL;
sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0; /* FIFO0 */
sFilterConfig.FilterActivation = CAN_FILTER_DISABLE;
sFilterConfig.SlaveStartFilterBank = 0; /* */
(void)HAL_CAN_ConfigFilter( &hcan, &sFilterConfig );
}
HAL_CAN_ActivateNotification( &hcan, CAN_IT_RX_FIFO0_MSG_PENDING );
HAL_CAN_ActivateNotification( &hcan, CAN_IT_RX_FIFO1_MSG_PENDING );
HAL_CAN_Start( &hcan );