This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: Issue with MCAN_getTxBufTransmissionStatus - Transmission not completed

Part Number: AM6442

I am experiencing a failure when I use this API (MCAN_getTxBufTransmissionStatus) to know if a transmission has occurred over the CAN bus. Basically, it gives the value of MCAN_TXBTO related to the buffer which is being used.

I am using it according to the example provided by TI:

bitPos = (1U << fifoStartIdx);
/* Poll for Tx completion */
do
{
       txStatus = MCAN_getTxBufTransmissionStatus(gMcanBaseAddr);
}while((txStatus & bitPos) != bitPos);

These are the steps that I am doing:

  1. Just AM64x broadcasts messages to the network -> MCAN_TXBTO is functional
  2. When other nodes in the network start to broadcast -> MCAN_TXBTO works for a while and then becomes not functional.
  3. Following the TI's example, the CPU controls the RAM buffer. However, the Message Handler (figure below) does not complete a transmission after other nodes in the CAN network start to broadcast.

In my application which is a computer connected to the AM64x through CAN, after I add a request to transmit with MCAN_txBufAddReq I want to check if the transmission of the message was completed. When I am transmitting a message from my device to the computer it works well. The MCAN_TXBTO bit turns on and the loop is completed. No messages are received in the device. No problem until I create additional messages to send from my computer to the CAN network. For a while, no problem happens when checking the MCAN_TXBTO. After some time, the loop is not completed because the MCAN_TXBTO bit does not turn on. Suddenly the process hangs in the loop above. If I increase the number of messages from my computer to the AM64x in the network the situation is worst.

Why is it happening? The process seems to be very strait: Config the Tx, write message to the RAM, add a request to transmit and finally check until it is completed. I configured the RAM buffer as FIFO only and there is no filtering. When I have a lot of messages in the network I was expecting to have some delay in the loop until the message is sent and the transmission is completed. Instead, the transmission is never completed. What am I doing wrong?