cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN2 Rx callback doesn't work STM32H753

julred
Associate II

Dear all,

I'm struggeling to get FDCAN2 working on my board. I also use FDCAN1 - which is working pretty good.
For FDCAN1 I selected the RxFifo0 and for FDCAN2 I selected RxFifo1.

But for some reasons, I dont get the callback for HAL_FDCAN_RxFifo1Callback().

Thats part of my own code, where I used the _weak function HAL_FDCAN_RxFifo1Callback(

 

 

// CAN 2 receive interrupt callback
void HAL_FDCAN_RxFifo1Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo1ITs)
{

//....

// the incoming message will be used for further scenarios

//...

}

 

I can also see that the interrupt function will not be called for FDCAN2 if I put a breakpoint into this section (FDCAN1 is working as mentioned)

 

void FDCAN2_IT1_IRQHandler(void)
{
  /* USER CODE BEGIN FDCAN2_IT1_IRQn 0 */

  /* USER CODE END FDCAN2_IT1_IRQn 0 */
  HAL_FDCAN_IRQHandler(&hfdcan2);
  /* USER CODE BEGIN FDCAN2_IT1_IRQn 1 */

  /* USER CODE END FDCAN2_IT1_IRQn 1 */
}

 

I also added my .ioc file - much appreciate if you can have a look into this, due I'm running out of ideas how to go ahead.

2 REPLIES 2
SofLit
ST Employee

Hello,

It could be many reasons: interrupt not enabled, Filter not configured correctly, not the correct Rx pin used.. etc ..

I invite you to inspire from this example: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Examples/FDCAN/FDCAN_Com_IT

But first, try loopback mode: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Examples/FDCAN/FDCAN_Loopback

Hope it helps.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

If I configure FDCAN on RxFifo0, then everything is working. So pinsetting etc. is fine.

I will check-out your posted links. Do you have time to investigate into attached ioc file?