I am trying to configure the CAN peripheral on the TM4C device I am using on a custom PCB, to 1 MBaud and using the TX interrupt on a message object. Each time the TX interrupt is called, I would like to pop a byte off a circular buffer and use the CANMessageSet() API call to send it. As I understand it, as long as I don't see any error interrupts, the byte should be sent properly by the hardware, with no additional work on the part of the application. However, when I look at the CAN bus using a CAN analyzer, I see that some bytes are missing. This is despite the CAN TX ISR firing the correct number of times (i.e. the CANMessageSet() function is called with the correct byte sequence and the correct # of times). Can anyone shed light on what I might need to look into here? Here is my ISR:
Here is my setup code:
Please disregard some of the extra code as I am configuring a number of different TX and RX mailboxes in order to implement a "mux-demux"-type UART-CAN bridge app.
Thanks!
- A.G.