AnsweredAssumed Answered

F091 can bus

Question asked by Alejandro Bizzotto on Apr 22, 2018
Latest reply on Apr 22, 2018 by Alejandro Bizzotto

hi!

 

I'm trying to play a bit with the CAN bus in the NucleoF091RC, I just generate the code with CubeMX with the CAN_Mode set to Loopback (to use only one node and my scope to see the data), dropped that code in Eclipse and tried to debug it. The debug never passes the MX_CAN_Init(); instruction. If I go a bit deep it stays forever on the loop:

/* Wait the acknowledge */
    while(HAL_IS_BIT_SET(hcan->Instance->MSR, CAN_MSR_INAK))
    {
      if((HAL_GetTick()-tickstart) > CAN_TIMEOUT_VALUE)
      {
         hcan->State= HAL_CAN_STATE_TIMEOUT;

 

       /* Process unlocked */
       __HAL_UNLOCK(hcan);

 

       return HAL_TIMEOUT;
      }
    }

In the RM is said the normal mode can be activated once the device it synchronized with the bus, but in loopback mode: can I skip the need of the bus?

Outcomes