How to implement freely variable payload length for FlexRay dynamic frames on MPC5604P

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

How to implement freely variable payload length for FlexRay dynamic frames on MPC5604P

跳至解决方案
67 次查看
kabusiji
Contributor I

Hello everyone,

I am currently developing FlexRay communication using the MPC5604P MCU, and I need to implement frame-by-frame transmission of different payload lengths in the Dynamic Segment.

I noticed that in NXP's official FlexRay Unified Driver example, the configuration of the Dynamic Segment involves parameters such as G_NUMBER_OF_MINISLOTS, GD_MINISLOT, and P_PAYLOAD_LENGTH_DYN_MAX. However, these parameters appear to be global configuration settings rather than frame-by-frame configurable options. Is there any solution to achieve this functionality?

I would greatly appreciate any insights or suggestions. Thank you very much!

0 项奖励
回复
1 解答
33 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The FlexRay cluster parameters G_NUMBER_OF_MINISLOTS, GD_MINISLOT, and P_PAYLOAD_LENGTH_DYN_MAX are global timing parameters and must remain consistent across the cluster. P_PAYLOAD_LENGTH_DYN_MAX defines the maximum payload length that any dynamic frame may use; it does not force every dynamic frame to have that length.

Dynamic-segment frames may carry different payload lengths. The actual length is specified in the payload-length field of the individual frame header and is expressed in 16-bit words. Therefore, configure P_PAYLOAD_LENGTH_DYN_MAX for the largest required frame, and update the transmit message-buffer payload-length field before each transmission. Odd byte lengths require padding to the next even number of bytes.

If the FlexRay Unified Driver version being used fixes the payload length during LPDU configuration and does not expose this field through its transmit API, then freely changing the length for one configured LPDU is not supported directly by that driver interface. In that case, either configure multiple dynamic LPDUs with different lengths or modify/use the low-level message-buffer handling to update the frame header while observing the MPC5604P message-buffer locking procedure.

Best regards,

Peter

在原帖中查看解决方案

0 项奖励
回复
2 回复数
34 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The FlexRay cluster parameters G_NUMBER_OF_MINISLOTS, GD_MINISLOT, and P_PAYLOAD_LENGTH_DYN_MAX are global timing parameters and must remain consistent across the cluster. P_PAYLOAD_LENGTH_DYN_MAX defines the maximum payload length that any dynamic frame may use; it does not force every dynamic frame to have that length.

Dynamic-segment frames may carry different payload lengths. The actual length is specified in the payload-length field of the individual frame header and is expressed in 16-bit words. Therefore, configure P_PAYLOAD_LENGTH_DYN_MAX for the largest required frame, and update the transmit message-buffer payload-length field before each transmission. Odd byte lengths require padding to the next even number of bytes.

If the FlexRay Unified Driver version being used fixes the payload length during LPDU configuration and does not expose this field through its transmit API, then freely changing the length for one configured LPDU is not supported directly by that driver interface. In that case, either configure multiple dynamic LPDUs with different lengths or modify/use the low-level message-buffer handling to update the frame header while observing the MPC5604P message-buffer locking procedure.

Best regards,

Peter

0 项奖励
回复
18 次查看
kabusiji
Contributor I
I get it, thank you very match
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2406368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E5%9C%A8%20MPC5604P%20%E4%B8%8A%E5%AE%9E%E7%8E%B0%20FlexRay%20%E5%8A%A8%E6%80%81%E5%B8%A7%E7%9A%84%E8%87%AA%E7%94%B1%E5%8F%AF%E5%8F%98%E6%9C%89%E6%95%88%E8%BD%BD%E8%8D%B7%E9%95%BF%E5%BA%A6%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E5%A4%A7%E5%AE%B6%E5%A5%BD%EF%BC%8C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E6%88%91%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20MPC5604P%20MCU%20%E5%BC%80%E5%8F%91%20FlexRay%20%E9%80%9A%E4%BF%A1%EF%BC%8C%E6%88%91%E9%9C%80%E8%A6%81%E5%9C%A8%E5%8A%A8%E6%80%81%E6%AE%B5%E4%B8%AD%E5%AE%9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%88%E6%96%B9%E6%B3%95%E5%8F%AF%E4%BB%A5%E5%AE%9E%E7%8E%B0%E6%AD%A4%E5%8A%9F%E8%83%BD%E5%90%97%EF%BC%9F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E6%82%A8%E7%9A%84%E4%BB%BB%E4%BD%95%E8%A7%81%E8%A7%A3%E6%88%96%E5%BB%BA%E8%AE%AE%E3%80%82%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%EF%BC%81%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406724%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20implement%20freely%20variable%20payload%20length%20for%20FlexRay%20dynamic%20frames%20on%20MPC5604P%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406724%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%88%91%E6%98%8E%E7%99%BD%E4%BA%86%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E3%80%82%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406466%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20implement%20freely%20variable%20payload%20length%20for%20FlexRay%20dynamic%20frames%20on%20MPC5604P%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406466%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3C%2FP%3E%0A%3CP%3EFlexRay%20%E9%9B%86%E7%BE%A4%E5%8F%82%E6%95%B0%20G_NUMBER_OF_MINISLOTS%E3%80%81GD_MINISLOT%20%E5%92%8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