Using an S32K148, what happens when the FlexCAN MCR->FDEN (flexible datarate enable) bit is not set, and the MCU receives a FD frame with DLC > 8? We've installed our device, containing this MCU, in many vehicles, and we're seeing failures with one specific very-recent vehicle model. Using SDK 4.0.1, our code is crashing in flexcan_hw_access.c around line 1616, in FLEXCAN_ReadRxFifo(). One of these two lines
mbWord = flexcan_mb_data_32[databyte >> 2U];
FlexcanSwapBytesInWord(mbWord, msgData_32[databyte >> 2U]);
seems to be causing the MCU to crash when a frame arrives with a data length greater than 8, since we're only supplying an 8-byte buffer. When FDEN is disabled, why does the MCU still receive frames with a data length code greater than 8? What's the correct workaround here - do I need to pass a larger buffer when I start the read, or will this still crash because I'm using the Rx FIFO which only has space for 8 bytes of data?