EtherCAT Slave  1.04.03
Setup

Software installation

  1. Install a Code Composer Studio for Sitara(TM) processors (CCS).
  2. Install a System Configuration Tool (sysconfig).
  3. Install an ArmĀ® code generation tools - compiler (ARM-CGT)
  4. Install a Software Development Kit (SDK) AM243X with demos and device description ESI files

for details see Getting started

Connect the development board

TMDS243GPEVM/TMDS64GPEVM

Board details: TMDS64GPEVM, TMDS243GPEVM

  1. Setup a dip switches on the board : 25MHz, No-boot / Dev-boot.

    No boot mode
  2. Connect the evaluation board to your computer using the micro-USB cables.

    One USB cables is required for the JTAG interface (XDS110), a second cable for the UART console.

    USB connectors on the AM64x/AM243 GP EVM Board
  3. Connect an ethernet cable from a PC running the TwinCAT to EtherCAT IN/Port0 of the PRU-ICSS on the development board.

    EtherCAT ports
  4. If you have multiple devices in chain, please connect from EtherCAT OUT/Port1 to IN/Port0 of next device. For the last device in chain, OUT/Port1 will be left open (if NOT using redundancy mode).
  5. Connect the board(s) to the power supply(ies) according to the specifications in the AM64x/AM243x GP EVM User's Guide Rev D

LP-AM243

Board details: LP-AM243

  1. Setup a dip switches on the board : No-boot / Dev-boot

    No boot mode
  2. Connect the evaluation board to your computer using the micro-USB cable.

    On the LP bards over the USB cable are connected the JTAG interface (XDS110) and the UART console.

    USB connector on the AM243x LP Board
  3. Connect an ethernet cable from a PC running the TwinCAT to EtherCAT IN/Port0 of the PRU-ICSS on the development board.

    EtherCAT connectors on the AM243x LP Board
  4. If you have multiple devices in chain, please connect from EtherCAT OUT/Port1 to IN/Port0 of next device. For the last device in chain, OUT/Port1 will be left open (if NOT using redundancy mode).
  5. Connect a USB Type-C Power Supply to the board

    Board power connector on the AM243x LP

Build an example

Simple demo

In the following instructions it is assumed the board LP_AM243. For other boards please choose always the right SDK and the example for your board.

Create an eclipse CCS project

  1. Click in menu File->Import
  2. Select Code Composer Studio->CCS Projects and click on the button Next.
  3. Click on the button "Browse"
  4. Select a directory with your installed SDK, e.g.: C:\ti\YOUR_SDK_VERSION_DIRECTORY\examples\industrial_comms\ethercat_slave_demo

    Import project
  5. Select the ethercat_slave_simple_demo...
  6. Click on the button Finish

Compile a simple demo project

  1. Left Click on the project ethercat_slave_simple_demo_...
  2. In the menu select Project->Build Project
  3. In the Console shall be show a message **** Build Finished ****

    Build project output

Load a simple demo over the JTAG debugger

  1. In the menu click View->Target Configurations
  2. In the new opened window right click on Projects->ethercat_slave...->targetConfigs->AM....ccxml

    WARNING: This is not the LP board!!!

    CCS Target configuration
  3. In the popup menu select Launch Selected Configuration.
  4. A debug window will open.

    CCS Launch selected configuration
  5. Click in the menu View->Scripting Console
  6. In the Scripting Console type :

    loadJSFile "C:\ti\YOUR_SDK_VERSION_DIRECTORY\tools\ccs_load\am64x_am243x\load_dmsc.js"

  7. In the Scripting Console shall be a message Happy Debugging!!
  8. In the menu select Run->Load->Load program

    CCS Load program
  9. Click on the button Browse project
  10. Select a program and click OK.

    CCS Select a program
  11. Click OK in the window "Load Program".

Run the program

  1. Open your favorite terminal application
  2. Select the USB COM port with a name COM15 (XDS110 Class Application/User UART (COM15)). Or an another assigned COMXX port with this name on your machine.
  3. Setup the terminal :

    • Baudrate : 11520
    • Data size : 8
    • Parirty : No
    • Stop bits : 1

    And start the terminal.

  4. In the CCS click in the menu Run->Resume
  5. In the terminal you should see a similar output :
Local Implementation
Pruicss max =1 selected PRU:1
Did Map 0x30080000 len 0x2000 to 0x30080000 (dram0)
Did Map 0x30082000 len 0x2000 to 0x30082000 (dram1)
Did Map 0x300b4000 len 0x100 to 0x300b4000 (iram0)
Did Map 0x300b8000 len 0x100 to 0x300b8000 (iram1)
Did Map 0x30090000 len 0x10000 to 0x30090000 (shdram)
Did Map 0x300a2000 len 0x400 to 0x300a2000 (control0)
Did Map 0x300a4000 len 0x400 to 0x300a4000 (control1)
Did Map 0x300a0000 len 0x2000 to 0x300a0000 (intc)
Did Map 0x300a6000 len 0x2000 to 0x300a6000 (cfg)
Did Map 0x300a8000 len 0x2000 to 0x300a8000 (uart0)
Did Map 0x300ae000 len 0x2000 to 0x300ae000 (iep)
Did Map 0x300b0000 len 0x2000 to 0x300b0000 (ecap0)
Did Map 0x300b2000 len 0x400 to 0x300b2000 (mii_rt)
Did Map 0x300b2000 len 0x1c00 to 0x300b2000 (mdio)
Creating thread <Appl_LoopTask> at Prio 7
Did create thread <Appl_LoopTask> at Prio 7 with id 0x700ef588
Phy UnReset: 0.20
Phy UnReset: 0.73
pRegPerm = 0x30082000, dram1=0x30082000, offset = 0x00000000, size = 0x00001400
Phy Reset: 0.20
Phy Reset: 0.73
Phy UnReset: 0.20
Phy UnReset: 0.73
Configure Phy bits: PhyAddr:3, LinPol:HIGH, PhyAddr:15, LinPol:HIGH, (0x0)
Z:/kb_stack/kb_pru_integration/phyLib/src/pru_phy.c:172 Phy 3 alive
Z:/kb_stack/kb_pru_integration/phyLib/src/pru_phy.c:172 Phy 15 alive
Phy 3 : Disable RGMII mode
Phy 3 : Disable GBit ANEG
Phy 15 : Disable RGMII mode
Phy 15 : Disable GBit ANEG
0x3:Link up
Phy 3 : Enable AutoMDIX
Phy 3 : Restart ANEG
Phy 3: BMSR post ANEG: 796d ANEG:Complete Link:Yes
Phy 15 : Enable AutoMDIX
Phy 15 : Restart ANEG
Phy 15: BMSR post ANEG: 7949 ANEG:NComplete Link:No
PHY Disable Magnetics
PRU ESC: Rev 0590 | Bld 04F2 | INTC base: 0x300a0000 , id = 0x4e82a900
INTC.HIDISR addr: 0x300a0038
Creating thread <BEPDItask> at Prio 12
Did create thread <BEPDItask> at Prio 12 with id 0x700e3520
Creating thread <BESync0Task> at Prio 13
Did create thread <BESync0Task> at Prio 13 with id 0x700e5520
Creating thread <BESync1Task> at Prio 13
Did create thread <BESync1Task> at Prio 13 with id 0x700e7520
Creating thread <BELedTask> at Prio 10
Did create thread <BELedTask> at Prio 10 with id 0x700e9520
RxPDO created 0x1600: 0x70002038
RxPDO created 0x1601: 0x70002140
TxPDO created 0x1A00: 0x700021d8
TxPDO created 0x1A01: 0x700022e0
Creating thread <kbEepromTask> at Prio 11
Did create thread <kbEepromTask> at Prio 11 with id 0x700f1520
PHY Enable Magnetics
Z:/DemoApps/EtherCAT_Slave/EtherCAT_Slave_Simple/src/ecSlvSimple.c:1101 PDO Out Len: 0x40
*********************************************************************
Numeric Version: 0x01000000
Friendly Version: <KB EC Slave Stack v01.00.00.00 >
*********************************************************************
State change: 0x0 -> 0x1
ssc_CheckTimer:MaxD:9291580 (9)
ssc_CheckTimer:MaxET:21
ssc_CheckTimer:MaxD:9999760 (9)
ssc_CheckTimer:MaxD:10003355 (10)
ssc_CheckTimer:MaxD:10098075 (10)

The application is running, a next step is to connect a PLC.