eCAN: CPU Access to the eCAN Registers may Fail if it is in Conflict With an eCAN
Access to the eCAN Registers
Revision(s) Affected
0, A, B,
C, D, E, F and G
Details
If contention exists between the CPU
and the eCAN controller for access to certain eCAN register areas, a CPU read may
erroneously read all zeros (0x00000000), and a CPU write may erroneously fail to
execute. Specifically:
- Case 1: If the CPU
reads the eCAN mailbox RAM area (MSGID, MSGCTRL, MDL, or MDH registers) at
the same time that the eCAN controller is accessing (reading or writing) the
LAM/MOTO/MOTS register area, the CPU may erroneously read all zeros
(0x00000000).
- Case 2: If the CPU
writes to the eCAN mailbox RAM area (MSGID, MSGCTRL, MDL, or MDH register)
at the same time that the eCAN controller is accessing (reading or writing)
the LAM/MOTO/MOTS register area, the CPU write may fail to execute.
- Case 3: If the CPU
reads the LAM/MOTO/MOTS register area at the same time that the eCAN
controller is accessing (reading or writing) the eCAN mailbox RAM area
(MSGID, MSGCTRL, MDL, or MDH registers), the CPU may erroneously read all
zeros (0x00000000).
- Case 4: If the CPU
writes to the LAM/MOTO/MOTS register area at the same time that the eCAN
controller is accessing (reading or writing) the eCAN mailbox RAM area
(MSGID, MSGCTRL, MDL, or MDH registers), the CPU write may fail to
execute.
Workaround(s)
Workarounds for each of the four cases
are as follows:
- Case 1: For all CPU
reads from the eCAN mailbox RAM area, check to see if the read returns all
zeros. If so, the CPU should perform a second read. If the second read
returns zero as well, then the data is correctly zero. If the second read
returns a non-zero value, then the second data is the correct value. Note
that interrupts must be disabled during the consecutive CPU reads. See NOTE 5.
- Case 2: For all CPU
writes to the eCAN mailbox RAM area, the CPU should write the data twice.
Note that interrupts must be disabled during the consecutive CPU writes. See
NOTE 5.
- Case 3: For all CPU
reads from the LAM/MOTO/MOTS register area, check to see if the read returns
all zeros. If so, the CPU should perform a second read. If the second read
returns zero as well, then the data is correctly zero. If the second read
returns a non-zero value, then the second data is the correct value. Note
that interrupts must be disabled during the consecutive CPU reads. See NOTE 5.
- Case 4: For all CPU
writes to the LAM/MOTO/MOTS register area, the CPU should write the data
twice with a minimum of 4 CPU cycles in between the writes. Note that
interrupts must be disabled during the consecutive CPU writes. See NOTE 5.
Note:
- An example of the eCAN controller reading the LAM/MOTO/MOTS
register area is a read of the LAMn register to check if a received message
passes the acceptance mask filtering criterion. This happens during
reception of a frame.
- An example of the eCAN controller writing to the
LAM/MOTO/MOTS register area is a write to the MOTSn register to update the
timestamp upon successful transmission of a frame.
- An example for the eCAN controller attempting to read the
mailbox RAM area (MSGID, MSGCTRL, MDL, and MDH registers) is right before
transmission.
- An example for the eCAN controller attempting to write to
the mailbox RAM area (MSGID, MSGCTRL, MDL, and MDH registers) is right after
reception.
- A C callable
assembly
implementation of the workaround can be downloaded from the TI Website.