In the Reference Manual 188.8.131.52 it says to clear the IFLAG bit before writing the abort code. But this would seem to lead to a race condition: where the frame had just been transmitted, the IFLAG set, then the flag is cleared and CODE it set to abort and the transmission status is lost.
Elsewhere in the Reference Manual it states that the IFLAG bit is used to block writes to the mailbox. If the flag becomes set just before the abort code is written then the abort is blocked and the ISR will handle the transmission in the normal way (since CODE will indicate the frame is sent). So it would seem that *not* clearing the IFLAG is the correct thing to do.
Is my understanding correct and the recommended procedure for aborting actually wrong?