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.

AM4379: IDK: struggling to make ethernet communication work

Part Number: AM4379

Hi, I need to make a simple ehernet communication example on the IDK board, but I cannot make even simplest example to work.

My board is AM437x-IDK with AM4379 processor. The code I am using is PRU-ICSS-Ethernetip_adapter example, which runs fine (at least it outputs something in the console). I am now trying to add the included telnet server feature to it, but it doesn't work.

What I have tried so far is enabling the telnet library by uncommenting lines 170-173 in the am437x_app.cfg:

var Telnet = xdc.useModule('ti.ndk.config.Telnet');
var telnet0Params = new Telnet.Params();
telnet0Params.callBackFxn = "&ConsoleOpen";
var telnet0 = Telnet.create(telnet0Params);

But I could not connect to the board via telnet (to the IP address shown in the console).

Then I tried to leave only the line 170 enabled, and add the telnet initialization code to eip_ndk.c, as in the telnet example included in the NDK (client.c):

extern SOCKET ConsoleOpen(struct sockaddr *pSinClient);
...
static char *TaskName[]  = { "Telnet","HTTP","NAT","DHCPS","DHCPC","DNS" };
static char *ReportStr[] = { "","Running","Updated","Complete","Fault" };
static char *StatusStr[] = { "Disabled","Waiting","IPTerm","Failed","Enabled" };
static void NIMU_testServiceReport( uint32_t Item, uint32_t Status, uint32_t Report, void * h )
{
    UART_printf( "NIMU_testServiceReport( %u, %u, 0x%x, %p )\n", Item, Status, Report, h );
    UART_printf( "Service Status: %s: %s: %s: %03d\n",
            TaskName[Item-1], StatusStr[Status],
            ReportStr[Report/256], Report&0xFF );
}

And below in the EIPNDK_acdStackThread function (unable to insert another <code> block or edit the existing one, so pasting as plain text):

    CI_SERVICE_TELNET telnet;
    bzero( &telnet, sizeof(telnet) );
    telnet.cisargs.IPAddr = INADDR_ANY;
    telnet.cisargs.pCbSrv = &NIMU_testServiceReport;
    telnet.param.MaxCon   = 2;
    telnet.param.Callback = &ConsoleOpen;
    CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_TELNET, 0, sizeof(telnet), (uint8_t *)&telnet, 0 );

The effect of all this is that this appears in the console:

NIMU_testServiceReport( 1, 4, 0x0, 800f3804 )
Service Status: Telnet: Enabled: : 000

But the boards still does not accept telnet connections. What do I do to make it work?

From the status print it seems that the telnet service's status is "enabled", but the "report" field indicates empty. Shouldn't it be "running"? Maybe I need to call a specific function to run it? I cannot find any info on this anywhere.

A question for later: I need to make the telnet (or just PING, but telnet seems easier for now) to work on the gigabit emac port of the IDK instead of the emac_icss. Are there any guides how to achieve this? I could not find any gigabit ethernet port example whatsoever on this processor.

My final target is to make the ethercat slave working on emac_icss (tried the example, works fine) and the ping/telnet on the gigabit emac at the same time. Is this possible on this IDK board?

  • I've got an idea to run an example of ethernet communication for AM437x EVM board, as I see from the schematics they have the Gigabit Ethernet connected identically. But the problem is... I cannot find any examples for the EVM board. Are there any?

    The Resource Explorer built into CCS seems to have only the industrial examples.

    This page suggests that there should be other examples as well: https://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_examples_demos.html#arm-cortex-a9 but I cannot find how to get there. There is no menu item "Resource Explorer (Examples)" mentioned in the article in my CCS.

    Also new project wizard in the CCS isn't helping. It shows only the four industrial ethernet examples for search pattern "AM437".

    I have also tried creating new CCS project from an example template (typical template), but I cannot finish the wizard, because of the missing Platform field selection (the list of choices is empty). I could not find an ethernet example there though, so I don't think it would be helpful too.

    I am lost now. Does anyone know how to get started?

    I am totally new to TI development tools and processors, so perhaps I am missing something obvious here.

  • Hi,

    For examples of Ethernet communication on AM437x EVM, I would recommend you to download the PROCESSOR-SDK-RTOS-AM437X for AM437x. After you install it, you'll find the Network Development Kit (ndk_3_61_01_01) in the installation folder. Please go to ndk_3_61_01_01\docs\Documentation_Overview.pdf for user guide.

    You'll also find the Platform Development Kit (pdk_am437x_1_0_17) which has example projects of Ethernet/IP application. Please follow instructions at: https://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_overview.html#pdk-example-and-test-project-creation. Specifically, you'll need to:

    1. Install and register all Processor SDK products in CCS.

    2. Create PDK example projects:

    • Check CCS version in batch file pdk_am437x_1_0_17\packages>pdksetupenv.bat and change it to what you have
    • Run batch file to setup environment: C:\ti\pdk_am437x_1_0_17\packages>pdksetupenv.bat
    • Run batch file to generate projects:   C:\ti\pdk_am437x_1_0_17\packages>pdkProjectCreate.bat AM437x
    • The generated projects are located at: pdk_am437x_1_0_17\packages\MyExampleProjects

    3. The specific examples with Ethernet/IP applications are:

    • NIMU_BasicExample_xxx: sample application using CPSW
    • NIMU_ICSS_BasicExample_xxx: sample application using ICSS

    Hope this is helpful.

    Regards,

    Jianzhong

  • Thank you, this worked, but needed small corrections. I will describe them, because some of them seem to be bugs in the scripts:

    1. There is no CCS version to define in pdksetupenv.bat file. I think you meant pdkProjectCreate.bat

    2. After running pdkProjectCreate.bat what I got was a bunch of errors:

    Detecting all projects in PDK and importing them in the workspace C:\ti\PDK_AM~1\packages\\MyExampleProjects
    Detected Test Project: EMAC_BasicExample_evmAM437x_armBiosExampleProject
    System cannot find the path specified.
    Copying macro.ini
    System cannot find the path specified.
    Number of files copied:         0.

    Perhaps the double slash before "MyExmpleProjects" is a problem. I corrected this by defining my own folder for the projects in pdkProjectCreate.bat file:

    set MY_WORKSPACE=D:\Projekty\PDKExampleProjects

    The project's PDK_INSTALL_PATH (and many other variables) is set to "${PROJECT_LOC}\..\.." which will work fine for the default project generation path, but not if someone wants to change it. So finally I changed the command to

    set MY_WORKSPACE=%PDK_SHORT_NAME%MyExampleProjects (removed the slash)

    And this fixed it.

    So far I have built the EMAC_BAsicExample_idkAM437x and it works fine. Now I'm trying to integrate NDK's Telnet/ICMP functionality into the basic example. Are there any examples for this?

  • I have just found the FTP example, which contains working ICMP, and is exactly what I needed :)

  • There is no CCS version to define in pdksetupenv.bat file. I think you meant pdkProjectCreate.bat

    Yes, you're right. Thanks for pointing this out.

    Glad that you found what you need.