Been looking in the SDKs for an example using FIFO for RX and TX but do not see any in the CAN or CANFD driver examples. Can you all provide a sample program using FIFO?
EDIT: One of the things that this would be helpful with is setting up the id filter table and the appropriate structure. I really would like to be able to receive on any mailbox a series of message ides as well as setting up a CANFD fifo
EDIT2: BTW the docs for the FD example in the 1060evk sdk state
Board settings
==============
The example requires 2 sets of boards, each of them are mounted with the base board. Using a male to male CAN
cable to connect the CAN2 instance (J11) between the 2 base boards.
In looking at the schematic and the pins it looks like the CAN3 tx/rx pins go to the Arduino header. So how can you test CANFD if you don't have a receiver? CAN2 is not CANFD.
Solved! Go to Solution.
Hi Michael Smorto
Unfortunately, there isn't any example code of flexcan using the RXFIFO buffer provided along with the SDK. You can check the following post:
Even if they are for different chips, you could use them as reference for your implementation. I have implement a simple example using the FIFO:
flexcan_rx_fifo_config_t fifoConfig;
uint32_t tableID[10] = { FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[0], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[1], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[2], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[3], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[4], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[5], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[6], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[7], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[8], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[9], 0, 0), };
fifoConfig.idFilterType = kFLEXCAN_RxFifoFilterTypeA;
fifoConfig.idFilterNum = sizeof(tableID) / sizeof(tableID[0]);//2;
fifoConfig.idFilterTable = tableID;
fifoConfig.priority = kFLEXCAN_RxFifoPrioHigh;
FLEXCAN_SetRxFifoConfig(EXAMPLE_CAN, &fifoConfig, true);
......
......
/* When you want to receive some data */
rxXferfifo.frame = &frame;
FLEXCAN_TransferReceiveFifoNonBlocking(EXAMPLE_CAN, &flexcanHandle, &rxXferfifo);
EDIT2: BTW the docs for the FD example in the 1060evk sdk state
Thanks for pointing out the mistake, this is a error in the read me file, it should actually say CAN3, those pins have also the functionality of the CAN3_Tx/Rx.
Hope this could helps you
Have a great day,
TIC
-------------------------------------------------------------------------------
Note: - If this post answers your question, please click the "Mark Correct" button. Thank you
-------------------------------------------------------------------------------
Hi Jorge Antonio Alcala Vazquez
I really appreciate your reply. Thank you for the links - they really help in understanding how to set up the FIFO which was what I was looking.
Now for the fun - start implementation of the FIFO in the application.
Hi Michael Smorto
Unfortunately, there isn't any example code of flexcan using the RXFIFO buffer provided along with the SDK. You can check the following post:
Even if they are for different chips, you could use them as reference for your implementation. I have implement a simple example using the FIFO:
flexcan_rx_fifo_config_t fifoConfig;
uint32_t tableID[10] = { FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[0], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[1], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[2], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[3], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[4], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[5], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[6], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[7], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[8], 0, 0),
FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(rxIdentifier[9], 0, 0), };
fifoConfig.idFilterType = kFLEXCAN_RxFifoFilterTypeA;
fifoConfig.idFilterNum = sizeof(tableID) / sizeof(tableID[0]);//2;
fifoConfig.idFilterTable = tableID;
fifoConfig.priority = kFLEXCAN_RxFifoPrioHigh;
FLEXCAN_SetRxFifoConfig(EXAMPLE_CAN, &fifoConfig, true);
......
......
/* When you want to receive some data */
rxXferfifo.frame = &frame;
FLEXCAN_TransferReceiveFifoNonBlocking(EXAMPLE_CAN, &flexcanHandle, &rxXferfifo);
EDIT2: BTW the docs for the FD example in the 1060evk sdk state
Thanks for pointing out the mistake, this is a error in the read me file, it should actually say CAN3, those pins have also the functionality of the CAN3_Tx/Rx.
Hope this could helps you
Have a great day,
TIC
-------------------------------------------------------------------------------
Note: - If this post answers your question, please click the "Mark Correct" button. Thank you
-------------------------------------------------------------------------------