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.

AM335x Ethernet communication with PC under RTOS

Other Parts Discussed in Thread: SYSBIOS, PROCESSOR-SDK-AM335X

Hello,


I am currently working AM335X ICE V2 board in which I need to do ethernet communication with the PC using an Android application. It is a simple application in which PC send commands to Am335X board and the board will do some action based on commands. The communication interface between AM335X and PC is ethernet connection.


I don't know whether TI provides API's or any example projects based on AM335X board for Ethernet communication with the PC.

Can anybody please help me in providing some example projects or some reference document which is helpful is doing the above.

Thanks and Regards,

Mohit

  • Hi,

    Android is no longer supported by TI. For support please contact third-party BSP provider Adeneo Embedded.
  • Hi,

    Thanks for the reply.

    Actually, it's my fault that I am not able to tell the problem. I am using AM335X ICE V2 board in which I need to do ethernet communication between PC and AM335X board by software programming on AM335X. The ethernet Communication is simple in which some commands are received from PC by AM335X and then based on that commands AM335X will do certain operations.That's the top level picture.

    To do the Ethernet Communication on general processor we need to do all the socket level programming , ethernet packet parsing and so on. I want to know if TI provides example projects or API's to do ethernet communication on AM335X board or from somewhere I can get any help to do this programming for AM335X board.

    I hope I made myself clear.

    Please let me know in case of any confusion.

    Thank you,
    Mohit
  • Hi,

    Ok. I am using the RTOS SDK. Do we also the example projects of Ethernet Communication in that RTOS SDK in AM335X.
  • The RTOS team have been notified. They will respond here.
  • Hi,

    Can anybody please help me in solving this ?

  • Hi Mohit,

    If you are using PROCESSOR-SDK-RTOS-AM335X  03_01_00_06 (  PDK 1.0.4 ) which is available at http://software-dl.ti.com/processor-sdk-rtos/esd/AM335X/latest/index_FDS.html

    Perhaps the best example for this case is the NIMU_BasicExample_evmXXXX_armExampleproject that runs on the CPSW interface. This is described in the Processor SDK RTOS NDK section ( http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_NDK )

    David

  • Hi David.

    Thanks very much for your time.

    Actually I am using this sdk for development : am335x_sysbios_ind_sdk_1.1.0.8. Can you please tell me example project from this sdk?

    Thanks again.

    Thanks and Regards,
    Mohit
  • Hi Mohit

    SYSBIOSSDK-IND-AM335X: SYSBIOS Industrial SDK for AM335x Processors v1.1.0.8 is an older version of the SYSBIOSSDK-IND-AM335x v1.x.x.x which is a maintenance release that is being supported for existing legacy industrial ethernet customers.

    If you are a legacy customer that must stay on the SYSBIOSSDK-IND-AM335X branch then we recommend moving to the latest release to get the most recent updates.

    The link to the latest SYSBIOSSDK-IND-AM335x and SYSBIOSSDK-IND-SITARA releases are at www.ti.com/.../sysbiossdk-ind-sitara .

    New industrial communications designs on AM335x and AM437x should use SYSBIOSSDK-IND-SITARA v02.x at the link above.

    New non-industrial communications designs should use the Processor SDK v03.x. at www.ti.com/.../PROCESSOR-SDK-AM335X .

    Both the maintenance release SYSBIOSSDK-IND-AM335x and the active SYSBIOS-IND-SDK has a Ethernet/IP example. The SYSBIOSSDK-IND-AM335x supports both the CPSW and PRU-ICSS use. The SYSBIOS-IND-SDK example uses the PRU-ICSS. The PRU-ICSS implements a e PRU-ICSS to implement a high performance industrial EthernetThis is based upon the Network Development Kit (NDK) and a Molex stack . The Ethernet/IP application can be modified to work as a Switch application by removing the Ethernet/IP dependencies.

    The maintenance release SYSBIOSSDK-IND-AM335x also contains a enetLwip_sysbios example.
    This is a sample application demonstrating Ethernet and TCP/IP functionality, using lwip as TCP/IP stack and CPSW ethernet interface. This is a relatively low performance implementation using the community supported LWIP software.

    There are a number of e2e posts that will help you evaluate and if you choose to - use the LWIP example

    e2e.ti.com/.../554174
    e2e.ti.com/.../497894
    e2e.ti.com/.../313845
    e2e.ti.com/.../399642
    e2e.ti.com/.../552066
    e2e.ti.com/.../1092940
    e2e.ti.com/.../904675

    If you must use 1.01.00.08 -  the software and documentation is maintained at:

    http://downloads.ti.com/sitara_indus/esd/AM335x_SYSBIOS_Industrial_SDK/01_01_00_08/index_FDS.html

    There is a Sitara FAQ which will help you that is available at http://processors.wiki.ti.com/index.php/FAQ_Sitara_Industrial


    David

  • Hi David,

    Thanks very much for your suggestion. We really like your point.

    My main concern is only this we are using EtherCAT application which TI has provided from Acontis application and on top of that we did some modifications to make it compatible with the slave we are running.

    By upgrading our SYSBIOSSDK-IND-AM335X from 1.1.0.08 to 3.x something I hope we don't need to modify in our EtherCAT application.

    Can you please give us some insight that is what all we do we need to change n terms of TI tools to modify our Industrial SDK from 1.x to 3.x
    Right now we are using the following :

    am335x_sysbios_ind_sdk_1.1.0.8
    bios_6_41_04_54
    xdctools_3_31_03_43_core

    Please help me in clarifying this. Thanks very much for your time and patience.

    Thanks and Regards,
    Mohit
  • Also, David one more help :

    There is an another example project by the name of ethernetip_adapter. So, what is exactly difference between the lwip and ethernetip_adapter project ?

    thanks and regards,
    Mohit
  • Hi Mohit

    Each ISDK release contains a user guide, a quick start guide and the release notes. The tools that are needed for the release are specified in the user guide . The user guide and release notes contain good information on the features and applications that are contained in the release. The user guide also describe each of the example applications.

    For Ethernet/IP there is also white paper www.ti.com.cn/.../spry249a.pdf which provides a good overview of the application. This is a large application which may be difficult to integrate with the EtherCAT master.

    The user guide has a description of the LWIP example. Additional information on LWIP is available at savannah.nongnu.org/.../ and other LWIP user supported sites .

    However you have brought up an interesting point. I would check with Acontis to see if they have any recommendations for which ISDK version to use and if their package can offer some options to support your development.

    David

  • Hi David,

    Thanks for your time and I am very thankful for your time to help me.

    Can you please check from Acontis about the last message.

    Also, I have just checked it in User Guid that Lwip Application suports only eth0 communication. Is it possible to use eth1 for this communication.

    Because as of now we planned communication like this :

    PC --> ICE_V2_BOARD (AM335X) (using eth1) and then ICE_V2_BOARD (AM335X) --> EtherCAT slave (using eth0).

    So, can you please help me in letting now is it possible to eth1 for Lwip application?

    Thanks and Regards,
    Mohit
  • Hi
    I appologize - I should have said that you can check with Acontis.
    I believe that it is possible but it will take some development -- let me confirm with our team
    David
  • Hi David,

    Thanks for your time.

    Can you please check with the team what if its possible and also what are the changes that I need to do to support this configuration ?

    Thanks and Regards,
    Mohit
  • Hi David,

    Any update on the previous query. Whether it is possible to use Eth1 connection for lwip application?

    Thanks and Regards,
    Mohit
  • Mohit

    I communicated with Acontis.
    Since the CPSW has only one single MAC with switching functionality they recommended adjusting the SYS/BIOS Ethernet driver so it can co-exist with the EtherCAT master link layer. They have done this for Linux but not for SYS/BIOS. This could be done for a price.

    David
  • Hi David,

    Thanks for the reply and thanks for taking out time for me.

    I don't clearly understand what adjustments in SYS/BIOS are you talking about in the previous mail. Can you please explain what changes that I need to do in the ethernet driver.

    Awaiting for your response.

    Thanks and Regards,
    Mohit
  • Also one more point is it possible to use eth1 in lwip example project for ethernet driver ?
  • Hi David,

    Can you please reply. I would be really thankful to you.

    Thanks and Regards,
    Mohit
  • Hi Mohit,

    I apologize for the delay in responding. We have a number of people out on holiday during this time of the year. Regretfully our response will be slow until the first of the year.

    Regretfully there is not a TI based solution which we can recommend to integrate with the Acontis software.

    However Acontis has indicated that they can offer a solution which will support conventional Ethernet communications on the other CPSW port.. They have implemented this on previously on Linux.

    If you contact Acontis they can discuss this with you further.

    David

  • Hi David,

    Thanks again for your time. I really appreciate and thankful to you for helping me in this.

    Let me try to explain the application which I am going to create , so that I can clearly explain the program. My application will do something like this ICE_V2_BOARD will receive command from eth1 connected to PC through the Android program to enable the EtherCAT master which is connected to the board on eth0 after that EtherCAT application will initialised and so on. That means my point is that both CPSW ports are not communicating simultaneously but one after the other. First eth1 communication will be done and in that communication the EtherCAT master stack is not initialised and not running. After the eth1 communication is over then eth0 communication will start between etherCAT Master stack and slave and during this no eth1 communication will be happeing. I feel that in this communication single MAC application will do our job. If not, please help me understand why is not possible ?

    Also, in lwip application I have checked that there is macro defined by the name of DUAL_MAC something like this. What is the significance of this macro ?

    Second question, can you plz tell me is eth1 communication is possible in lwip application, also in a short explaination can you please explain what are the changes that I need to do?


    I really appreciate your patience and time that you are giving for me.

    Thanks David.

    Regards,
    Mohit
  • Hi David,

    Any response to the previous questions.

    Thanks for your time.

    Regards,
    Mohit
  • Hi Mohit, David is currently in vacations, so I will jump here with a 5-cents comment. From the thread I got you would need acontis EcMaster, plus TCP/IP. However, EoE is not an option because you will start/stop EcMaster via TCP/IP (PC connected to the master).  

    As David mentioned, CPSW is only one single MAC with switching functionality, the only option would be to adjust the SYS/BIOS Ethernet driver so it can co-exist with acontis EcMaster link layer, but this development has some cost associated. The good news is that acontis already have this done for Linux.

    Do you think it is an option to move your project to linux? if so, you can download EcMaster from acontis webpage 

    If you would like to pursue EcMaster Linux alternative, an small advice is to keep in mind to rebuild TI's linux kernel in order to disable CPSW module, some background below: 

    2.3.5.5 CPSW

    Due to lacking unbind-feature of the CPSW driver, the target’s Kernel must not load the CPSW driver when starting. If the CPSW was built as a module, it can be renamed to ensure, it never gets loaded. If it was compiled into the Kernel, the Kernel needs to be recompiled without it.

    No sure if there is any additional reason to stick with RTOS for this project, but if not, I personally think it would be easier to move to Linux instead of creating a complex application (or modify drivers) in order to switch between TCP/IP and EtherCAT traffic.

    Thank you,

    Paula 

  • Hi Paula,

    Thanks for your reply. Also I would like to wish you and David and the families a Merry Christmas .

    Yes we can move to Linux if it is easier to move on. This means that we have already tested the EcMaster code on Windows RTOS , but after checking the Acontis EcMaster code for Linux , particularly for EcMasterDemo (there are two example code one is EcMasterDemo and other one is EcMasterDemo2). It is the same as RTOS.

    If we move to linux OS, then probably we will be using the Virutal OS i.e. VMBox having Ubuntu installation in it.

    Is it safe (i.e without too much of problems) to create EcMaster demo and Ethernet applications to run on Virtual OS ? Can you please tell us how we can run our application using CCS on Vitual Ubuntu machine on TI Board (the easiest method) probably?

  • I would be really grateful if someone can answer this quickly (may be Paula or David) . Thanks for your time.

    1. Also, is there an example project which TI has provided for Ethernet TCP/IP in Linux in similar manner it was provided in RTOS like lwIP application , so that my development of writing the Ethernet Application can be saved?

    2. Also, there are three flavours of SDk for Linux are available on the following path  which one is best suited for my project : http://www.ti.com/tool/PROCESSOR-SDK-AM335X 

    3. Also there are 2 example projects for EcMaster demo are available in acontis website for Linux one is EcMasterdemo and EcMasterdemo2. Can I use EcMasterdemo 

    is that good one for me .

    Thanks and Regards,

    Mohit

  • Hi,

    I have checked the Linux SDK's which are available for AM335X in the following link :
    www.ti.com/.../PROCESSOR-SDK-AM335X.

    Can you please help me in which SDK actually helps in this project.

    Also, I have checked the User guide to how to run the TI project from CCS in Linux , but I couldn't able to find the guide to how to run a Makefile based project for AM335X on TI board? Can you please help in that ?

    Thanks and Regards,
    Mohit
  • Hi,

    Any answers please.

    Thanks and Regards,
    Mohit
  • Hi Mohit, sorry for the delay, we have been OOO due to Holidays. Let me try to answer some of your questions. About moving to Ubuntu and WMBox, I would guess it s possible, but please double check with acontis as they created an optimized kernel module (atemsys.ko) for their driver

    Thank you,
    Paula
  • Hi Mohiht, about your other questions, some comments below:
    1) No sure if you can reuse all your current development, but, we are trying to have RTOS and Linux SDKs software structures as similar as possible so we (and users) can maximize code reuse.
    2) We have two linux flavor options RT and regular linux. My understanding is that acontis can work with both, but, I would test first non-RT version.
    3) I think for this question maybe it would be better to check with acontis whidh are the differences between EcMasterdemo and EcMasterdemo2. I think I tested EcMasterdemo. Maybe they explained in their doc user guide?
  • Mohit, about your question on how to rebuild the EcMaster in Linux please follow guidance from EC-Master_ClassB.pdf (attached). Below sections

    2.5 Compiling the EcMasterDemo

    2.5.3 OS Compiler settings

    2.5.3.3 Linux

    EC-Master_ClassB.pdf

    Also, you can check with acontis about an Eclipse CDT project for EcMasterDemo. Using and IDE might be easier for rebuilding the demo.

    Thank you,

    Paula

  • Hi Paula,

    Thanks for all the help. I really appreciate your time.

    Here are some short queries can you please quickly help me on this :

    1. How to disable the CPSW module in Linux Kernel ?
    2. Even if I need to rename the Linux SDK module , then where I can find the cpsw module binary to rename it ?
    3. Currently I am following the steps which are mentioned in the following link to rebuild the following components :

    Rebuild sources using the top-level makefile in the SDK root directory. For example:

    make all rebuilds all components in the SDK
    make linux configures and builds the kernel
    make u-boot-spl builds u-boot and u-boot-spl

    4. Also, I have been able to found out that EcMasterdemo project can be build from Eclipse CDT IDE , so I am thing of building this project on CCS
    Is the project settings for EcMasterdemo project on Windows based on RTOS and on Linux are same?
    Also, while running the binary on board we are using TargetConfiguration.ccxml file for loading the DSP Image, so how can we load the binary image
    on linux? I couldn't able to find anything specific to how to run the binary image on ARM core.

    5. The reason for asking for you about the EcMasterdemo and EcMasterdemo2 project is that whether these projects are dependant on CPSW module? as our prime reason to move from RTOS based project in Windows to Linux environment is that CPSW has only single layer MAC functionality , so acontis has already solution available to inter switch the MAC functionality in Linux environment . So we want to use that EcMasterdemo project which has EoE supported? Can you please help in this ?

    Thanks and Regards,
    Mohit
  • One more small doubt : There are two ARM projects which are available on acontis website i.e one is corresponding to ARM Compiler v6 and other one is ARM version 4 , if I understood it correctly from naming. Which one I need to take for AM335X ?
  • Mohit, I will try to answer as the best of my Linux knowledge, but I would suggest you to open a new thread on TI's Linux SDK processesor E2E for better answers.

    1) and 2) Not an expert, but I think CPSW driver is indeed built inside the kernel, not as module. Maybe you can try to unbinding first, but my guess is that you would need to rebuild  Linux Kernel and modify how the CPSW is included. Please check Linux Kernel User Guide for instrunctions on how to rebuild Linux Kernel. For changing configurations, please check section "Configuring the Kernel

    No sure if you need to rebuild atemsys kernel module as well, but if so you can follow:

    When I did the exercise of rebuilding atemsys module, I used SDK Kernel tree (no native) and CROSS_COMPILE. I am pretty newbie in Linux so I remember I first build a hello world module following this steps (Hello World Linux Kernel Module) before I was able to rebuild acontis atemsys.ko. 

    4) Not the EcMasterDemo project on CCS and Linux Eclipse IDE are not exactly the same, some libraries and configuration settings are different. For running the binary you have to load first atemsys module and then run the EcMasterDemo binary with the options you need, example below

    root@am335x-evm:~/ECmaster/Bin/Linux/armv6-vfp-eabihf# insmod ../../../Sources/LinkOsLayer/Linux/atemsys/atemsys.ko  

    root@am335x-evm:~/ECmaster/Workspace/Linux/EcMasterDemo/Debug# ./EcMasterDemo.bin -f eni.xml -t 10000 -v 3 -perf

    5) Please check with acontis (ecsupport@acontis.com), I think they can help you better on which version of the binaries demo to use.

    Thank you,

    Paula

  • Hi Mohit, you need to use armv6-vfp-eabihf

    From my notes:
    export ARCH=armv6-vfp-eabihf
    export CROSS_COMPILE=<your host’s cross-compile toolchain prefix>

    thank you,
    Paula
  • Hi Paula,

    Thanks very much for your time and replies.

    I will try to follow these steps and lets see how it works. But just for my understanding can you please let me know which is the easiest example project for sending & receiving the TCP packets on Ethernet link from the example projects in SDK so that I can use that to merge with EcMaster demo and use it for EOE application?

    I fell that this is the SDK which I need t install on Linux host machine to get that example project ? Please correct me if I am wrong.

    Here is the link :

    software-dl.ti.com/.../index_FDS.html in the section : AM335x RTOS SDK Essentials.

    Thanks again

    Regards,
    Mohit
  • Mohit, let me try to explain our SDKs. Currently we have two main flavors of Processor SDK which are Processor SDK RTOS and Processor SDK Linux. Also, under Linux we have RT-Linux.

    Processor SDK Linux and RTOS

    On the other hand we have Industrial SDK RTOS .

    Just FYI, In the future, Industrial SDK will be merged on Processor SDK. This is work in progress.

    We used Industrial SDK for acontis EC-master AM335x TI design. However, for Linux version of EcMaster please use Processor SDK Linux  (this link is for latest, but please confirm with acontis which release of Linux Processor SDK you should use).

    Thank you,

    Paula

     

  • Hi Paula,

    Thanks for helping me in understanding the things.

    Is using the Linux SDK without RTOS would by any means neglecting the advantages which RT applications have in using the RT version of Linux SDK ?

    Also, can I have any example project for ethernet application in Linux SDK ?

    Thanks for the help.

    Regards,
    Mohit
  • Mohit, I am not sure if I am understanding your first question, I guess you are asking if better to use RT Linux?. If so, I would advice first to use non-RT Linux version and when everything works, you can assest if RT is required or not. If so, then you can move your project to RT. I am not too familiar with our RT Linux version, but I think it could add a layer of complexity to your development which might not be required at the end.

    On the other hand, I would suggest you ask about the best demo to use as a baseline in our Linux E2E forum they know better their SDK than us (RTOS E2E support team) =)

    However, I found a couple of links which could be helpful

    Processor SDK Linux Ethernet Interface

    Linux Core CPSW User's Guide

    Sitara Linux Dual Emac Mode

    Thank you,

    Paula

  • Hi Paula,

    Thanks very much for your reply and time in answering my queries.

    Since its my first time I have been working on Linux SDK , so a lot of queries are being raised on this E2E forum.

    Thanks for answering each of them.

    Thanks and Regards,
    Mohit
  • Hi Paula,

    One quick query here : I know that you are not very experienced in Processor Linux SDK setup part , but someway or the other you must have installed that and know this point.

    In the point 6 for setting the Linux SDK part from the link :processors.wiki.ti.com/.../Processor_SDK_Linux_Getting_Started_Guide ie to Run the setup script. If you go inside the manual by clicking on the blue link. There is one detail which is mentioned related to the Clearing the eMMC for beagle bone black users. Since we are using the ICE_V2_BOARD not the beagle bone black EVM hardware, and the ICE_v2_BOARD doesn't boot it from eMMC (that's my understanding) ?
    Do I need to perform this point while running the setup.sh file ?

    Any idea is worthwhile for me to do that quickly.

    Any answers please.

    Thanks for your time.
  • Hi Mohit, I think AM335x setup.sh is customized for the different EVMs (GP, ICE, BBB) and you have to pick the right one or somehow specify the board you will use.. In summary, please avoid steps which are for BBB user or Keystone2 (K2H, K2K, K2L, K2E) users. Our Linux Processor SDK covers different boards, so instructions and guides try to be as general as possible for all users.

    On the other hand, it is highly recommended to use a development environment such us TFTP or NFS, but, if you want a quick start, you can use SD card for booting your board with the Linux SDK and just copy/paste the files and projects you create in your development Linux PC into the SD card. For quick testing.. If this works, then, you can setup your Linux PC and board so, the board can boot from SD card or TFTP, and can work via NFS for quicker development/debug.

    Linux Processor SDK - Create SDK Card

    Linux Processor SDK - Training labs

    Some videos - Extra information:

    Processor SDK Training Series

    thank you,

    Paula

  • Mohit, especially I recommend you this video (particularly starting from slide 10):
    software-dl.ti.com/.../index.html

    Thank you,
    Paula
  • Thanks very much Paula.

    I really appreciate your support in this.
  • Hi Paula,

    I am currently building the atemsys.ko library for EcMasterdemo application. For that I have exported the ARCH = arm (instead of armv6-vfp-eabihf as you have mentioned this in one of the other mails). I am able to build the atemsys.ko module using that ARCH. I have tried to include the ARCH = armv6-vfp-eabihf, but the Makefile in atemsys.ko looks for the path /arch/armv6-vfp-eabihf/Makefile , but this doesn't exist in the Linux kernel path which is this : /opt/ti-processor-sdk-linux-am335x-evm-03.02.00.05/board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8. Although the path /arch/arm/Makefile exists.

    I just need your guidance what can be the reason for this? I think you have earlier build EcMasterdemo on Linux , you must have an idea what could be the reason?

    Please help me to resolve this as soon as you can which will help me to move forward.

    Thanks again for your time.

    Regards,
    Mohit
  • Hi Paula,

    I have checked the following section :

    2.5 Compiling the EcMasterDemo

    2.5.3 OS Compiler settings

    2.5.3.3 Linux in EcMaster_ClassB.pdf. This section only mentions different source files,library paths and extra files which are required.

    But there is no mention given on how to build the EcMasterdemo project is it through Makefile or anything else? They didn't mentioned anything related to this ?

    From our past conversations, I feel that you must had build this project in Linux. Can you please tell me the same.

    Thanks and Regards,
    Mohit
  • Hi Paula,

    Can you please help me to resolve the above.

    Also, there is one more important point that I want to mention that I have already open a ticket in Linux for help in basic Ethernet project which I can use in Linux Processor SDK for my development. But there is no reply which was coming. This is the link :

    e2e.ti.com/.../565468. However few questions are raised in this but I have been able to resolve this except for the ethernet example application.

    Also, in SDK for Linux I have checked the example Applications folder but no project has been found for ethernet application which can be of use to me. Can you please help how we can proceed further on this ?
  • Hi Mohit

    I forwarded your Linux e2e questions to one of our Sitara Linux RT networking experts along with a link to this thread. He and some of the other experts in the Linux SDK will be able to help you.

    David
  • Hi David and Paula,

    Thanks very much for this.

    Can you just let me know how did you build the EcMasterdemo project on Linux? Is it through Makefile or Eclipse CDT?

    Since I cann't able to find any Makefile associated with this project?

    Thanks very much for your time.

    Regards,
    Mohit