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.

EVMK2H: How to run two NDK stack at EVMK2H at the same time

Part Number: EVMK2H

Hi. TI employee.

I would like to use both Ethernet ports of EVMK2H device. (pdk_k2hk_4_0_2, ndk_2_24_02_31)

I have followed the post(

) and made my own nimu_eth.c and nimu_internal.h.

I made my own source code because the post is about C6678 device(My board is EVMK2H).

I think the 2 ethernet ports is initialized successfully(even though some warning message was shown like,

Verify_Init: Expected 16 entry count for gTxFreeQHnd queue 0, found 0 entries,

Verify_Init: Expected 110 entry count for gRxFreeQHnd queue 0, found 0 entries).

However, I face the problem during the running two NDK stacks.

To run the two NDK stacks, I add "StackTest_2" task at helloWorld.cfg. 

I face the error message "00000.000 ExecStart: Already Open".

The error message is came from ExecOpen(), because  the global variable ExecStatus != ES_CLOSED.

(The function ExecOpen() is under ndk_2_24_02_31/packages/ti/ndk/stack/res/exec.c)

I think the global variable ExecStatus supports only one NDK stack.

(Should I chage the ExecStatus variable to ExecStatus[2] array for each EMAC port ?)

Could you tell me how to run the two NDK stacks simultaneously?

(I read the post e2e.ti.com/.../2072579

 but it does not help my situation.

I am using the 2 Ethernet ports at only core 0. Is this the reason of failure?

-------here is the log---------------

Initializing Free Descriptors.
QMSS successfully initialized
CPPI successfully initialized
PA successfully initialized

TCP/IP Stack 'Hello World!' Application

StackTest: using localIp 1st port
psb:NC_NetStart before
EmacInit
EMACInit_Core port:0
PHY = SGMII port 0
PASS successfully initialized
SGMII Serdes Lanes Init Complete
Init_SGMII: macPortNum:0
Init_SGMII: macPortNum:1
Ethernet subsystem successfully initialized
Add_MACAddress port:0
Add_MACAddress port:0
Registration of the EMAC Successful, waiting for link up ..
send 0 OK(64)
Network Added: If-1:192.168.0.27
psb, NetworkOpen

TCP/IP Stack 'Hello World!' Application

StackTest: using localIp 2nd port
psb:NC_NetStart2 before
EmacInit
EMACInit_Core port:1
AMC = SGMII port 1
Add_MACAddress port:1
Add_MACAddress port:1
Registration of the EMAC Successful, waiting for link up ..
00000.000 ExecStart: Already Open
psb, NetworkClose
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 NodeTreeFree: Didn't find right
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
psb:NC_NetStart2 return:-1
StackTest2: exiting
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
00000.000 NodeTreeFree: Null endpoints
00000.000 mmFree: Double Free
00000.000 mmFree: Double Free
psb:NC_NetStart return:-1
StackTest: exiting

  • Hi,

    I've notified the NDK team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • I've found the answer :)
    I think that the multiple NDK stacks could not be enabled at a core.
    (one NDK stack per one core)

    I have added the below lines(comment with //add) after adding the address of interface 1.
    ======================at hellowWorld.c==================================
    platform_write("StackTest: using localIp 1st port\n");
    // Setup manual IP address
    bzero( &NA, sizeof(NA) );
    NA.IPAddr = inet_addr(LocalIPAddr);
    NA.IPMask = inet_addr(LocalIPMask);
    strcpy( NA.Domain, DomainName );
    NA.NetType = 0;

    // Add the address to interface 1
    CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0,
    sizeof(CI_IPNET), (UINT8 *)&NA, 0 );

    bzero( &NA, sizeof(NA) );//add
    NA.IPAddr = inet_addr(LocalIPAddr2);//add
    NA.IPMask = inet_addr(LocalIPMask);//add
    strcpy( NA.Domain, DomainName2 );//add
    NA.NetType = 0;//add

    // Add the address to interface 2//add
    CfgAddEntry( hCfg, CFGTAG_IPNET, 2, 0,
    sizeof(CI_IPNET), (UINT8 *)&NA, 0 );//add

    after adding above code, I could set the two different IP address to each port and successfully ping :)

    However, I face the another problem.

    During the ping test with 2 port at the same time, the ping packet is sometimes loss (the packet is expired message is shown)

    If I need some help. I will create new post.