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?
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();