AnsweredAssumed Answered

STM32FCubeMX CAN-Bus Initialisation fails

Question asked by Helmut on Jul 4, 2014
Latest reply on May 4, 2017 by Rathore.Ankit
Hi;

I am using STM32FCubeMX with its default configuration for the STRM32F4DISCOVERY board. I have enabled CAN1 master Mode (Loopback) and generated the Code for "MDK-ARM 4.73.
When i run the code the CAN initialisation fails in:

HAL_CAN_Init(CAN_HandleTypeDef* hcan); Line 298
.....
....
..
    /* Request leave initialisation */
    hcan->Instance->MCR &= ~(uint32_t)CAN_MCR_INRQ;

  /* Get tick */
  tickstart = HAL_GetTick();

   /* Wait the acknowledge */
   while((hcan->Instance->MSR & CAN_MSR_INAK) == CAN_MSR_INAK)
   {
    if((HAL_GetTick() - tickstart ) > CAN_TIMEOUT_VALUE)
     {
       hcan->State= HAL_CAN_STATE_TIMEOUT;
       /* Process unlocked */
       __HAL_UNLOCK(hcan);
       return HAL_TIMEOUT;   // ; Line 298

     }
   }
............
...........


the funtion returns always HAL_TIMEOUT.

What must i do to get the CAN-BUS Initialisation running?

Thanks



Outcomes