I'm trying to work with the flexcan module of my mk22 using the MCUxpresso drivers provided by nxp, but when I try to initialize the flexcan it gets stuck on the following while:
static inline void FLEXCAN_Enable(CAN_Type *base, bool enable)
base->MCR &= ~CAN_MCR_MDIS_MASK;
/* Wait FlexCAN exit from low-power mode. */
while (base->MCR & CAN_MCR_LPMACK_MASK)
When enabling CAN, it waits until the lowpowermodule is off, but this bit is never 0. How could that be?
I had CAN working on the KDS so i went to check in there if the driver checks that bit, but it doesn't, enabling can on the kds driver just changes MDIS bit without waiting the lpm to set off.
My mcuxpresso initialization is the following:
FLEXCAN_Init(FLEXCAN0, &flexcanConfig, 8000000UL);