FlexCAN ModuleMCF5253 Reference Manual, Rev. 1Freescale Semiconductor 25-25The purpose of deactivation is data coherency. The match/arbitration process scans the MBs to decidewhich MB to transmit or receive. If the CPU updates the MB in the middle of a match or arbitrationprocess, the data of that MB may no longer be coherent; therefore, that MB is deactivated.Even with the coherence mechanism described above, writing to the C/S word of active MBs when not infreeze mode may produce undesirable results. Examples are:• Matching and arbitration are one-pass processes. If MBs are deactivated after they are scanned, nore-evaluation is done to determine a new match/winner. If an Rx MB with a matching ID isdeactivated during the matching process after it was scanned, then this MB is marked as invalid toreceive the frame, and FlexCAN will keep looking for another matching MB within the ones it hasnot scanned yet. If it can not find one, then the message will be lost. Suppose, for example, that twoMBs have a matching ID to a received frame, and the user deactivated the first matching MB afterFlexCAN has scanned the second. The received frame will be lost even if the second matching MBwas free to receive.• If a Tx MB containing the lowest ID is deactivated after the FlexCAN has scanned it, then theFlexCAN will look for another winner within the MBs that it has not yet scanned. Therefore, it maytransmit an MB that may not have the lowest ID at the time because a lower ID might be presentthat it had already scanned before the deactivation.• There is a point in time until which the deactivation of a Tx MB causes it not to be transmitted (endof move-out). After this point, it is transmitted, but no interrupt is issued and the CODE field is notupdated.25.6.5.3 Locking and Releasing Message BuffersBesides message buffer deactivation, the lock/release/busy mechanism is designed to guarantee datacoherency during the receive process. The following examples demonstrate how the lock/release/busymechanism will affect FlexCAN operation:1. Reading a control/status word of a message buffer triggers a lock for that message buffer. A newreceived message frame that matches the message buffer cannot be written into this message bufferwhile it is locked.2. To release a locked message buffer, the CPU either locks another message buffer (by reading itscontrol/status word) or globally releases any locked message buffer (by reading the free-runningtimer).3. If a receive frame with a matching ID is received during the time the message buffer is locked, thereceive frame will not be immediately transferred into that message buffer, but will remain in theSMB. There is no indication when this occurs.4. When a locked message buffer is released, if a frame with a matching identifier exists within theSMB, then this frame will be transferred to the matching message buffer.5. If two or more receive frames with matching IDs are received while a message buffer with amatching ID is locked, the last received frame with that ID is kept within the serial message buffer,while all preceding ones are lost. There is no indication of lost messages when this occurs.