50.8.3.3.2 Consumer Configuration

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

After Consumer mode is enabled, the MRDY flag in CAN_MSR is automatically cleared until the first transfer request command. The software application sends a remote frame by setting the CAN_MCRx.MTCR bit or the bit MBx in the global register CAN_TCR. The application is notified of the answer by the MRDY flag set in CAN_MSRx. The application can read the data contents in CAN_MDHx and CAN_MDLx. An interrupt is pending for the mailbox while the MRDY flag is set. This interrupt can be masked according to the mailbox flag in the CAN_IMR global register.

The CAN_MCRx.MRTR bit has no effect. This field is used only when using Transmit mode.

After a remote frame has been sent, the consumer mailbox functions as a reception mailbox. The first message received is stored in the mailbox data registers. If other messages intended for this mailbox have been sent while the MRDY flag is set in CAN_MSRx, they will be lost. The application is notified by reading the CAN_MSRx.MMI bit. The read operation automatically clears the MMI flag.

If several messages are answered by the Producer, the CAN controller may have one mailbox in consumer configuration, zero or several mailboxes in Receive mode and one mailbox in Receive with Overwrite mode. In this case, the consumer mailbox must have a lower number than the Receive with Overwrite mailbox. The transfer command can be triggered for all mailboxes at the same time by setting several CAN_TCR.MBx fields.

Figure 50-18. Consumer Handling