2018-04-21 04:33 PM
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?
Solved! Go to Solution.
2018-04-21 05:53 PM
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.
2018-04-21 05:53 PM
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.
2018-04-22 03:26 AM
and you guess correctly! I understood the opposite and I add a pulldown in both pins
now I can transmit, Thanks!