GD32F20x User Manual
751
Transmit mailbox state
A transmit mailbox can be used when it is free: empty state. If the data is filled in the mailbox,
setting TEN bit in CAN_TMIx register to prepare for starting the transmission: pending state.
If more than one mailbox is in the pending state, they need schedule the transmission:
scheduled state. A mailbox with priority enter transmit state and start transmitting the
message. After the message has been sent, the mailbox is free: empty state. As shown in
Figure 26-3. State of transmission mailbox
Figure 26-3. State of transmission mailbox
empty
pending
scheduled
transmit
Transmit status and error
The CAN_TSTAT register includes the transmit status and error bits: MTF, MTFNERR, MAL,
MTE.
MTF: mailbox transmits finished. Typically, MTF is set when the frame in the transmit
mailbox has been sent.
MTFNERR: mailbox transmits finished and no error. MTFNERR is set when the frame in
the transmission mailbox has been sent without any error.
MAL: mailbox arbitration lost. MAL is set while the frame transmission is failed because
of the arbitration lost.
MTE: mailbox transmits error. MTE is set while the frame transmission is failed because
of the detection error of CAN bus.
Steps of sending a frame
To send a frame through the CAN:
Step 1: Select one free transmit mailbox.
Step 2: Fill four transmission registers with the application
’s acquirement.
Step 3: Set TEN bit in CAN_TMIx register.
Step 4: Check the transmit status. Typically, MTF and MTFNERR are set if transmission is
successful.
Transmission options
Abort
MST bit in CAN_TSTAT register can abort the transmission.
If the transmission mailbox
’s state is pending or scheduled, the abort of transmission can be
done immediately.
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...