2021-11-03 02:56 AM
I need to use FDCAN to send CAN messages. Since I want to receive each message (without filters) I do this :
sFilterConfig.IdType = FDCAN_STANDARD_ID;
sFilterConfig.FilterIndex = 0;
sFilterConfig.FilterType = FDCAN_FILTER_DUAL;
sFilterConfig.FilterConfig = FDCAN_FILTER_DISABLE;
sFilterConfig.FilterID1 = 0;
sFilterConfig.FilterID2 = 0;
if (HAL_FDCAN_ConfigFilter(&hfdcan1, &sFilterConfig) != HAL_OK)
{
return CO_ERROR_HAL;
}
else
{
// nothing to do
}
if (HAL_FDCAN_ConfigGlobalFilter(&hfdcan1, FDCAN_ACCEPT_IN_RX_FIFO0, FDCAN_ACCEPT_IN_RX_FIFO0, FDCAN_FILTER_REMOTE, FDCAN_FILTER_REMOTE) != HAL_OK)
{
return CO_ERROR_HAL;
}
else
{
// nothing to do
}
Next, I want to activate callback for every new messages, so I do this:
HAL_FDCAN_ActivateNotification(&hfdcan1, FDCAN_IT_RX_FIFO0_NEW_MESSAGE |FDCAN_IT_RX_FIFO1_NEW_MESSAGE, 0)
But when there is a new message neither HAL_FDCAN_RxFifo0Callback nor HAL_FDCAN_RxFifo1Callback is called.
So my answer is: how can I activate callback ?
EDIT : It works, my mistake was elsewhere
Solved! Go to Solution.
2021-11-08 12:49 AM
Hello :)
It works, with this configuration I can send and receive CAN messages, with callback.
2021-11-05 05:39 AM
Hello @CSou.1 and welcome to the Community :)
Please share your solution here, so that more Community members can benefit from this post.
Thanks
Imen
2021-11-08 12:49 AM
Hello :)
It works, with this configuration I can send and receive CAN messages, with callback.