The problem in CAN Receive using Interrupt. As code hangs in (HAL_CAN_RxFifo0MsgPendingCallback) function in STM32F103C8T6.
Hi,
I am working on CAN on STM32F103C8T6.
I am using a Callback Function of (HAL_CAN_RxFifo0MsgPendingCallback) but soon after receiving message code hangs in Callback Function even though no data sent afterwards it.
I am not getting the reason. Because this function works fine on CORTEX-M4 pocessor.
However, Transmit_Interrupt is working fine. But receive interrupt is hanging.

Here, is the code Snippet.
Code is getting stuck in the receiver callback function (HAL_CAN_RxFifo0MsgPendingCallback).
/* INTERRUPT HANG IN RECEIVER ISR FUNCTION */
void HAL_CAN_RxFifo0MsgPendingCallback (CAN_HandleTypeDef *hcan) {
CAN_RxHeaderTypeDef RxHeader;
uint8_t rcvd_msg[5];
char msg[50];
if(HAL_CAN_GetRxMessage((CAN_HandleTypeDef*)&hcan,CAN_RX_FIFO0,&RxHeader,rcvd_msg) != HAL_OK)
{
Error_Handler();
}
sprintf(msg,"Message Received : %s\n",rcvd_msg);
HAL_UART_Transmit(&huart1,(uint8_t*)msg,strlen(msg),10);
}
Guys, please help.
Thanks,
Alankrit
