Hi,
As title,
when I transmit data to my device, it only can receive 7 frames,
and then it will show RxFifoOverflow information.
like below picture
How to clear the RxFifo data to avoid RxFifoOverflow?
Or is there any suggestions to solve this problem ?
thanks!
Best Regards,
Andy Dong
解決済! 解決策の投稿を見る。
Hi Andy Dong,
Sorry for reply late.
After serval rounds of testing and modification, the modified demo works well, and I've attached the modified demo.
==FlexCAN loopback example -- Start.==
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 51
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e60
DataWord1 : 0x80221f48
---------- End ----------
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 6673
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e6
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 13669
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 20664
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 27638
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 34593
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 41525
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x8
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 48436
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x0
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 55347
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x0
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Andy Dong,
Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
Before answering your question, I'd like to know what board and demo code you use, otherwise I've no idea what to do next.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi, jeremyzhou
I used imxrt1050 and SDK is 2.7.0
Example is evkbimxrt1050_flexcan_loopback_transfer.
I had modified the code to use RxFifo to receive data.
Best Regards,
Andy Dong
Hi Andy Dong,
Thanks for your reply.
Please upload the modified code.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Andy Dong,
I've run the code, actually, it doesn't print out the same message as you mentioned before, so please check the uploaded code.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi jeremyzhou
I've uploaded my entire project, below is the link
evkbimxrt1050_flexcan_loopback_transfer.7z - Google Drive
please try again thanks
Best Regards,
Andy Dong
Hi Andy Dong,
Thanks for your reply.
I run your new code, unfortunately, it still can't print out the same message as you described before.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi. jeremyzhou
I think I didn't describe my procedure in detail.
In your picture, it happened because you didn't connect another device through canbus.
so it will become status=5310(kStatus_FLEXCAN_ErrorStatus),
when you use function FLEXCAN_TransferSendNonBlocking(EXAMPLE_CAN, &flexcanHandle, &txXfer);
In real conditions, our device will connect to other devices through canbus.
In my test, when I use another device to send data(more than 7 frames) to my device,
it can only receive 7 frames and then become status 5309->5308->5312.
To simplify for you to test, I have modified the code.
evkbimxrt1050_flexcan_loopback_transfer_upload.7z - Google Drive
It runs in LoopBack mode and I use for loop to send data(more than 7 frames)
It can only receive 6 frames and then become status 5309->5308->5312.
It's the same error as I met in real conditions.
Is there any solution to solve this problem?
Best Regards,
Andy Dong
Hi Andy Dong,
Sorry for reply late.
After serval rounds of testing and modification, the modified demo works well, and I've attached the modified demo.
==FlexCAN loopback example -- Start.==
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 51
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e60
DataWord1 : 0x80221f48
---------- End ----------
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 6673
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e6
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 13669
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2e
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 20664
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b2
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 27638
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80b
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 34593
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x80
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 41525
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x8
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 48436
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x0
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
MB 13 - status = 5301 = kStatus_FLEXCAN_TxIdle
status = 5307 = kStatus_FLEXCAN_RxFifoIdle
------ Frame Info ------
Timestamp : 55347
Length : 8
Type : 0
Format : 1
ID : df80106
PGN : 129025
DataWord0 : 0x0
DataWord1 : 0x80221f48
---------- End ----------
status = 5312
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Andy Dong,
Sorry for your reply late.
Firstly, I've already replicated your issue. Then, after investigating further, I find the FIFO would overflow after receiving exceeds six frames, and the code will stop at the breakpoint as below figure shows.
It definitely is the cause of the issue, however, I'm still working on the reason of FIFO overflow event.
According to the code, the received frame will be read after storing in the FIFO, so it's a bit weird.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------