Part Number: TMS320F280049C
Hi,
I'm working with the CAN peripheral and was confused by how to safely disable mailboxes before modifying them.
TRM (section 26.14) notes that:
“… there is one condition that can cause a write access to the message RAM to be lost. If MsgVal = 1 for the message object which is accessed and CAN communication is ongoing, a transfer from the IFx register to message RAM may be lost. The reason for this is that it might happen that the IFx register write to the message RAM occurs in between a read-modify-write access of the Host Message Handler when it is in the process of receiving a message for the same message object.
To avoid this issue with receive mail boxes, reset MsgVal before changing any of the following: Id28-0, Xtd, Dir, DLC3-0, RxIE, TxIE, RmtEn, EoB, Umask, Msk28-0, MXtd, and MDir.
To avoid this issue with transmit mail boxes, reset MsgVal before changing any of the following: Dir, RxIE, TxIE, RmtEn, EoB, Umask, Msk28-0, MXtd, and MDir. Other fields not listed above, like Data, may be changed without fear of losing a write to the message RAM.”
How does resetting MsgVal first avoid the above-mentioned Message RAM access conflict? To reset MsgVal for a mailbox it seems that I have to first set the MsgVal bit in the IFx Arbitration Register and then command a transfer from the IFx register set to Message RAM. Why won’t this transfer itself be potentially lost?
Thank you.
Regards,
Hong En