50.8.3.1.1 Simple Receive Mailbox

A mailbox is in Receive mode once the CAN_MMRx.MOT field has been configured. Message ID and Message Acceptance Mask must be set before the Receive mode is enabled.

After Receive mode is enabled, the MRDY flag in CAN_MSR is automatically cleared until the first message is received. When the first message has been accepted by the mailbox, the MRDY flag is set. An interrupt is pending for the mailbox while the MRDY flag is set. This interrupt can be masked depending on the mailbox flag in the CAN_IMR global register.

Message data are stored in the mailbox data register until the software application notifies that data processing has ended. This is done by asking for a new transfer command, setting the MTCR flag in CAN_MCRx. This automatically clears the MRDY signal.

The MMI flag in CAN_MSRx notifies the software that a message has been lost by the mailbox. This flag is set when messages are received while CAN_MSRx.MRDY is set. This flag is cleared by reading CAN_MSRx. A receive mailbox prevents from overwriting the first message by new ones while MRDY flag is set in CAN_MSRx. See the figure below.

Figure 50-11. Receive Mailbox
Note: In the case of Arm architecture, CAN_MSRx, CAN_MDLx, CAN_MDHx can be read using an optimized ldm assembler instruction.