cancel
Showing results for 
Search instead for 
Did you mean: 

CanRx no callback

bartocham
Associate II
Posted on March 14, 2016 at 11:26

Hi,

I wrote about in other topic but it was not clear so I took decision to start other topic. I'm working with CAN of F103 with CubeMX configuration. Transmiting works fine but I have problem with receive. Before while loop in user code I copied part from CubeF1 example package:

/*##-2- Start the Reception process and enable reception interrupt #########*/
if (HAL_CAN_Receive_IT(&hcan, CAN_FIFO0) != HAL_OK)
{
/* Reception Error */
Error_Handler();
}

It shall enable interrupt but I'm not getting any callback... I have to call it manualy like this:

/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
HAL_CAN_Transmit(&hcan, 10);
if(HAL_CAN_Receive(&hcan, CAN_FIFO0,10) == HAL_OK)
{
HAL_CAN_RxCpltCallback(&hcan);
}
HAL_Delay(10);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}

In that way it's working on loopback mode. Any idea why do I have to do it that way?
10 REPLIES 10
Posted on March 26, 2016 at 17:59

No one have similar problem ?

There are not that many people here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..