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.

TMS320F28388D: How to property discard an in-process CAN transmit message

Part Number: TMS320F28388D

My code is following the can_ex4_transmit_receive example code, and it works -- except if the target powers-up into an empty CAN bus (non-terminated and no destination CAN device). What I believe is happening is, without a destination device, the transmit object is in an no-ack-error condition. When the destination device is plugged in, the CAN-object does not recover (maybe auto bus-off)? 

I am trying to transmit a periodic CAN status message upon power-up, so I could either:

1. Timeout on the pending-tx-request and delete the pending packet.

2. On every period, simply discard the previous packet and over-write it with the new information.

I tried the CAN_clearMessage function from can_ex4_transmit_receive, but that does not clear the txrqst flag. How can I properly delete an in-process transmit message?

Thanks,

Jim

  • Repeated ACK error should not force the node into bus-off state. The TEC should increment to 128 and stay there.

  • Yes it is not auto-off. Maybe I can reword my question:

    I am periodically transmitting a CAN status message; if I power-up the controller with a PCAN USB-to-CAN connected and PCANview open, all is well.

    If I power-up the controller with an empty/not-connected CAN bus, and then connect the PCAN after, the CAN-peripheral does not recover -- IF1MCTL.TxRqst is always 1, and no packets are transmitted. In this state LEC=0 (No error), EPASS=0 (no passive state error). 

    My thought was I need to either discard the existing message object or over-write it. I tried CAN_clearMessage to discard it, but that did not work. Do you have any suggestions how to recover / restart the CAN bus in this state?

    Thanks,

    Jim

  • I tried this on a 28377D (which shouldn’t matter; it is the same module on 28388). When there is no other node on the network, TEC correctly increments to 128 and stops there. Node does not go bus-off. When I bring another node into the network, transmission begins and TEC decrements to 0. DAR = 0 in my code. What value do you have for DAR? I have a feeling it is probably 1. “CAN_clearMessage”disables a message object. It does not abort a transmission.