GD32A50x User Manual
616
register will be set.
The writing of ABORT (0b1001) to the mailbox MDES0 word is blocked when shift-out of the
mailbox is already finished, or when the mailbox is being transmitted. In this situation, the
abort request is captured and kept pending until the frame is transmitted successfully or failed:
The frame is transmitted successfully, the mailbox is not aborted: If the frame is
transmitted successfully, the pending abort request will be cleared automatically, the
corresponding MSx bit in CAN_STAT register will be set, and an interrupt will occur when
MIEx bit in CAN_INTEN register is set.
The frame is transmitted failed, the mailbox is aborted: If the frame failed to be
transmitted, the pending abort request is responsed, the write access to the mailbox is
recoverd, with ABORT code written to the mailbox MDES0 word, the corresponding MSx
bit in CAN_STAT register will be set, and an interrupt will occur when MIEx bit in
CAN_INTEN register is set.
When matching one of the following situations, the frame failed to be transmitted:
-
Lose the bus arbitration.
-
There is an error during the transmission.
-
Enter Bus Off state.
-
There is an overload frame.
Tx mailbox inactivation
The way to inactivate a Tx mailbox:
Write the CODE field of the Tx mailbox MDES0 with ABORT. This is the recommended
way for inactivation, which will not cause the unknown transmission.
This operation must be done when MST bit in the CAN_CTL0 register is 1.
23.3.6.
Data reception
For Classical CAN frames, reception through FIFO and mailbox are both supported.
For CAN FD frames, reception is only supported through mailbox.
Mailbox reception
For mailbox reception, a received frame will be stored into the mailbox only when the frame
ID matches the mailbox ID programmed in the ID field (or the mailbox ID group when the filter
registers are applied).
To receive a CAN frame into a mailbox, a mailbox must be prepared for reception in following
steps:
1.
If the mailbox is active (either Tx or Rx), inactivate the mailbox by method described in
, when Tx mailbox inactivation is
performed, do the following steps, when Rx mailbox inactivation is performed, go to step
4. While if the mailbox is inactive (either Tx or Rx), go to step 4.