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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
65 Views
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 Kudos
Reply
1 Solution
31 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
32 Views
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 Kudos
Reply
16 Views
kabusiji
Contributor I
I get it, thank you very match
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2406368%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20implement%20freely%20variable%20payload%20length%20for%20FlexRay%20dynamic%20frames%20on%20MPC5604P%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%3EHello%20everyone%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3EI%20am%20currently%20developing%20FlexRay%20communication%20using%20the%20MPC5604P%20MCU%2C%20and%20I%20need%20to%20implement%20frame-by-frame%20transmission%20of%20different%20payload%20lengths%20in%20the%20Dynamic%20Segment.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3EI%20noticed%20that%20in%20NXP's%20official%20FlexRay%20Unified%20Driver%20example%2C%20the%20configuration%20of%20the%20Dynamic%20Segment%20involves%20parameters%20such%20as%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3EG_NUMBER_OF_MINISLOTS%3CSPAN%20class%3D%22%22%3E%2C%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3EGD_MINISLOT%3CSPAN%20class%3D%22%22%3E%2C%20and%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3EP_PAYLOAD_LENGTH_DYN_MAX%3CSPAN%20class%3D%22%22%3E.%20However%2C%20these%20parameters%20appear%20to%20be%20global%20configuration%20settings%20rather%20than%20frame-by-frame%20configurable%20options.%20Is%20there%20any%20solution%20to%20achieve%20this%20functionality%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3EI%20would%20greatly%20appreciate%20any%20insights%20or%20suggestions.%20Thank%20you%20very%20much!%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%3EI%20get%20it%2C%20thank%20you%20very%20match%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%3EHello%2C%3C%2FP%3E%0A%3CP%3EThe%20FlexRay%20cluster%20parameters%20G_NUMBER_OF_MINISLOTS%2C%20GD_MINISLOT%2C%20and%20P_PAYLOAD_LENGTH_DYN_MAX%20are%20global%20timing%20parameters%20and%20must%20remain%20consistent%20across%20the%20cluster.%20P_PAYLOAD_LENGTH_DYN_MAX%20defines%20the%20maximum%20payload%20length%20that%20any%20dynamic%20frame%20may%20use%3B%20it%20does%20not%20force%20every%20dynamic%20frame%20to%20have%20that%20length.%3C%2FP%3E%0A%3CP%3EDynamic-segment%20frames%20may%20carry%20different%20payload%20lengths.%20The%20actual%20length%20is%20specified%20in%20the%20payload-length%20field%20of%20the%20individual%20frame%20header%20and%20is%20expressed%20in%2016-bit%20words.%20Therefore%2C%20configure%20P_PAYLOAD_LENGTH_DYN_MAX%20for%20the%20largest%20required%20frame%2C%20and%20update%20the%20transmit%20message-buffer%20payload-length%20field%20before%20each%20transmission.%20Odd%20byte%20lengths%20require%20padding%20to%20the%20next%20even%20number%20of%20bytes.%3C%2FP%3E%0A%3CP%3EIf%20the%20FlexRay%20Unified%20Driver%20version%20being%20used%20fixes%20the%20payload%20length%20during%20LPDU%20configuration%20and%20does%20not%20expose%20this%20field%20through%20its%20transmit%20API%2C%20then%20freely%20changing%20the%20length%20for%20one%20configured%20LPDU%20is%20not%20supported%20directly%20by%20that%20driver%20interface.%20In%20that%20case%2C%20either%20configure%20multiple%20dynamic%20LPDUs%20with%20different%20lengths%20or%20modify%2Fuse%20the%20low-level%20message-buffer%20handling%20to%20update%20the%20frame%20header%20while%20observing%20the%20MPC5604P%20message-buffer%20locking%20procedure.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E