cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F072RB CAN Transmit Timeout Error

LRPS_92
Associate II

Hi,

I'm new to CAN communication and trying to up the CAN(normal mode) between two identical custom boards having stm32f072 controllers. Code generated using CubeMX (STM32Cube_FW_F0_V1.9.0) drivers.

I have given the setup diagram. TJA1050 RS pin is grounded & VREF is NC.

 0690X0000087uNlQAI.png

In main while(1) calling HAL_CAN_Transmit(&hcan, 100) gives timeout result (0x03) at both boards, from the following portion of code in stm32f0xx_hal_can.c

/* Check End of transmission flag */
    while(!(__HAL_CAN_TRANSMIT_STATUS(hcan, transmitmailbox)))
    {
      /* Check for the Timeout */
      if(Timeout != HAL_MAX_DELAY)
      {
        if((Timeout == 0U) || ((HAL_GetTick()-tickstart) > Timeout))
        {
          hcan->State = HAL_CAN_STATE_TIMEOUT;
 
          /* Cancel transmission */
          __HAL_CAN_CANCEL_TRANSMIT(hcan, transmitmailbox);
 
          /* Process unlocked */
          __HAL_UNLOCK(hcan);
          return HAL_TIMEOUT;
        }
      }
    }

What am i missing in my setup kindly anyone help me out on this one. Thanks in advance

0 REPLIES 0