Stuck in initialisation of FlexCAN

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stuck in initialisation of FlexCAN

610 Views
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?

Labels (1)
Tags (2)
0 Kudos
1 Reply

553 Views
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 Kudos