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.

About Tms570 FlexRay

Other Parts Discussed in Thread: TMS570LS3137

HI:

I would like to ask some questions about the Flexray.
I was just beginning to learn to use TMS570 students who have not previously had contact with TI chips,and now
I download on the official community on FlexRay routines, it is that there are five nodes ABCDE routine chip I use is just TMS570LS3137 this film.
I used two nodes, nodeA andnode B , but found two nodes in transmit_check_node_x (FRAY1) inside

 Fray_PST-> SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int flags.
    while ((Fray_PST-> SIR_UN.SIR_UL & 0x4) == 0x0); // wait for CYCS interrupt flag
    Fray_PST-> SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int flags.
Stuck in while ((Fray_PST-> SIR_UN.SIR_UL & 0x4) == 0x0); here. I look at the discovery SIR ,SIR register val is 0;

I do not know how this is going. I read the information on the FlexRay period of time, but it`s hard to understand, and i dont know

the five node which  as a slave and which as the host.

I have some specific questions :

1. Function transmit_check_node_x (FRAY1) is used to do for what .


2. how can I  receive and transmit data, such as the host to send information to the slave ,and recive the data from other node . how to set the ID?


3. I find wake-up function does not seem to directly start, so it is ok?

Maybe my problem looks too  simple, but I really do not know how to use FlexRay, I hope some one  can give me some help in this regard, thanks very much!

  • Hi user4257646,

    Sorry I am having a hard time understanding the questions.  

    user4527646 said:
    I download on the official community on FlexRay routines, it is that there are five nodes ABCDE routine chip

    I don't know what example you are referring to.  

    user4527646 said:
    I used two nodes, nodeA andnode B ,

    What does your hardware setup consist of?

  • sorry  Seely, Forgive my poor English,My English is not well .

    i download the example code in TI WIKI.

    1:

    i download the  FlexRay_Communication_CCSv5.zip   in here :http://wiki.tiprocessors.com/index.php/TMS570_MDK_Kit

    there have five FlexRay Node Code in this packet:

    Antares_FlexRay_CCSv5_example_code_nodeA,

    Antares_FlexRay_CCSv5_example_code_nodeB

    ....

    Antares_FlexRay_CCSv5_example_code_nodeE

      i use the FlexRay Node A and Node B.

    I dont know how to send Data from Node A to Node B or Recive Data from other FlexRay Node .

     when i run the Code of Node A and Node B, i fine the code aways stay here :

    Fray_PST-> SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int flags.
    ->>> while ((Fray_PST-> SIR_UN.SIR_UL & 0x4) == 0x0); // wait for CYCS interrupt flag
     Fray_PST-> SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int flags.

    i chick the SIR register  value is 0x00000000 I dont konw that`s why ...

    2:

    My hardware include

    MCU:TMS570ls3137

    FlexRay drive :TJA1082

     Thank you !

  • Hi

    That helps quite a lot. The demo you pointed to is for a different device and different board.
    There does seem to be a demo for the TMS570LS3137 on this page:
    processors.wiki.ti.com/.../TMS570LS31x_HDK_Kit

    So you might want to start with that demo. The two parts are pretty compatible but maybe it's some slight difference that is causing you trouble.

    Ok aside from that the first thing I always question is whether the network is setup correctly.

    Not sure if you are using one of our HDK boards or Launchpads ... neither of which have FlexRay transceivers, or your own board. But in any case the transceiver in my mind is a big ? because it has to be hooked up correctly and maybe something is going wrong, there is a board you can check your schematic against here: processors.wiki.ti.com/.../HDK_FlexrayCanLin_Daughter_Crad.zip

    Then if it looks good here you should check what the signals on the network look like.
    Do you have the right kind of cabling and termination for example.
    This page might be useful: www.ni.com/.../

    I'd also want to get a capture of some of the waveforms on the bus lines just to make sure it all looks good.

    Because if messages are not getting across it would explain why polling might be stuck waiting for something that doesn't happen.

    If you get through all these things and no problems found I'd say then we need to ask for some inputs - as he authored these demos.
  • Hi,

    Attached is code modified for 2 nodes.

    Regards,

    QJ

    7024.FlexRay_2Nodes.zip

  • Hi  

    Im sorry reply so late.

    now i know the problem why i can't recive any date from other Node ,because the flexray drive  TJA1082 is broken .

    now i met a new problem , i hope you can help me.

    in function

     transmit_check_node_b(FRAY_ST *Fray_PST)

    {

    bc *write_buffer=&Fr_LSdu1;
    bc *read_buffer=&Fr_LSdu2;
    unsigned int ndat1;
    int error=0;
    write_buffer->ibrh = 0; // input buffer number
    write_buffer->stxrh= 1; // set transmission request
    write_buffer->ldsh = 1; // load data section
    write_buffer->lhsh = 0; // load header section
    write_buffer->ibsys = 0; // check for input buffer busy shadow
    write_buffer->ibsyh = 1; // check for input buffer busy host

    // wait for cycle start interrupt flag
    Fray_PST->SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int. flags
    while ((Fray_PST->SIR_UN.SIR_UL & 0x4) == 0x0); // wait for CYCS interrupt flag
    Fray_PST->SIR_UN.SIR_UL = 0xFFFFFFFF; // clear all status int. flags

    // write payload for buffers
    // buffer #2
    (Fray_PST->WRDS[0] = 0x12345678); // Data 1
    (Fray_PST->WRDS[1] = 0x87654321); // Data 2
    Fr_TransmitTxLPdu(Fray_PST, write_buffer);

    // buffer #10
    write_buffer->ibrh = 10;
    (Fray_PST->WRDS[0] = 0xFF); // Data 1
    (Fray_PST->WRDS[1] = 0xFFFF); // Data 2
    (Fray_PST->WRDS[2] = 0xFFFFFF); // Data 3
    (Fray_PST->WRDS[3] = 0xFFFFFFFF); // Data 4
    (Fray_PST->WRDS[4] = 0xFFFFFF00); // Data 5
    (Fray_PST->WRDS[5] = 0xFFFF0000); // Data 6
    Fr_TransmitTxLPdu(Fray_PST, write_buffer);

    .........

    };

    why in Node A I am only able to receive WRDS[0]  and WRDS[1], if  i shield the line of

     write_buffer->ibrh = 10; and keep  write_buffer->ibrh = 0, I am only able to receive WRDS[0]  to  WRDS[3],

    when i check the WRDS[4] and WRDS[x] (x>4),and i find WRDS[4]  Value is a Increasing number every time ,

    and WRDS[x](x>4) value is 0x00, why

    // check if a message is received in buffer 2 from node A

    if ((ndat1 & 0x2) != 0)
    {
    read_buffer->obrs=1; // output buffer number
    read_buffer->rdss=1; // read data section
    read_buffer->rhss=0; // read header section
    // Transfer message buffer 1 data to output buffer registers
    Fr_ReceiveRxLPdu(Fray_PST, read_buffer);
    if (Fray_PST->RDDS[1] != 0x000000FF) error++;
    return error;
    }

    why ndat1 & 0x2 if recive the data from Node A?

    thank you !

  • if ((ndat1 & 0x2) != 0) is used to check buffer2. The payload for buffer2 is 18 bytes. Only data in buffer2 are transfered to RDDS from FR RAM.

    Regards,
    QJ
  • HI QJ:

    Thx for your reply, 

    In addition to your FlexRay_2Nodes.zip file I am not able to import CCS.

    This display:

    See details below.
    Error: A project with the name 'TMS570_FlexRay_example_nodeB' already exists in the workspace!

    and I don't really understand what you mean

    (if ((ndat1 & 0x2) != 0) is used to check buffer2. The payload for buffer2 is 18 bytes. Only data in buffer2 are transfered to RDDS from FR RAM.),

    I try to change the PL to big , the code will run is not normal,  BP and  BM has no waveform, and I do not receive any data.

    if I want to send and receive a lot of data, how should I change your code?

    In the attachment, there is my Chinese question expression.

    thank you!.7510.appendix .docx

  • HI QJ;
    I have same problem as user4527646. How should i send or recive large data in your code ?

    looking for your quick reply . thx.