VIDEO SERIES
Networking using TI Arm®-based processors
Learn how our Arm®-based processors are used in networking.
Demonstrating EtherCAT Master on Sitara AM57x Gb Ethernet and PRU-ICSS
Presenter(s)
Resources
[ACOUSTIC GUITAR]
Hi. I'm going to present the EtherCAT master demo, running on TI's AM5728 IDK. This demo is based on a TI design. The TI design guide can be used along with this video in order to get the EtherCAT master demo up and running in your board in a shorter time.
We also have training series videos for the EtherCAT master on Sitara devices. We're encourage our viewers to take a look at these videos.
So the purpose of this video is to build and run the EtherCAT master protocol on TI AM5728 IDK board. In order to demonstrate connectivity between the master and a slave EtherCAT network, we will use AM3359 ICEv2 board as an EtherCAT slave. However, you can use any other EtherCAT slave or multiported slave for testing this demo.
Let's check we have all the hardware required for building and running the EtherCAT master demo. For these two boards, we will need their respective power supply adapters. We will also need an ethernet cable for connect them. A USB to micro-USB cable will be used for connecting the IDK board to a computer, and a micro-USB will be used for booting and loading the EtherCAT slave into the ICEv2 board.
Let's check which software we need to download and install for running the demo. First, we need Acontis EtherCAT master stack, and PRU-ICSS EtherCAT link layer library. In this link, you can get the latest version of Acontis EtherCAT master stack. This also includes a CCS project demo. Also from here, you can get the PRU-ICSS link layer.
You will also need the EC-Engineers tool. We will use it for creating the ENI file. Also, we need to download the processor SDK RTOS for AM57x devices. We need to have installed Code Composer Studio in the computer. And we need a terminal emulator. In my case, I am going to use Tera Term.
Now let's check which software we need for running the EtherCAT slave in the ICEv2 board. We will use a PRU-ICSS EtherCAT slave. Please download the prebuilt binaries. These prebuilt binaries are created with a specific processor SDK version.
You can see which version was used in the user guide. In this case, was used 4.00. Please go ahead and download this version of the processor SDK for AM335 devices. You can find the standards for Windows and Linux in the download webpage.
So how to run EtherCAT slave on ICEv2 board via SD card? So first, we need to create a bootable SD card. Please follow the instructions from this link. This link will guide you step by step, how you can create a bootable SD card for processor SDK binaries.
For this process, you will need a card image. This image can be found in the processor SDK prebuilt SDK cards in the card image folder. At the end of the process, you will have a bootable SD card. Now you are ready to copy the bootloader file and the application binary.
The bootloader file is also called MLO. This file can be found in the processor SDK prebuilt SD cards SD card files. Please copy this file to your SD card.
Now we will need the application binary-- in this case, the EtherCAT slave application. So please go to the prebuilt binaries that we already downloaded and unzipped, and copy the app binary on your SD card.
Now we are ready. We can take out the SD card from the computer, put it in the ICE version 2 board, and turn it on. You will see that the [INAUDIBLE] LED will light.
Now let's talk about how to create an EtherCAT Network Information file-- or ENI file-- using EC-Engineer tool. The steps are here, but we will do it also in the video.
Please open the EC-Engineer tool. Go to the online configuration. Select the class A master. Select the network adapter to which your EtherCAT network is connected. This will automatically scan for all the slaves, and the slave network will appear in the upper-left window.
Now you are ready to export the ENI file. Please save this ENI file inside of the EC master demo ENI folder. You can change the name of the file. In our case, we will use the ICEv2 board.
So what if my slave boards are not discovered? Then you will need to add the EC files through the EC manager. Open the manager. Process Add File, and navigate to your EC file. In our case, we will get the file from the EtherCAT slave EC folder.
The file that we will add is the TI EtherCAT library XML. So after the EC manager rebuilds the cache, we will see the file that we just added. We can close. Re-scan the network, and voila.
OK. Let's see how we can create the MasterENI.c file. Using the previous ENI file that we exported with the EC-Engineer tool and the bin2header tool. Please run this bin2header tool in a console window, with the below instructions.
This will create the MasterENI.c file, and will give us the file size. This file size needs to be added in a variable at the end of the MasterENI.c file, as shown here. Please save this new MasterENI.c file at this location.
In order to run the EC-Master demo on CPSW, please connect the board as shown here. OK. Let's open CCS. Let's go to File, Import. CCS projects. Next, browse through the directory on which you saved the EC-Master demo workspace folder. OK. And Finish.
Now you have the project in the CCS workspace. Clean the project, and build it.
So while we're building, let me show you a couple of files. We can double-check that the MasterENI.c file is the correct one-- the one that we just created. Yep. OK. We can also check how the demo is configured. Recycle time with the interface board, et cetera. This information is in the DemoConfig.h.
And OK. Now that we have built our ECMasterDemo.out, we can launch our target. This can take a few seconds. Now we can connect the ARM Cortex A15 core. This will run a GL file, so it clears for initialization.
Now we can load the executable that we just built-- the ECMasterDemo.out. OK. Now we are ready to run it. I have Tera Term connected. My board and my computer via the USB cable. If I press Play-- Resume, now the demo is running.
We can see there are some statistics, and some information of how the EtherCAT master is configured. So before we run the EC-Master demo in the PRU-ICSS board, we need to copy the link layer library inside of the EC-Master demo SDK libraries.
OK. Let's run the demo on a PRU-ICSS board. Please connect the boards as shown in the picture. In CCS Project Properties, in Libraries, please add Highlight Libraries to the project, with the respective paths to the PDK. Please also add the link layer ICSS symbol.
Now we are ready to build the project and run it. When you run it, you can see on top that it says that it's running the ICSS. The rest of the information is similar to what we saw before, when running the demo on the CPSW interface.
This concludes our how-to video. For additional information, please visit our EtherCAT master Reference Design on Sitara AM57x. Also, you can visit our training series for the EtherCAT master on Sitara processors.
If you have any question or any issue running this demo, please post it in our E2E forum. Thank you for watching.
[ACOUSTIC GUITAR]