GD32A50x User Manual
619
if there are more than one messages in the Rx FIFO, the act of reading FDES3 word
will update the Rx FIFO FDES0-FDES3 words with the next message, and
CAN_RFIFOIFMN register (should be read before FDES3) will be updated at the
same time, the flag MS5_RFNE remains set, and a DMA request is generated again.
Steps 4 and 5 are repeated.
DMA mode
DMA mode is supported for Rx FIFO reception when RFEN bit and DMAEN bit in CAN_CTL0
register are both set. When the DMA mode is enabled, the CPU must not read the Rx FIFO.
When DMA mode is enabled, Rx FIFO FDES0 to FDES3 words will be read by DMA controller
when there is unread message in Rx FIFO, to get the received message. In this mode, Rx
FIFO warning flag MS6_RFW bit and Rx FIFO overflow flag MS7_RFO bit in CAN_STAT
register are reserved.
Before disabling DMA mode by clearing DMAEN bit in CAN_CTL0 register, a clear FIFO
operation (when RFEN bit in CAN_CTL0 register is 1, set MS0 in the CAN_STAT register to
1 in Inactive mode) must be performed to clear the Rx FIFO contents. The act of clearing
FIFO will clear MS5_RFNE bit in the CAN_STAT register, and cancel the DMA request.
Clear FIFO
when Rx FIFO is enabled (RFEN bit in CAN_CTL0 register is 1), set MS0 bit in the
CAN_STAT register to 1 in Inactive mode will clear the Rx FIFO contents, while the Rx FIFO
flags will not be cleared (except in DMA mode), thus before clearing FIFO operation, the Rx
FIFO must be serviced until the flag MS5_RFNE in the CAN_STAT register is cleared.
Flag
Rx FIFO not empty
When MS5_RFNE bit in CAN_STAT register is 1, it means there is at least one frame
available to be read from Rx FIFO.
Rx FIFO warning
When MS6_RFW bit in CAN_STAT register is 1, it means the number of unread messages
within the Rx FIFO is increased to five from four due to the reception of a new one, the Rx
FIFO is almost full.
Rx FIFO overflow
When MS7_RFO bit in CAN_STAT register is 1, it means there is an incoming message lost
because the Rx FIFO is full.
Matching process
The matching process is searching for a Rx mailbox or Rx FIFO (when enabled) with an ID
matching with the frame ID on CAN bus, also, the IDE and RTR field will participate in the