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.

TMS320F28388D: EtherCAT - Create a slave project using F28388D Sample project

Part Number: TMS320F28388D

Hi everyone,

I re-create a new post, I though I resolved my issue, but not.

I am struggling to create a slave project from scratch with the F28388D.

All the EtherCAT examples are working. Now I would like to send one 16 bit variable called "Value" and receive one 16 bit variable "Result". The documentation ET9300 is far from straightforward for me. 

  • I start SSC and create a New Project. Select the TI F2838x CPU 1 Sample (Includes Sample Application)

 

Got the message:

"Patch file cannot applied because configuration version (5.12) not match current SSC version "

I continued...

  • I set the VENDOR_ID, VENDOR NAME VENDOR IMAGE and DEVICE_NAME:
  • Create a new application description file (Tool-> Application->Create new)
    An Excel sheet open.
    I filled it as below:


  • I close the excel
  • Create the slave files (Project -> “Create new Slave Files”)
  • Change the source folder for the cpu1_echoback_solution ( this is the one where I want to start with)
  • Open CCS, Project->Import CSS Project ->f2838x_cpu1_echoback_solution

  • Check ecat_def.h, the VENDOR ID is the same as the SSC Slave setting.
  • Remove the old CPU1_echoback_solution.,.h and Object.h and just keep my "new app"
  • Compile, everyhting is good.
  • Now I have to implement the input and output mapping in my New App.c:
    uint16_t j = 0;
        uint16_t *pTmpData = (uint16_t *)pData;
        uint16_t data;
    
    
       for (j = 0; j < sTxPDOassign.u16SubIndex0; j++)
       {
          switch (sTxPDOassign.aEntries[j])
          {
          /* TxPDO  */
          case 0x1A00: // 8 bits
              data = Result0x6000;
    
              * (volatile uint16_t *)pTmpData = data;
    
             break;
          }


    I received the error:


    I don't understand what is wrong, Result0x6000 should be generate by SSC using my excel sheet.

    Thank you
     
  • Hey Hal, 

    We have received your query and will get back to you shortly.

    Sahil.

  • Hey Hal, 

    It seems the variable is not initialised to Result0x6000 directly from the Excel sheet instead as Obj0x6000. (Seems to be an issue with the SSC Tool)

    An easy fix would be the following:

    Go to "F2838x CPU1 New AppObjects.h"

    Locate the Object Variable Definition and make the change

    //*********For variable Result************
    /**
    * \brief Object variable
    */
    PROTO TOBJ6000 Obj0x6000
    
    //
    //      Change to
    //
    
    PROTO TOBJ6000 Result0x6000

    Similarly for the variable Object

    //*********For variable Value************
    /**
    * \brief Object variable
    */
    PROTO TOBJ7000 Obj0x7000
    
    //
    //      Change to
    //
    
    PROTO TOBJ7000 Value0x7000

    Hope this helps.

    Sahil.

  • Thank you very much Sahil, I should have found that! Smiley

    Other question, where to find the .bin to program the EEPROM?

    I created my ESI file and I put it in the TwinCAT folder . Then I am supposed to update the EEPROM of my slave with the new ESI. The thing is on TwinCAT if I go to my Box->EtherCAT->Advanced Settings->ESC Access->Smart View-> Write EEPROM and browse, the file extension needed is a .bin:

    The ESI file generated by SSC is .xml file not a .bin, I am confused, where I am supposed to find the .bin?

    There is another way I found to program the EEPROM is by using SSC Tool instead of TwinCAT byt going to Tool->EEPROM Programmer

    I have been able to open my F2838x CPU1 New App.XML and program my slave.

    Is there any difference between those two methods?

  • Hey Hal,

    To program the EEPROM using XML file:

    As is mentioned in the EtherCAT_Slave_Controller_User_Guide (found at c2kware\libraries\communications\Ethercat\f2838\docs) 

    "Copy the ESI file (F2838x CPU1 EtherCAT Slave.xml) generated by the SSC tool into the TwinCAT directory (Default location: C:/TwinCAT/3.1/Config/Io/EtherCAT) If the TwinCAT application is already opened, it must first be closed and re-opened for the ESI file to
    be discovered."

    On doing this, in TwinCAT if you go to Box->EtherCAT->Advanced Settings->ESC Access->Smart View-> Write EEPROM, 

    Under Texas Instruments Incorporated -> TI C28xx Slave Devices -> [Name of your XML file]

    Click OK to program the EEPROM.

    There is another way I found to program the EEPROM is by using SSC Tool instead of TwinCAT byt going to Tool->EEPROM Programmer

    This is an alternate way, as mentioned in the ET9300, and is perfectly valid.

    Hope that helps. In case this answers your query, click Resolved so that the thread can be closed.

    Sahil.

  • Perfect thank you Sahil, I have been able to see my variables, everything is working now!

    I am still curious what is the difference between .bin vs .xml?

    The EtherCAT TI examples are .bin not xml:

  • Hey Hal,

    The .bin format displays the actual data that will be programmed. The .xml format is human readable which the SSC Tool probably converts to some sort of binary and programs the EEPROM.

    In the user guide, you can see that the .bin files have been generated for the HAL PDI examples for demonstration, but for the echoback examples, using the .xml files is recommended.

    Both ways achieve the same function, the latter is just more convenient.

    Sahil.