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: How to Enable TX Event FIFO for the TCAN4550

Part Number: TCAN4550

Hi,

I've successfully enabled the TCAN device to implement a simple echo program where when I send a CAN frame over the bus, the TCAN will receive it, copy it, change the frame ID and then send the copied frame back onto the bus. This works well.

What hasn't worked yet is that I never see any indication that a TX event is being placed in the TX Event FIFO after the copied frame is echoed back onto the bus. In my interrupt handler, I never seen any of the TX Event flags set (TEFL, TEFF, TEFW, TEFN, TFE) and when I read the TX Event FIFO status register it always reads a value of 0.
I consistently see the TC interrupt flag in my interrupt handler, which I assume is indicating the successful transmission of the echoed CAN frame, I just don't understand why I'm not getting any TX Events in the FIFO.

Some context:

All interrupt processing happens in the context of a task: when nINT signals an interrupt the MCU's interrupt handler sets a flag that signals a task to unblock. When the task is running, it performs all SPI interactions and processes the TCAN interrupt flags.

The TCAN is configured with:
5 SID Filters
5 RX Buffers
5 TX Buffer elements configured as a "queue"
RX FIFO 0 contains 17 elements
TX Event FIFO contains 5 elements

On start up, I enable the following interrupts:
TEFNE, RF0NE, DRXE

I've also tried enabling TCE, but that has had no affect on receiving any TX Events
I've also tried enabling interrupts for each individual TX Buffer, but still with no success in getting TX Events

Is there a configuration step that I am missing that I need to enable the TX Event FIFO? Any ideas as to why I never see any created and never get an interrupt indicating that a new TX Event is ready?

Thanks!

  • Hi Dustin,

    In each TX buffer element, there is an "EFC" bit in the header (in word 1 immediately after the message marker) that needs to be set to one in order for that buffer's transmission to be logged in the event FIFO.  Is this bit being set in your application?  For reference, you might want to look at the TX buffer element fields defined in Table 15 of our Software User's Guide:

    http://www.ti.com/lit/ug/sllu270/sllu270.pdf

    Regards,
    Max

  • Hi Max,

    Thanks for the suggestions, that's what I was missing!

    Quick follow up question. In the Bosch user manual it states that when reading from the TX Event FIFO, after the get index is read, the associated start address should be calculated by multiplying the get index by 2 and then adding that to the TX Event FIFO start address.
    Can you confirm that multiplying by 2 is correct?
    Since the TX Event element size is 8 bytes, I would have expected to multiply the get index by 8, similar to how the RX FIFO get index is multiplied by the rx element size in bytes. I assume this means that the TX Event FIFO get index indexes per word instead of per byte like the RX FIFO, is that correct?

  • Hi Dustin,

    I believe you are correct that you need to multiply the get index by 8 similar to the RX FIFO.  Everything with the TCAN4550 is word based with a byte address and as such you need to calculate that byte address.  I'm not familiar with the particular section or wording in the MCAN manual you were referencing, but I also spoke with our firmware expert on this device who believes that you need to treat it the same as the RX FIFO, however he hasn't really used that much. If you find that this isn't correct, we will take a much closer look for you.

    Regards,

    Jonathan