AnsweredAssumed Answered

Having two independent CAN channels in stm32f746discovery

Question asked by Anjana R on Jun 22, 2017
Latest reply on Nov 7, 2017 by Mark Bolan

Hello all,

I am working on two stm32f746discovery boards. I an trying to establish CAN communication between both the controllers. As far as i know stm32f746discovery has two CAN channels. I want both channels to be active at the same time and working independently. 

I am able to communicate via CAN1 without any problem. But when i try with CAN2, it gets stuck inside this loop in HAL_CAN_Init at this place,

 

/* 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;
}
}

I have a CAN driver that does all the hardware initialization and also calls the HAL_CAN_Init. Has anyone tried to work with CAN2 channel on stm32f746discovery. 

Please help.

 

Outcomes