CAN TX (event) FIFO example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN TX (event) FIFO example

974 Views
janoene
Contributor I

Hi all,

I'm experimenting with CAN on a LPCXpresso54628 development kit (with can board attached). Sending and receiving via interrupts is working, but I want to make use of the fifo's for transmitting. 

I read the user manual, but it is still not clear to me how it should be working. 

I initialized the fifo's and event fifo's with the peripheral configuration tool. When sending a message I assume it should work after calling MCAN_WriteTxBuffer and MCAN_TransmitAddRequest. My callback function is called with status 6216 twice and 6217 afterwards in some sort of loopback. 

Does anyone has any idea what is going wrong? Is there some sort of example available or more documentation on (event) fifo's for transmitting?

 

thanks in advance!

0 Kudos
Reply
1 Reply

958 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jan,

Regarding your question, as you know for CAN Transmitter, there are Four mechanism: Tx buffer, Tx FIFO, TX Queue and TX Event FIFO. For the first three mechiansm, you can use the void MCAN_SetTxBufferConfig(CAN_Type *base, const mcan_tx_buffer_config_t *config) function to allocate memory and initialize.

For the Tx Event FIFO mechanism, you have to use the void MCAN_SetTxEventFifoConfig(CAN_Type *base, const mcan_tx_fifo_config_t *config) to allocate memory and initialize.

Furthermore, the Tx message buffer start address is dependent on the mechanism, pls be careful to calculate the start address for the Tx buffer, Fifo, queue and event fifo, which take effect on the MCAN_WriteTxBuffer().

 

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply