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:
Consider the following assumption:
• The duration of a static frame transmission shall not exceed the maximum transmission duration of
Therefore the following constraint must be met:
adTxStat[µs] <= adTxMax[µs]
with adTxStat being the upper bound for the static frame transmission duration, calculated by
 adTxStat[µs] = aFrameLengthStatic[gdBit] * adBitMax[µs/gdBit]
with the definition of aFrameLengthStatic as given in equation  in B.4.12.
Based on Constraint 55 and equation , the following constraint must be met:
gPayloadLengthStatic[two-byte word] <= floor( (adTxMax[µs] / adBitMax[µs/gdBit] -
gdTSSTransmitter[gdBit] - cdFSS[gdBit] - 80 [gdBit] - cdFES[gdBit] ) /
20 [gdBit/two-byte word] ).
Thank you for your time.
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:
- Header CRC for each Tx slot in static segment.
I hope it helps.
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
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.