2017-12-08 03:32 AM
void MXCAN1Init(void)
{
__HAL_RCC_CAN1_CLK_ENABLE();
stat_stCAN_HandleTypeDefHCan1.Instance = CAN1;
//stat_stCAN_HandleTypeDefHCan1.Init.Prescaler = (U16)((U32)HAL_RCC_GetPCLK1Freq() /
// (16U * CAN_BAUD_RATE_BPS));
stat_stCAN_HandleTypeDefHCan1.Init.Prescaler = 16;
stat_stCAN_HandleTypeDefHCan1.Init.Mode = CAN_MODE_NORMAL;
stat_stCAN_HandleTypeDefHCan1.Init.SJW = CAN_SJW_1TQ;
//stat_stCAN_HandleTypeDefHCan1.Init.BS1 = CAN_BS1_8TQ;
stat_stCAN_HandleTypeDefHCan1.Init.BS1 = CAN_BS1_6TQ;
//stat_stCAN_HandleTypeDefHCan1.Init.BS2 = CAN_BS2_7TQ;
stat_stCAN_HandleTypeDefHCan1.Init.BS2 = CAN_BS2_8TQ;
stat_stCAN_HandleTypeDefHCan1.Init.TTCM = (U32)DISABLE;
stat_stCAN_HandleTypeDefHCan1.Init.ABOM = (U32)DISABLE;
stat_stCAN_HandleTypeDefHCan1.Init.AWUM = (U32)DISABLE;
stat_stCAN_HandleTypeDefHCan1.Init.NART = (U32)DISABLE;
stat_stCAN_HandleTypeDefHCan1.Init.RFLM = (U32)DISABLE;
stat_stCAN_HandleTypeDefHCan1.Init.TXFP = (U32)DISABLE;
if (HAL_CAN_Init(&stat_stCAN_HandleTypeDefHCan1) != HAL_OK)
{
ErrorHandler();
}
}
2017-12-11 04:52 AM
Hello,
You are not providing many details about your issue.
Can you clarify more your problem?
Best Regards
Imen
2017-12-14 05:37 AM
The code is entering the while loop and getting stuck there in stm32f4xx_hal_can.c file....the image for the same is provided below