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.

TMS570LS0714: Issue with DCAN reporting arbitration loss ~95% of the time

Part Number: TMS570LS0714


We were using the automatic-retransmit, however, it would send an unacknowledged message endlessly.  We noticed this when attaching a Peak branded CAN tool at the link.  Because it interferes with our power management approach (not to mention the endless re-transmit), DAR (disable auto transmit) is now selected.

 

Now we desire to handle TX message retries during transmission of the next message (taking the arbitration loss status and re-requesting the scheduler to attempt again.)   What I find is that the “newdat” flag is only being cleared at a very low rate (<95% of the time.)   According to the TRM a successful transmission will also clear the newdat flag (in addition to the TxReq flag).   It might be helpful to know, the very same system which returns these arbitration loss indications seems to communicate flawlessly.

 

Anyways,  here is the function we have which is returning the “bad status”, perhaps you can help us out.   Thanks !!   Frank

 

volatile bool msgbox_tx_failed = false;

bool mcal_can_transmit_ready(mcal_can_message_t *can_message)

{

    mcal_can_base_t        *can_reg_n = NULL;

    uint32_t               tx_status_index;

    uint32_t               tx_busy_bit;

    uint32_t               msgbox_newdat_bit;

    mcal_can_link_enum_t   can_link;

    bool                   can_tx_ready = false;

 

    msgbox_tx_failed = false;

 

    // Verify CAN device exists

    can_link = can_message->message_route.can_link;

    if (can_link >= MCAL_NUM_CAN_CHANNELS)

    {

        mcal_can_status.invalid_channel_req = true;

    }

    else

    {

        can_reg_n = mcal_can_register_list[ can_link ];

        tx_status_index = (can_message->message_route.can_stream - 1u) >> 5u;

        tx_busy_bit = 1u << ((can_message->message_route.can_stream - 1u) & 0x1f);

        msgbox_newdat_bit = 1u << ((can_message->message_route.can_stream - 1u) & 0x1f);

 

        // Verify valid mailbox

        if ((can_message->message_route.can_stream >= MAX_VALID_MAILBOX) ||

            (can_message->message_route.can_stream == 0))

        {

            mcal_can_status.invalid_mailbox_id = true;

        }

        else if ((can_reg_n->txrq[tx_status_index] & tx_busy_bit) == 0u)

        {

            can_tx_ready = true;

            if ((can_reg_n->msgval[tx_status_index] & msgbox_newdat_bit) != 0u)

            {

                msgbox_tx_failed = true;

            }

        }

    }

    return can_tx_ready;

}

  • Hello Kime,

    If Automatic Retransmission mode is disabled by setting the DAR bit in the CAN Control Register, the behavior of bits TxRqst and NewDat in the Message Control Register of the Interface Register set is as follows:

    • When a transmission starts, the TxRqst bit of the respective Interface Register set is reset, while bit NewDat remains set.
    • When the transmission has been successfully completed, the NewDat bit is reset.

    When a transmission failed (lost arbitration or error) bit NewDat remains set.You may use a CAN monitor to check the message on the bus, or use the loopback.