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.

TMS320F280039: TI280039 MCAN TX transmit error

Part Number: TMS320F280039


Tool/software:

HI,

     I can use MCAN_TXBTO to confirm the successful sending of the message. What register should be used to confirm the failure of message sending? If only MCAN_TXBTO is used, if no message is sent, MCAN_TXBTO is also 0. Therefore, MCAN_TXBTO cannot be used alone. I tried to combine MCAN_TXBAR and MCAN_TXBTO. MCAN_TXBAR is not equal to 0 and MCAN_TXBTO is equal to 0 as the conditions for sending failure. However, after testing, it was found that MCAN_TXBAR has always been equal to 0? May I ask what plans there are?

Part of the code is as follows:

     if(0u != (MCAN_getTxBufTransmissionStatus(MCANA_DRIVER_BASE) & (basepos << i)))
{
u8CANFDMsgTxResult[i] = TX_OK;
}
else if((0u != (HW_RD_REG32(MCANA_DRIVER_BASE + MCAN_TXBAR) & (basepos << i))) &&
(0u == (MCAN_getTxBufTransmissionStatus(MCANA_DRIVER_BASE) & (basepos << i))))
{
u8CANFDMsgTxResult[i] = TX_NOT_OK;
}

  • HI Liu,

    TXBTO can be used alone to indicate the TX status.

    TXBAR is to make a TX request by writing "1" to the corresponding bit of TX buffer. 

    You don't need to check the TX status if no TX request is made to a TX buffer.

  • Hi Wang,

         Can I use the following code to prove that a request was sent but failed to be sent successfully:

            ((0u != (HW_RD_REG32(MCANA_DRIVER_BASE + MCAN_TXBAR) & (basepos << i))) &&(0u == (MCAN_getTxBufTransmissionStatus(MCANA_DRIVER_BASE) & (basepos << i)));

  • It looks ok.

    • Successful transmission:

    Corresponding Tx Buffer Transmission Occurred bit TXBTO.TOx set. The bit of TXBTO is set when the corresponding TXBRP bit is cleared after a successful transmission. The bits are reset when a new transmission is requested by writing a ‘1’ to the corresponding bit of register TXBAR.

    Corresponding Tx Buffer Cancellation Finished bit TXBCF.CFx not set

    • Successful transmission in spite of cancellation:

    Corresponding Tx Buffer Transmission Occurred bit TXBTO.TOx set

    Corresponding Tx Buffer Cancellation Finished bit TXBCF.CFx set

    You can also use TRP register and cancellation register:

    Each Tx Buffer has its own Transmission Request Pending bit. The bits are set via register TXBAR. The bits are reset after a requested transmission has completed or has been cancelled via register TXBCR.