Hi,
I have been debugging problems with sending CAN messages (on TM4C1290NCZAD) and found out that a message might not get sent if execution of CANMessageSet() is interrupted by a CAN interrupt that uses CANIntClear().
To be more specific: if interrupt arrives after execution of line 1787 in can.c (HWREG(ui32Base + CAN_O_IF1CMSK) = ui16CmdMaskReg;) and before line 1798 (HWREG(ui32Base + CAN_O_IF1CRQ) = ui32ObjID & CAN_IF1CRQ_MNUM_M;) and CANIntClear() is called (in the ISR) then message will not be transferred. The reason for that is the fact that both CANMessageSet() and CANIntClear() use Interface 1 in CAN controller. As a result CANIntClear() (in line 1113: HWREG(ui32Base + CAN_O_IF1CMSK) = CAN_IF1CMSK_CLRINTPND;) overwrites changes made previously by CANMessageSet() in CANIF1CMSK . When ISR is finished and CANMessageSet() is resumed it will request a message transfer but CANIF1CMSK will not be set to write anything to the CAN registers.
There is a workaround for this issue - use of CANMessageGet() to clear the interrupt. CANMessageGet uses interface 2 in CAN controller and therefore does not influence settings done by CANMessageSet().
Please let me know if there is something that I am missing or doing wrong or If you need more details.
Thank you.