Changing Payload length in FlexRay config

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

Changing Payload length in FlexRay config

1,691 Views
ramakr02
Contributor III

Hello Everyone,

Similar to the community post in FlexRay not starting after changing the Protocol settings , I'm trying to change the payload length to decimal '127' to transmit/receive 254 bytes (Maximum) of data. Naturally, this will have implications with other config parameter, I need help in setting other parameters which is affected by the change in G_PAYLOAD_LENGTH_STATIC.

Following is the details of the hardware used:

1. Development board: EVB9S12XF512E (S12XFSTARTERKITE: S12XF 2-Node Starter Kit)

2. Target Processor: MC9S12XF512MLM

3. Code: Low speed FlexRay example from https://www.nxp.com/downloads/en/snippets-boot-code-headers-monitors/EVB9S12XF512E_Node1_LS.zip 

I could not find the marked correct answer in similar post, milanbaca‌ indicated changes in payload and CRC in Fr_transmit_buffer_config_type Fr_tx_buffer_slot_XX_cfg structure. Are these the only changes to be done?, since the OP could not resolve their issue with said changes. The constraint for 'gPayloadLengthStatic' mentioned in the FlexRay specs doc is as following:

B.4.40 gPayloadLengthStatic
Consider the following assumption:
• The duration of a static frame transmission shall not exceed the maximum transmission duration of
a CC.
Therefore the following constraint must be met:
Constraint 55:
adTxStat[µs] <= adTxMax[µs]
with adTxStat being the upper bound for the static frame transmission duration, calculated by
[43] adTxStat[µs] = aFrameLengthStatic[gdBit] * adBitMax[µs/gdBit]
with the definition of aFrameLengthStatic as given in equation [22] in B.4.12.
Based on Constraint 55 and equation [43], the following constraint must be met:
Constraint 56:,
gPayloadLengthStatic[two-byte word] <= floor( (adTxMax[µs] / adBitMax[µs/gdBit] -
gdTSSTransmitter[gdBit] - cdFSS[gdBit] - 80 [gdBit] - cdFES[gdBit] ) /
20 [gdBit/two-byte word] ).

Requesting help in getting the config parameters correct, dianabatrlova‌, RadekS‌, milanbaca‌.

Thank you for your time.

Best regards,

Rohit

Tags (1)
4 Replies

1,529 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello Rohit,

This question requires detailed knowledge of the FlexRay protocol specification. Since this SW is older and no one currently working with it, I can provide you only information below:

When increasing gPayloadLengthStatic parameter, then the easiest way is to change the following parameters:

 

  • gdStaticSlot (grows with the gPayloadLengthStatic)
  • gNumberOfStaticSlots (reduce number of static slots to have the same length of static segment)

 

Additional parameters which has to be modified:

  • P_KEY_SLOT_HEADER_CRC
  • Header CRC for each Tx slot in static segment.

I hope it helps.

Best regards,

Diana 

1,529 Views
ramakr02
Contributor III

Hi Diana,

Thank you for the reply. I will work on the inputs in your message.

Proceeding with suggested changes to the parameters, I have one more question regarding the computation of header CRC. A similar post to the question is How to Calculate FlexRay Header CRC. The current structure in Example code (https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fdownloads%2Fen%2Fsnippe... )for slot 1 transmission is as follows:
const Fr_transmit_buffer_config_type Fr_tx_buffer_slot_01_cfg =
{
1, // Transmit frame ID
242, // Header CRC
16, // Payload length
FR_DOUBLE_TRANSMIT_BUFFER, // Transmit MB buffering
FR_STATE_TRANSMISSION_MODE, // Transmission mode
FR_STREAMING_COMMIT_MODE, // Transmission commit mode
FR_CHANNEL_AB, // Transmit channels
FALSE, // Payload preamble
FALSE, // Transmit cycle counter filter enable
0, // Transmit cycle counter filter value
0, // Transmit cycle counter filter mask
TRUE, // Transmit MB interrupt enable
TRUE // FALSE - interrupt is enabled at commit side, TRUE - interrupt is enabled at transmit side
};

I just want to know how decimal 242 is computed for header CRC? The header section could be as follows:

1. 0x00090 ; //frame ID =1, payload length=16, all other bits = 0
OR
2. 0xC0090 ; // in addition to above, synce frame and startup bits = 1

I tried using the usual CRC techniques (Ex-Or), but could not match decimal 242.

Requesting a little more of your time, dianabatrlova‌, RadekS‌.

Best regards,

Rohit

0 Kudos

1,529 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Rohit, 

I have found a very useful application to calculate CRC. see the attachment.

pastedImage_1.png

I believe it helps you.

Best regards,

Diana

1,529 Views
ramakr02
Contributor III

Thank you Diana, the application was exactly what i was looking for.

Best,

Rohit

0 Kudos