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.

TMS570LC4357: FlexRay integrating node into existing network

Part Number: TMS570LC4357

Hello,

I am currently trying to create a FlexRay node with the TMS570LC43x Hercules development kit, and the FlexRay interface board provided here : http://processors.wiki.ti.com/images/f/f5/HDK_FlexrayCanLin_Daughter_Crad.zip

I am running the demo code provided at the following link :http://processors.wiki.ti.com/index.php/TMS570LS31x_HDK_Kit#Example_Expansion_Board_Design

What I changed in it are the configuration parameters, because those are different for the network I am trying to connect, and I have removed the part where the controller enters the ColdStart mode, because since the network is already up, there is no need for this.

The network is produced by a VN7600 :https://www.vector.com/int/en/products/products-a-z/hardware/network-interfaces/vn7610/

which says that, as a feature, it does not need another node for coldstarting the network. I can inside of CANoe that flexray messages are being sent.

My problem then is this, how to integrate a new node using the TMS570LC43x in this network?

In my initial experiment the code stops at the following line:

   while ((Fray_PST->SIR_UN.SIR_UL & 0x4) == 0x0);    // wait for CYCS interrupt flag

I tried removing this check, since I though it was mainly useful when transmitting some data, and with this node I only want to read data from the bus.

Upon doing so, I checked most of the registers, and found that in the CCSV under POCS, the value was 39d = 0x27.

Under the documentation this state refers to the INTEGRATION_LISTEN state. Looking at the state diagram and at the conditions for which the node could exit that state, it says that it listens for a startup frame, and then exits to the following state.

This feels somewhat weird to me. Since the FlexRay network is already up and running, and the startup frames have already been sent, does this mean that it is not possible to add a new node after the network has already been started up? How could I configure my TMS570LC43x in order to integrate itself into a network that has already been coldstarted?

There is a lot of scattered information on flexray and I might be just missing out on something easy, but it would be great if somebody would have an idea about this.

Thank you,

Adrian.

  • Hi Adrian,

    How many nodes are in the cluster? In clusters consisting of three or more nodes, at least three nodes shall be configured to be coldstart nodes. In clusters consisting of two nodes, both nodes must be coldstart nodes. At least two fault-free coldstart nodes are necessary for the cluster to startup. Each coldstart node is also a sync node.

    The PLL2 should be used for flexray. The frequency for PLL2 should be configured as 80MHz.
  • Hi QJ,

    There are more than three nodes in the cluster, and more than three are configured as coldstart nodes, though not my TMS570 board, as I thought this was unnecessary since the network is already up and running.
    I will check the PLL2 to see whether or not it is configured properly.

    Although I am still not very clear whether what happens when connecting a node to a network that has already been coldstarted, since it is supposed to listen to some startup frames for synchronization that were already sent.

    Thank you,
    Adrian.
  • Hello,

    It seems that indeed the problem was more than likely the poorly configured PLL2. Now I have managed to integrate the node into the network and I am able to see in the new data registers that in the buffer that I configured I have some data.

    However, I still have some questions.

    1. In the example code, even when configuring a buffer as an RX one, after setting all the parameters, there is still a call to the Fr_TransmitTxLPdu, and I do not see why this is important, and how it affects everything.

    	// buffer #10
    	Fr_LPduPtr->fid  = 10;     // frame ID
    	Fr_LPduPtr->dp   = 0x240; // Pointer to start of data in message RAM
    	Fr_LPduPtr->cfg  = 0;    // RX frame
    	Fr_LPduPtr->crc  = 0;
    
    	Fr_LSduPtr->ibrh = 10;  // input buffer number
    
    	Fr_PrepareLPdu(Fray_PST, Fr_LPduPtr);
    	Fr_TransmitTxLPdu(Fray_PST, Fr_LSduPtr);

    This is a code snippet taken from the flexray example.

    2. How does the transfer between the message buffer data and output buffer registers happen?

    At the moment, I have tried to see whether the data received is changing, but in the output buffer registers ( RDDS ), there are only zeroes. I have changed the configuration from the demo to match what I have changed, since I only set one message buffer, the first one, as a receive message buffer.

          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] != 0x87654321) error++;

    3. In the example code provided when configuring the flexray module, the following lines are used to initialize the interrupts:

    	// Initialize Interrupts
    	Fray_PST->EIR_UN.EIR_UL       = 0xFFFFFFFF; // Clear Error Int.
    	Fray_PST->SIR_UN.SIR_UL       = 0xFFFFFFFF; // Clear Status Int.
    	Fray_PST->SILS_UN.SILS_UL     = 0x00000000; // all Status Int. to eray_int0
    	Fray_PST->SIER_UN.SIER_UL     = 0xFFFFFFFF; // Disable all Status Int.
    	Fray_PST->SIES_UN.SIES_UL     = 0x00000004; // Enable CYCSE Int.
    	Fray_PST->ILE_UN.ILE_UL       = 0x00000002; // enable eray_int1

    It can be seen that the register SILS_UN is set so that all the status interrupts are assigned to interrupt line eray_int0. However, when setting the ILE_UN register, by placing the value 0x00000002 just the eray_int1 interrupt line is enabled. My question is: shouldn't either both interrupt lines be enabled, or at least eray_int0, since all the status interrupts are assigned to it?

    Thank you,

    Adrian.

  • Hi Adrian,

    I assume you have solved your problem.