FlexCAN Fifo SDK 2.0 example

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FlexCAN Fifo SDK 2.0 example

4,586 次查看
marcin99
Contributor II

Hello, does anyone have or know where to find a working Flexcan Fifo example using SDK 2.0 or higher? I am using FRDM K-66F board but I think this peripheral is similar in K64 and K2x processors.

I had the MB version working but struggling with the Fifo Interrupt configuration.

0 项奖励
回复
3 回复数

3,602 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi marcin99

You could check any of the examples provided with the software package SDK. They are located under the path SDK_2.3.0_FRDM-K66F_PATH\boards\frdmk66f\driver_examples\flexcan

Also, I recommend you to check the SDK API Reference Manual:

Kinetis SDK 2.0 API Reference Manual: FlexCAN Driver 

You need to add some lines to implement FIFO and filter functionality:

uint32_t rxFifoFilter[] = {FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(0x123, 0, 0),
                           FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(0x123, 1, 0)};

rxFifoConfig.idFilterNum = sizeof(rxFifoFilter) / sizeof(rxFifoFilter[0]);
rxFifoConfig.idFilterTable = rxFifoFilter;
rxFifoConfig.idFilterType = kFLEXCAN_RxFifoFilterTypeA;
rxFifoConfig.priority = kFLEXCAN_RxFifoPrioHigh;

FLEXCAN_SetRxFifoConfig(EXAMPLE_CAN, &rxFifoConfig, true);


rxfifoXfer.frame = &rxFrame;
FLEXCAN_TransferReceiveFifoNonBlocking(EXAMPLE_CAN,&flexcanHandle, &rxfifoXfer);

Hope this could help you.

Best regards

Jorge Alcala

3,602 次查看
collinmoore
Contributor II

I am also attempting to use RxFIFO to receive any IDs. I haven't been able to find a demo project (I'm using SDK 2.2.0, 2.4.1, and 2.5.0).

How do I set up filters to receive all IDs?

0 项奖励
回复

3,602 次查看
ino0
Contributor II

I am using FIFO too. I have one more question: if I try to use fifo to receive any IDs, how can I set the ID table, and rximr?