Hi Sandrine,
Flags are set in following way when FIFO is enabled. The 8 least significant interrupt flags (BUF7I–BUF0I) is changed to support the FIFO operation. BUF7I, BUF6I and BUF5I indicate operating conditions of the FIFO, while BUF4I to BUF0I are not used. In details
- BUF5I - Frames available in FIFO. Once set you should read the MB0
- BUF6I - FIFO Warning. 5 frames have accumulated in the FIFO.
- BUF7I - FIFO Overflow. The FIFO is full and subsequent frames are not accepted until the CPU creates space in the FIFO by reading one or more frames (using MB0 still !!!). While the FIFO is full, the frames are only received if they are matched with another MBs.
So to enable RX FIFO interrupt you need to set corresponding bit in the IMASK1 register…
CAN_0.IMASK1.R = 0x00000020; // enable BUF05I interrupt
See attached code I tested on the TRK-MPC5606B board. It does communication between CAN1 and CAN0. CAN0 is used to receive the message and RXFIFO is enabled and ISR is called when message is received. You can reuse the code as FlexCAN modules are similar.
BR, Petr