This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357: Flexray Drivers

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Tool/software: Code Composer Studio

Hello TI Team,

I have an application that requires Flexray. Inside Halcogen there doesn't look like there is support for Flexray drivers. Is there a Halcogen update to include this? Is there a timeline where this will be available? 

Thank you

Robert Liu

  • Hello Robert,

    You are correct that HalCoGen does not support FlexRay driver generation. As far as I am aware, there are no plans to add support for FlexRay to the HalCoGen tool. However, there are several threads within the forum that discuss developing the FlexRay drivers that you may find helpful. The one at this link e2e.ti.com/.../838495 has a zip file with some example code that could be used as a good start even though it is written for the LS20x device in the Hercules family.

    Once you have a look through some of the posts and through the example code, if you still have questions, let me know and we will assist in working through any additional questions/roadblocks.
  • Hello Chuck,

    Thanks for the response. I will try to get the example working. Do you by chance know if there is a FIBEX file associated with the example that you attached?

    Robert Liu
  • Hello Robert,

    I've reached out to one of our FlexRay experts and they state that there is no FIBEX file included. They also mentioned that they have an example for TMS570LS3137 that they developed for the rail industry. They are looking at stripping it down to the basics for simplicity and will post that once they have it completed.
  • Hello Robert,

    Attached is the sample project for Flexray on TMS570LS3137. This project can be use for any node in your Flexray network, but you need to modify the node number in main().

    Regards,

    QJ

    6646.TMS570LS3137_FlexRay_Example.zip

  • Hello QJ Wang,

    I know its been a long hiatus since we last discussed flexray. However I tried picking up the code you have and I have some questions. When you are writing the payload for the buffers I notice that your payload size changes. However for static frames you must have the same size. Are you defining dynamic or static frames in the below piece of code? How do you differentiate a static and dynamic message definition?

    // write payload for buffers
    if(node <= SYNC_NODE)
    {
    // buffer #0
    write_buffer->ibrh = 0; // input buffer number, sync buffer
    (Fray_PST->WRDS[0] = sync_data[node-1][0]); // Data 1
    (Fray_PST->WRDS[1] = sync_data[node-1][1]); // Data 2
    Fr_TransmitTxLPdu(Fray_PST, write_buffer);
    }

    // buffer #DATA_BUFF_BASE
    write_buffer->ibrh = DATA_BUFF_BASE; // input buffer number DATA_BUFF_BASE, data buffer
    (Fray_PST->WRDS[0] = trans_data[node-1][0]); // Data 1
    (Fray_PST->WRDS[1] = trans_data[node-1][1]); // Data 2
    (Fray_PST->WRDS[2] = trans_data[node-1][2]); // Data 3
    (Fray_PST->WRDS[3] = trans_data[node-1][3]); // Data 4
    (Fray_PST->WRDS[4] = trans_data[node-1][4]); // Data 5
    (Fray_PST->WRDS[5] = trans_data[node-1][5]); // Data 6
    Fr_TransmitTxLPdu(Fray_PST, write_buffer);

    Furthermore when I try only changing the flexray parameters for both nodes I get no communication. Compared to the example code I am able to get successful communication. See below flexray parameters. And resulting register sets:

    Fr_ConfigPtr->gtu1=0x00030D40
    pMicroPerCycle = 200000d

    Fr_ConfigPtr->gtu2=0x00050ADA
    gSyncodeMax = 5h, gMacroPerCycle = 2778d = 0ADAh

    Fr_ConfigPtr->gtu3=0x00030E0E
    gMacroInitialOffset = 3h, pMicroInitialOffset = 14d = Eh

    FR_ConfigPtr->gtu4=0x0AD10AD0
    gOffsetCorrectionStart - 1 = 2769d = AD1h, gMacroPerCycle - gdNIT - 1 = 2768d = AD0h

    Fr_ConfigPtr->gtu5=0x34020005
    pDecodingCorrection = 52d = 34h, pClusterDriftDamping = 2h, pDelayCompensation = 5h

    Fr_ConfigPtr->gtu6=0x00510168
    pdMaxDrift = 81d = 51h, pdAcceptedStartupRange = 360d = 168h

    Fr_ConfigPtr->gtu7=0x0033001D
    gNumberOfStaticSlots = 51d = 33h, gdStaticSlot = 29d = 1Dh

    Fr_ConfigPtr->gtu8=0x01020005
    gNumberOfMinislots = 258d = 102h, gdMinislot = 5h

    Fr_ConfigPtr->gtu9=0x00000202
    gdDynamicSlotIdlePhase = 0, gdMinislotActionPointOffset = 2, gdActionPointOffset = 2h

    Fr_ConfigPtr->gtu10=0x025900D8
    pRateCorrectionOut = 601d = 259h, pOffsetCorrectionOut = 216d = D8h

    Fr_ConfigPtr->gtu11=0x00000000
    pExternRateCorrection = 0, pExternOffsetCorrection = 0, no ext. clk. corr.

    Fr_ConfigPtr->succ2=0x02061F32
    gListenNoise = 2h, pdListenTimeout = 401202d = 61F32h

    Fr_ConfigPtr->succ3=0x00000022
    gMaxWithoutClockCorrectionFatal = 2h , passive = 2h

    Fr_ConfigPtr_prtc1=0x832D059B
    pWakeupPattern = 33d = 21h, gdWakeupSymbolRxWindow = 301d, BRP = 0, gdTSSTransmitter = Bh

    Fr_ConfigPtr->prtc2=0x3CB4323B
    gdWakeupSymbolTxLow = 60d, gdWakeupSymbolTxIdle = 180d, gdWakeupSymbolRxLow = 50d, gdWakeupSymbolRxIdle = 59d

    Fr_ConfigPtr->mhdc=0x00ED0011
    pLatestTransmit = 237d = 0EDh, gPayloadLengthStatic = 17d = 11h