cancel
Showing results for 
Search instead for 
Did you mean: 

F091 can bus

Alejandro Bizzotto
Associate III
Posted on April 22, 2018 at 01:33

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?

1 ACCEPTED SOLUTION

Accepted Solutions
T J
Lead
Posted on April 22, 2018 at 02:53

it stops at Can Init

I guess 100% you don't have a line driver and therefore, you need a pullup on the Can Rx pin.

View solution in original post

2 REPLIES 2
T J
Lead
Posted on April 22, 2018 at 02:53

it stops at Can Init

I guess 100% you don't have a line driver and therefore, you need a pullup on the Can Rx pin.

Alejandro Bizzotto
Associate III
Posted on April 22, 2018 at 12:26

and you guess correctly! I understood the opposite and I add a pulldown in both pins

now I can transmit, Thanks!