cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Communication in stm32f407 discovery board

rohitkumarkv07
Associate III

Hello,

I am trying to send the message from USB-CAN Aanlyzer and want to read that message in STM32F407 discovery board in interrupt mode. My RxFIFO0 buffer got updated and FMP gets filled with messages and Overrun occur but  RFOM register not able to release the messages so that i can read that messages in my rx_data.

Below is pendingcallback function and IRQHandler.

 

void CAN1_TXIRQHandler(void)
{
  HAL_CAN_IRQHandler(&hcan1);
}
void CAN1_RX0IRQHandler(void)
{
  HAL_CAN_IRQHandler(&hcan1);
}
void CAN1_RX1IRQHandler(void)
{
  HAL_CAN_IRQHandler(&hcan1);
}
void CAN1_SCEIRQHandler(void)
{
  HAL_CAN_IRQHandler(&hcan1);
}
void WWDG_APPIRQHandler(void)
{

}

void CANRxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
{
	CAN_RxHeaderTypeDef rx_header;
	uint8_t rx_data[8];

	if (HAL_CAN_GetRxMessage(&hcan1, CAN_RX_FIFO0, &rx_header, rx_data) != HAL_OK)
	{
		Error_Handler();
	}

	/*// Process received message
	if (rx_header.StdId == 0x123)
	{
		HAL_GPIO_TogglePin(LD4_GPIO_Port, LD4_Pin|LD3_Pin|LD5_Pin);
		HAL_Delay(1000); // Example delay before next reception/transmission

	}*/
}

 

Below I have attach the images of USB-CAN Analyzer in which I am sending data to the board and what update I got in RXFIFO buffer.

 

B.R

Rohit

0 REPLIES 0