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?