
FlexCAN Module
MPC5644A Microcontroller Reference Manual, Rev. 6
1428
Freescale Semiconductor
32.5.6.3
Message buffer lock mechanism
Besides message buffer deactivation, FlexCAN has another data coherence mechanism for the receive
process. When the CPU reads the Control and Status word of an “active not empty” Rx message buffer,
FlexCAN assumes that the CPU wants to read the whole message buffer in an atomic operation, and thus
it sets an internal lock flag for that message buffer. The lock is released when the CPU reads the Free
Running Timer (global unlock operation), or when it reads the Control and Status word of another message
buffer. The message buffer locking is done to prevent a new frame to be written into the message buffer
while the CPU is reading it.
NOTE
The locking mechanism only applies to Rx message buffers which have a
code different than INACTIVE (‘0000’) or EMPTY
1
(‘0100’). Also, Tx
message buffers can not be locked.
Suppose, for example, that the FIFO is disabled and the second and the fifth message buffers of the array
are programmed with the same ID, and FlexCAN has already received and stored messages into these two
message buffers. Suppose now that the CPU decides to read MB number 5 and at the same time another
message with the same ID is arriving. When the CPU reads the Control and Status word of MB number 5,
this MB is locked. The new message arrives and the matching algorithm finds out that there are no “free
to receive” message buffers, so it decides to override MB number 5. However, this message buffer is
locked, so the new message can not be written there. It will remain in the SMB waiting for the message
buffer to be unlocked, and only then will be written to the message buffer. If the message buffer is not
unlocked in time and yet another new message with the same ID arrives, then the new message overwrites
the one on the SMB and there will be no indication of lost messages either in the Code field of the message
buffer or in the Error and Status Register.
While the message is being moved-in from the SMB to the message buffer, the BUSY bit on the Code field
is asserted. If the CPU reads the Control and Status word and finds out that the BUSY bit is set, it should
defer accessing the message buffer until the BUSY bit is negated.
NOTE
If the BUSY bit is asserted or if the message buffer is empty, then reading
the Control and Status word does not lock the message buffer.
Deactivation takes precedence over locking. If the CPU deactivates a locked Rx message buffer, then its
lock status is negated and the message buffer is marked as invalid for the current matching round. Any
pending message on the SMB will not be transferred anymore to the message buffer.
32.5.7
Rx FIFO
The receive-only FIFO is enabled by asserting MCR[FEN]. The reset value of this bit is zero to maintain
software backwards compatibility with previous versions of the module that did not have the FIFO feature.
When the FIFO is enabled, the memory region normally occupied by the first eight message buffers
(0x80–0xFF) is now reserved for use of the FIFO engine (see
Section 32.4.4, Rx FIFO structure
Management of read and write pointers is done internally by the FIFO engine. The CPU can read the
1. In previous FlexCAN versions, reading the C/S word locked the message buffer even if it was EMPTY. In current FlexCAN
versions, this behavior is maintained when the MBFEN bit is negated.
Содержание MPC5644A
Страница 2: ...MPC5644A Microcontroller Reference Manual Rev 6 2 Freescale Semiconductor...
Страница 24: ...MPC5644A Microcontroller Reference Manual Rev 6 24 Freescale Semiconductor...
Страница 26: ...MPC5644A Microcontroller Reference Manual Rev 6 26 Freescale Semiconductor...
Страница 52: ...Introduction MPC5644A Microcontroller Reference Manual Rev 6 52 Freescale Semiconductor...
Страница 56: ...Memory Map MPC5644A Microcontroller Reference Manual Rev 6 56 Freescale Semiconductor...
Страница 130: ...Device Performance Optimization MPC5644A Microcontroller Reference Manual Rev 6 130 Freescale Semiconductor...
Страница 204: ...Multi Layer AHB Crossbar Switch XBAR MPC5644A Microcontroller Reference Manual Rev 6 204 Freescale Semiconductor...
Страница 212: ...Peripheral Bridge PBRIDGE MPC5644A Microcontroller Reference Manual Rev 6 212 Freescale Semiconductor...
Страница 558: ...System Integration Unit SIU MPC5644A Microcontroller Reference Manual Rev 6 558 Freescale Semiconductor...
Страница 582: ...Frequency modulated phase locked loop FMPLL MPC5644A Microcontroller Reference Manual Rev 6 582 Freescale Semiconductor...
Страница 766: ...Enhanced Time Processing Unit eTPU2 MPC5644A Microcontroller Reference Manual Rev 6 766 Freescale Semiconductor...
Страница 1228: ...Decimation Filter MPC5644A Microcontroller Reference Manual Rev 6 1228 Freescale Semiconductor...
Страница 1236: ...System Information Module and Trim SIM MPC5644A Microcontroller Reference Manual Rev 6 1236 Freescale Semiconductor...
Страница 1250: ...Cyclic Redundancy Checker CRC Unit MPC5644A Microcontroller Reference Manual Rev 6 1250 Freescale Semiconductor...
Страница 1336: ...Deserial Serial Peripheral Interface DSPI MPC5644A Microcontroller Reference Manual Rev 6 1336 Freescale Semiconductor...
Страница 1388: ...Enhanced Serial Communication Interface ESCI MPC5644A Microcontroller Reference Manual Rev 6 1388 Freescale Semiconductor...
Страница 1440: ...FlexCAN Module MPC5644A Microcontroller Reference Manual Rev 6 1440 Freescale Semiconductor...
Страница 1624: ...FlexRay Communication Controller FlexRay MPC5644A Microcontroller Reference Manual Rev 6 1624 Freescale Semiconductor...
Страница 1670: ...JTAG Controller JTAGC MPC5644A Microcontroller Reference Manual Rev 6 1670 Freescale Semiconductor...
Страница 1692: ...Nexus Port Controller NPC MPC5644A Microcontroller Reference Manual Rev 6 1692 Freescale Semiconductor...
Страница 1701: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 Freescale Semiconductor 1701...
Страница 1702: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 1702 Freescale Semiconductor...