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.

TCP/IP server (based on NDK) on AM335x

Other Parts Discussed in Thread: AM3359, SYSBIOS

Hi,

In a different project our customer needs to run TCP/IP server based on NDK on the AM335x.
But currently they are not able to communicate with the TCP/IP client.

We would like know the answers for the below queries.

1.Is it possible to run a TCP/IP server(based on NDK) on the AM335x ICE2 board?
2.In this case which sys_bios_driver(NDK) should be selected, is it CPSW or ICSS?
3.Which could be the good sample code to refer in this case? is it profinet_slave?
4.We tried to use the profinet_slave sample but we are not able to get the proper communication
(not able to ping and not able to communicate from a TCP/IP client)

Below in the software version used.
SYS/BIOS 6.35.4.50
NDK 2.22.3.20
AM335x_SYS/BIOS_IND_SDK_1.1.0.3

Please let us know if there are any suggestions.

Regards
Prad

  • Hi,

    Please find my comments

    1.Is it possible to run a TCP/IP server(based on NDK) on the AM335x ICE2 board?
    Yes, it is possible.

    2.In this case which sys_bios_driver(NDK) should be selected, is it CPSW or ICSS? 
    You have to chose one of them as per requirement. CPSW is a  hardware Gigabit switch module in AM335x. ICSS on the other hand is a low latency cut-thru switch implementation(10/100)

    3.Which could be the good sample code to refer in this case? is it profinet_slave?
    ethernetip_adapter would be a good sample code to refer. profinet_slave uses a protocol specific firmware(although TCP/IP communication will also work on this)

    4.We tried to use the profinet_slave sample but we are not able to get the proper communication
    (not able to ping and not able to communicate from a TCP/IP client)
    profinet_slave comes with no IP address as default, it should be programmed by a PN master. Please use ethernetip_adapter as an example.

    Regards,
    Vinesh

     

  • Moving this thread to the SYS/BIOS forum. NDK, IA SDK etc. are supported there.
  • Hi Vinesh,

    Thank you so much, these information are very helpful.

    We shall try to use the Ethernet IP example.
    I am little bit confused about how to use this example for normal Ethernet communication.
    In case of Ethernet/IP example, the code is based on the EtherNet/IP™(CIP) stack
    and what all the necessary modifications needs to be done in order to use this
    example for a normal Ethernet(TCP/IP) communication.

    Please let me know your suggestions.

    Regards
    prad

  • Prad,

    Ethernet/IP example is basically the protocol working over the standard TCP/IP stack. You can remove all EIP specific calls in the example for your use.

    As a start, commenting out these

    GetAssignedIP();
    EIPMain();

    would make sure that Ethernet/IP does not get initialized at all.

    Regards,
    Vinesh

  • Hi Vinesh,

    Thank you for the quick suggestion,
    I will try the Ethernet/IP example commenting out EIP specific calls and
    come back to you with the result.

    Regards.
    Prad

  • Hi Vinesh,

    I am trying to execute the Ethernet/IP example(ethernetip_adapter).

    As we need normal Ethernet(NDK) communication I have commented out
    GetAssignedIP(); EIPMain(); functions in the main.c as per your suggestion
    and also added "#define USE_CPSW_DRIVER" in order to use CPSW(RMII).

    The program builds fine and I am able to debug the project on ICEV2 board.
    The UART output shows the sample is running as shown below.

    ---------------------------------------------
    TI Industrial SDK Version - IASDK 1.1.0.3
    Device name : AM3359
    Chip Revision : AM335x ES1.2 [PG2.1]
    ARM Clock rate : 600
    SYS/BIOS Ethernet/IP (CPSW) Sample application running on ICE V2
    ---------------------------------------------

    Next I think we need to assign IP Address for the Port 1
    but don't know how to add the Static IP Address(similar to enetLwip_sysbios example)
    for ethernetip_adapter example.

    Could you please let me know what else should be added/modified inorder to
    check the normal Ethernet communication.

    Regards
    Prad

  • Prad,

              The application takes the IP address from the cfg file by default.  Please check for the entry Ip.address in the cfg file.  The function GetAssignedIP()  prints the IP address to the UART console which is commented out now. 

    Regards,

    Prajith

  • Hi Prajith,

    Thank you for the information.

    Unfortunately I am not able to proceed further,
    As per your suggestion I have changed the IP Address from the app.cfg settings.
    I have changed it as below from the default value.

    192.168.210.19 -> 192.168.1.2
    255.255.255.0 -> 255.255.255.0
    192.168.210.1 -> 192.168.1.1

    This time the behaviour of the example seems different,
    there are no LED blinks and when I stop the program the everytime the CCS throws below error saying can't find the source.

    Can't find a source file at "D:/x0159762/Projects/IndSDK/Source/Ref_repo/GIT_NO_DEV/public/sdk/starterware/drivers/mdio.c"

    If possible please let me know if there is sample project that could be tested.

    Regards
    Prad

  • Prad,

              Changing the IP address in cfg file should not have any effect on LED indication. The issue seems to be something different. The Ethernet/IP sample in CPSW mode is tested (with changing the IP address also).

    For the error you are getting can you verify whether  IA_SDK_HOME is set correctly in your project.

    Thansk,

    Prajith

  • Hi Prajith,

    Thank you,

    Yes, that error was different and I was able to build the project with the proper settings.
    Now the ethernet communication is also working fine.

    The root cause seems to be the EtherCat application in SPI Flash.
    The ICEV2 board comes pre-flashed EtherCat application and after Power ON
    this EtherCAT application executes which in turn lead to problems in debugging
    other application through CCS.

    I solved the issue by shorting Pins 1&2 in Bootloader setting jumper "J5".
    which made the board to boot from NOR(which don't have image flashed).

    Could you please let me know what is the reason behind this issue,
    I thought while debugging from CCS, it will overcome the default boot application.
    Is it not possible to debug applications if there is some image file inside the on board flash?

    Regards,
    Prad

  • Prad,

    Having an application flashed in SPI should not affect debugging. What issues were you facing?

    If on SPI boot mode, you can simply connect via CCS, do a "System Reset", execute the GEL script and load your application. This should work fine.

    Regards,
    Vinesh

  • Vinesh,

    Yes, this has caused issue with many of our customers.

    As mentioned in the below post,running Ethernet LWIP sample leads to
    error "Port 1 IP Address Acquisition Failed", it was also solved by
    by shorting Pins 1&2 in Bootloader setting jumper "J5".
    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/313845/1108743.aspx#1108743

    Actually the Ethercat application seems to be running (related LED's blink)
    even after "System Reset" or GEL script execution.
    The only way to solve the issue is the jumper settings to stop Ethercat application.

    This issue could be easily reproduced in the ICEV2 board with EtherCat application in SPI Flash.

    Regards.
    Prad.

  • Prad,

    As soon as you give "System Reset" if the A8 processor is not halted, the EtherCAT application will be loaded from SPI flash. Can you try putting a breakpoint at 0x402f_0400(starting point of Internal RAM) just before giving a system reset? This way the processor will be halted before the bootloader loads and executes the binary in SPI flash.

    Regards,
    Vinesh

  • Vinesh,

    I shall try your suggestion.
    But as mentioned above I believe jumper setting is a faster way instead of using the breakpoint way.

    Accorinding to your comment
    "As soon as you give "System Reset" if the A8 processor is not halted, the EtherCAT application will be loaded from SPI flash."

    Does this mean CCS debug cannot overcome if the Application in SPI Flash starts running after System Reset?
    and we have to stop the running application(through jumper settings or other way) in order to debug a different application?

    Regards
    Prad

  • Hi Prad,

    I have tried to reproduce the scenario and following are my observations-

    1. First of all, I SPI flashed ECAT application. Jumper settings are such that it boots from SPI and ECAT SPI application started executing (Verified from UART console).

    2. Now I connect from CCS. Put HW breakpoint at '0x402F0400' and do a 'System Reset'. Breakpoint is hit and the LED scrolling Display has gone (but ECAT specific LEDs 2,4,6 and 7 are glowing)

    3. Done a GEL script initialization and loaded the .out for 'enetLwip_sysbios' application (ICEv2 board jumpers are configured for CPSW mode and Ethernet cable in Plugged into PORT1)

    4. When I start the application, I can see IP address 192.168.1.2 is assigned successfully and I am able to ping (ECAT specific LEDs are still ON!)

    5. I thought trying the 'ethernetip_adapter' application. Started again and in Step 3, loaded the EIP application .out built in CPSW mode by following the 'System Reset' and 'GEL script' execution. When I start the application, ECAT specific LEDs are replaced by EIP specific LEDs.

    So I believe the presence of ECAT application in SPI flash will not be affecting the normal debugging procedure by loading the .out of a different application.

  • Hi Nijin,

    Thank you so much for doing all the test.
    With your testing I understood the ECAT application in flash won't effect the debug process.
    I shall also do some more testing on this and come back with the result.

    Regards
    Prad

  • Hi Nijin,

    I am sorry for the delay.

    Regarding this issue, I have tried the procedure suggested by you
    and found that ECAT application in flash won't effect the debug process.

    But, as mentioned by you and Vinesh it is required to put a breakpoint at '0x402F0400'
    and then do a System Reset in order to stop the ECAT application running.

    So the conclusion would be that the Pre-Programmed application would not effect
    the debug process unless it is stopped through breakpoint(at '0x402F0400') during system reset
    or else do the jumper settings such that the application bootloader won't come up during system start-up.

    Please let me know know the above understanding is correct and
    if this is the case then the Wiki Getting started should mention this point,
    otherwise many of the customers would be having trouble in running the sample applications.

    Regards
    Prad