S32K312 CAN MB vs RxFIFO

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

S32K312 CAN MB vs RxFIFO

跳至解决方案
609 次查看
lua40927
Contributor III

Hello,

I would like to ask a few questions regarding the CAN reception mechanism on the S32K312, specifically the differences between Message Buffers (MBs) and Rx FIFO.

  1. If I configure MB0 to MB30 as receive message buffers and set them to accept all CAN messages, what happens when a new message arrives while MB0 already contains an unread message? Will the new message be automatically stored in MB1 (or the next available MB), or will it overwrite MB0 / be discarded?
  2. Is there any performance difference between using Message Buffers (MBs) and Rx FIFO for CAN reception? For example, is one method faster than the other in terms of receiving back-to-back CAN frames, or is the difference negligible?

I am trying to determine which approach is more suitable for handling a high volume of CAN traffic on the S32K312.

Thank you for your help.

0 项奖励
回复
1 解答
592 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@lua40927

1.Yes — if you configure multiple RX message buffers with the same acceptance criteria, FlexCAN does not simply overwrite MB0 immediately. With the normal matching behavior, it scans RX MBs from low number to high number, and if the first matching MB is not “free-to-receive,” it keeps looking for another matching MB that is free. So if MB0 already contains an unread matching frame, the next matching frame can be stored in MB1, then MB2, and so on, as long as those MBs are also matching and free. If no matching/free MB remains, FlexCAN overwrites the last matched MB and sets its CODE to OVERRUN 

2.No such info available.

I can give you some experience summaries and comparisons.

  • If your priority is strict receive order + simpler draining logic , FIFO is better aligned to that use case because it is a true ordered queue with internal pointer handling.,
  • If your priority is maximum buffering depth using many RX slots for Classic CAN traffic, dedicating many MBs to reception can give you much more room than the six-deep legacy FIFO, at the cost of more software management and possible reordering by timestamp.,,
  • If you want DMA-based reception , the available S32K material says DMA is supported for RX FIFO, not MBs. Specifically, an S32K support answer states “DMA is supported only over RXFIFOs (legacy or enhanced) no over MBs.”
  • On S32K312,  Enhanced Rx FIFO is available only on FlexCAN0 and that legacy and enhanced FIFO cannot be enabled at the same time.

 

Note:
We recommend using your company email to register your NXP account, as general email addresses offer limited technical support.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
593 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@lua40927

1.Yes — if you configure multiple RX message buffers with the same acceptance criteria, FlexCAN does not simply overwrite MB0 immediately. With the normal matching behavior, it scans RX MBs from low number to high number, and if the first matching MB is not “free-to-receive,” it keeps looking for another matching MB that is free. So if MB0 already contains an unread matching frame, the next matching frame can be stored in MB1, then MB2, and so on, as long as those MBs are also matching and free. If no matching/free MB remains, FlexCAN overwrites the last matched MB and sets its CODE to OVERRUN 

2.No such info available.

I can give you some experience summaries and comparisons.

  • If your priority is strict receive order + simpler draining logic , FIFO is better aligned to that use case because it is a true ordered queue with internal pointer handling.,
  • If your priority is maximum buffering depth using many RX slots for Classic CAN traffic, dedicating many MBs to reception can give you much more room than the six-deep legacy FIFO, at the cost of more software management and possible reordering by timestamp.,,
  • If you want DMA-based reception , the available S32K material says DMA is supported for RX FIFO, not MBs. Specifically, an S32K support answer states “DMA is supported only over RXFIFOs (legacy or enhanced) no over MBs.”
  • On S32K312,  Enhanced Rx FIFO is available only on FlexCAN0 and that legacy and enhanced FIFO cannot be enabled at the same time.

 

Note:
We recommend using your company email to register your NXP account, as general email addresses offer limited technical support.

0 项奖励
回复
376 次查看
lua40927
Contributor III

Okay, thank you very much for your suggestion. I will try using the company email address next time.

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2374676%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K312%20CAN%20MB%20vs%20RxFIFO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2374676%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20class%3D%22%22%3E%3CSPAN%3E%E4%BD%A0%E5%A5%BD%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%3E%E6%88%91%E6%83%B3%E9%97%AE%E5%87%A0%E4%B8%AA%E6%9C%89%E5%85%B3%20S32K312%20CAN%20%E6%8E%A5%E6%94%B6%E6%9C%BA%E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PAN%3E%E4%BD%BF%E7%94%A8%E6%8A%A5%E6%96%87%E7%BC%93%E5%86%B2%E5%99%A8%20(MB)%20%E5%92%8C%20Rx%20FIFO%20%E6%8E%A5%E6%94%B6%20CAN%20%E6%98%AF%E5%90%A6%E6%9C%89%E6%80%A7%E8%83%BD%E5%B7%AE%E5%BC%82%EF%BC%9F%E4%BE%8B%E5%A6%82%EF%BC%8C%E5%B0%B1%E6%8E%A5%E6%94%B6%E8%83%8C%E9%9D%A0%E8%83%8C%20CAN%20%E5%B8%A7%E8%80%8C%E8%A8%80%EF%BC%8C%E4%B8%80%E7%A7%8D%E6%96%B9%E6%B3%95%E6%98%AF%E5%90%A6%E6%AF%94%E5%8F%A6%E4%B8%80%E7%A7%8D%E6%96%B9%E6%B3%95%E6%9B%B4%E5%BF%AB%EF%BC%8C%E6%88%96%E8%80%85%E4%B8%A4%E8%80%85%E4%B9%8B%E9%97%B4%E7%9A%84%E5%B7%AE%E5%BC%82%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E5%BF%BD%E7%95%A5%E4%B8%8D%E8%AE%A1%EF%BC%9F%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%20class%3D%22%22%3E%3CSPAN%3E%E6%88%91%E6%83%B3%E7%A1%AE%E5%AE%9A%E5%93%AA%E7%A7%8D%E6%96%B9%E6%B3%95%E6%9B%B4%E9%80%82%E5%90%88%E5%A4%84%E7%90%86%20S32K312%20%E4%B8%8A%E7%9A%84%E5%A4%A7%E9%87%8F%20CAN%20%E6%B5%81%E9%87%8F%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%B8%AE%E5%8A%A9%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2374746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K312%20CAN%20MB%20vs%20RxFIFO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2374746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CA%20id%3D%22link_6%22%20class%3D%22lia-link-navigation%20lia-page-link%20lia-user-name-link%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F200168%22%20aria-label%3D%22View%20Profile%20of%20lua40927%22%20target%3D%22_blank%22%3E%3CSPAN%20class%3D%22%22%3Elua40927%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E1.Yes%20-%3CSPAN%3E%20%E5%A6%82%E6%9E%9C%E6%82%A8%E9%85%8D%E7%BD%AE%E4%BA%86%E5%85%B7%E6%9C%89%E7%9B%B8%E5%90%8C%E6%8E%A5%E6%94%B6%E6%A0%87%E5%87%86%E7%9A%84%E5%A4%9A%E4%B8%AA%20RX%20%E6%8A%A5%E6%96%87%E7%BC%93%E5%86%B2%E5%8C%BA%EF%BC%8CFlexCAN%3C%2FSPAN%3E%3CSTRONG%20class%3D%22%22%3E%20%E4%B8%8D%E4%BC%9A%3C%2FSTRONG%3E%3CSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%20%E7%AE%80%E5%8D%95%E5%9C%B0%E7%AB%8B%E5%8D%B3%E8%A6%86%E7%9B%96%20MB0%E3%80%82%E5%9C%A8%E6%AD%A3%E5%B8%B8%E5%8C%B9%E9%85%8D%E8%A1%8C%E4%B8%BA%E4%B8%8B%EF%BC%8C%E5%AE%83%E4%BC%9A%E4%BB%8E%E4%BD%8E%E5%88%B0%E9%AB%98%E6%89%AB%E6%8F%8F%20RX%20MB%EF%BC%8C%E5%A6%82%E6%9E%9C%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%8C%B9%E9%85%8D%E7%9A%84%20MB%20%E4%B8%8D%E6%98%AF%20%22%E7%A9%BA%E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%3E%20OVERRUN%3C%2FSTRONG%3E%3CSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%20%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E2.%E6%B2%A1%E6%9C%89%E6%AD%A4%E7%B1%BB%E4%BF%A1%E6%81%AF%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E7%BB%99%E4%BD%A0%E4%B8%80%E4%BA%9B%E7%BB%8F%E9%AA%8C%E6%80%BB%E7%BB%93%E5%92%8C%E6%AF%94%E8%BE%83%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%20class%3D%22%22%3E%0A%3CLI%20class%3D%22%22%3E%E5%A6%82%E6%9E%9C%E6%82%A8%E7%9A%84%E4%BC%98%E5%85%88%E7%BA%A7%E6%98%AF%3CSPAN%3E%20%3C%2FSPAN%3E%3CSTRONG%20class%3D%22%22%3E%E4%B8%A5%E6%A0%BC%E7%9A%84%E6%8E%A5%E6%94%B6%E9%A1%BA%E5%BA%8F%20%2B%20%E6%9B%B4%E7%AE%80%E5%8D%95%E7%9A%84%E8%80%97%E5%B0%BD%E9%80%BB%E8%BE%91%3C%2FSTRONG%3E%3CSPAN%3E%20%3C%2FSPAN%3E%20%EF%BC%8C%E9%82%A3%E4%B9%88%20FIFO%20%E6%9B%B4%E9%80%82%E5%90%88%E8%BF%99%E7%A7%8D%E7%94%A8%E4%BE%8B%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%AE%83%E6%98%AF%E7%9C%9F%E6%AD%A3%E7%9A%84%E6%9C%89%E5%BA%8F%E9%98%9F%E5%88%97%EF%BC%8C%E5%85%B7%E6%9C%89%E5%86%85%E9%83%A8%E6%8C%87%E9%92%88%E5%A4%84%E7%90%86%E5%8A%9F%E8%83%BD%E3%80%81%3C%2FLI%3E%0A%3CLI%20class%3D%22%22%3E%E5%A6%82%E6%9E%9C%E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9A%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6%E5%9C%B0%E5%9D%80%E6%8F%90%E4%BE%9B%E7%9A%84%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81%E6%9C%89%E9%99%90%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2383769%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K312%20CAN%20MB%20vs%20RxFIFO%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2383769%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A5%BD%E7%9A%84%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E5%BB%BA%E8%AE%AE%E3%80%82%E4%B8%8B%E6%AC%A1%E6%88%91%E4%BC%9A%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8%E5%85%AC%E5%8F%B8%E9%82%AE%E7%AE%B1%E5%9C%B0%E5%9D%80%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E