Stuck in initialisation of FlexCAN

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Stuck in initialisation of FlexCAN

885 次查看
v_michel
Contributor III

Hello,

i have a problem with the MIMXRT1021 flexCAN. When I add in the peripheral drivers the flexCAN driver and update the Code, the programm stucks in the initialisation of the CAN "BOARD_InitBootPeripherals();". In peripherals.c it stucks at "FLEXCAN_SetRxMbConfig(CAN1_PERIPHERAL, 0, &CAN1_rx_mb_config_0, true);". In fsl_flexcan.c the function "FLEXCAN_IsMbOccupied" is called and there it stucks at the "return fgRet;" line.

Does anyone know where is my fault?

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

828 次查看
v_michel
Contributor III

The problem has been solved. The Message buffer ID shouldn't be "0" as it is setted in the default and before the Peripherals are initiated the Clock has to be setted correctly.

BOARD_InitBootPins();
BOARD_InitBootClocks();

CLOCK_SetMux(kCLOCK_CanMux, 0U);
CLOCK_SetDiv(kCLOCK_CanDiv, 2U);

BOARD_InitBootPeripherals();

0 项奖励
回复