Environment MIMXRT1064-EVK
I am doing some performance testing on the eval board. Noticed from time to time. The interrupt callback get status kStatus_FLEXCAN_UnHandled passed in.
Looking around flexcan code, FLEXCAN_SubHandlerForDataTransfered() could not find a corresponding MB that generates the interrupt.
It appears it is cpu performance related. It happens more often if traffic is heavier. I have tried disable TX/RX Warning in CTRL1 register, have not seen any difference. Just can not figured out the nature of the interrupt.
Thanks,
Max
Package MIMXRT1064_DFP 19.0.0
I used PEAK CAN adaptor to push CAN traffic. I have about 25 streams of standard data package at 1 message/10ms rate with my application.
The code followed example of flexcan_interrupt_transfer of SDK, except if continues to call FLEXCAN_TransferFDReceiveNonBlocking on an successful receive in my application. and I added a switch statement for kStatus_FLEXCAN_UnHandled case in the callback.
I did not have any problem when I had light traffic (less streams and longer time interval).
I think the problem for me is that the a break point is hit, the CAN does not really goes to freeze mode by examining the MCR register. For that reason when every time, when kStatus_FLEXCAN_UnHandled is hit, the debugger stopped, and I see also some other MB interrupted as it continues to received messages
Hi @max_yang1 ,
For your case, maybe it is better with FIFO enabled on FlexCAN. Please kindly refer to the demo of evkmimxrt1064_flexcan_ping_pong_buffer_transfer and evkmimxrt1064_flexcan_loopback_edma_transfer for details.
Have a great day,
Kan
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Are you saying FIFO method performs better than mail boxes?
Thanks,
Max
Hi @max_yang1 ,
For high data rate use cases, FIFO is more efficiency as it uses multiple MB to receive CAN frames, and if you enable DAM as well, the performance would be better.
Hope that makes sense,
Have a great day,
Kan
-------------------------------------------------------------------------------
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 @max_yang1 ,
Yes, that might be the possible cause, and to enter Freeze mode , you may set the HALT bit in MCR as well . Please kindly refer to the following for details.
Freeze Mode:
It is enabled when the FRZ bit in the MCR Register is asserted. If enabled, Freeze Mode
is entered when the HALT bit in MCR is set or when Debug Mode is requested at MCU
level and the FRZ_ACK bit in the MCR Register is asserted by the FlexCAN. In this
mode, no transmission or reception of frames is done and synchronicity to the CAN bus
is lost. See Freeze Mode for more information.
Have a great day,
Kan
-------------------------------------------------------------------------------
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 @max_yang1 ,
May I have more details regarding your test? Such as SDK package version, which flexcan example and the test environment you set up with MIMXRT1064-EVK... Please kindly clarify.
Thanks for your patience!
Have a great day,
Kan
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------