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.

TCAN4550: Stop TX Transmission request when errors arise

Part Number: TCAN4550
Other Parts Discussed in Thread: MSP430FR2476

Hi, 

I communicate via CAN using 2 boostxl-tcanfd-lin EVM with 2 MSP430FR2476 with the FW demo available on TI.com, where I send simple messages using

-  TCAN4x5x_MCAN_WriteTXBuffer(1, &header, data); 

- TCAN4x5x_MCAN_TransmitBufferContents(1);

It works ok.

However, if anything goes wrong (let's say I get a timeout error), I want to stop the TX transmission request. Is there an API for that? Should I clear the buffers manually? What would you recommend? 

Regards,

Geoffrey

  • Geoffrey,

    When getting an error, the nINT pin should assert low and this can be used to drive an interrupt on the MCU to stop function until the interrupt or error condition is cleared.

    The FW demo should contain some interrupt handling, do you have any interrupt handling implemented?

    Regards,

    Eric Hackett

  • Hi Eric, 

    Thanks for your reactiveness.

    I am aware of this, however is it possible to cancel all pending message requests when such interrupt is triggered? Maybe by clearing the TX buffers? 

    Regards,

    Geoffrey

  • Hi Geoffrey,

    Buffer transmission can be canceled by writing to the corresponding bit in the Buffer Cancellation Request (TXBCR address = 'h10D4). It doesn't look like there's a designated function for this command in the demo code, but it will look very similar to the TCAN4x5x_MCAN_TransmitBufferContents() function. This function can be copied, renamed, and set to write to the REG_MCAN_TXBCR register address in order to cancel transmission of a buffer that is currently set to do so. 

    Let me know if this is what you're looking for. 

    Regards,
    Eric Schott