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.

NDK can be restarted only once on DM648

Hi All!

For some reason (see this thread http://e2e.ti.com/support/embedded/bios/f/355/p/223029/835523.aspx#835523) I decided to restart NDK stack and I found out that NDK stack successfully restarts only once.

My configuration:

CCS 5.1.1.00031
bios_5_42_00_07
ndk_2_20_06_35 
ethss_dm648 from ndk_2_0_0. According to TI's advice all "printf" were removed
The project was taken from
ndk_2_0_0\packages\ti\ndk\example\network\helloWorld
This project originally was for CCS 3.3 so I had to convert it to use with CCS 5.1. 
I did the following changes in the pfoject:
- an IP address is set statically
- dtask_udp_hello demon and its creation were commented out
- A MainTask thread was created
int MainTask(Arg arg0)
{

while(1)
{
TSK_sleep(30000);
printf("NDKRestart\n");
NC_NetStop(1);
}

}

So, the system does nothing except  restarting NDK stack every 30 seconds.

To test if NDK is OK I ping the board from a PC.

After the first restart the board continues responding to ping but after the second restart it stops responding. Other restarts don't improve situation an even make it worse. See the log from CCS console:

[C64XP_0]
[C64XP_0] TCP/IP Stack 'Hello World!' Application
[C64XP_0]
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] Network Added: If-1:192.168.1.100
[C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 0
[C64XP_0] NDKRestart
[C64XP_0] Network Removed: If-1:192.168.1.100
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] Network Added: If-1:192.168.1.100
[C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 0
[C64XP_0] NDKRestart
[C64XP_0] Network Removed: If-1:192.168.1.100
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] Network Added: If-1:192.168.1.100
[C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 0


30 restarts happened here


[C64XP_0] NDKRestart
[C64XP_0] Network Removed: If-1:192.168.1.100
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] Network Added: If-1:192.168.1.100
[C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 0
[C64XP_0] NDKRestart
[C64XP_0] Network Removed: If-1:192.168.1.100
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] NDKRestart
[C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
[C64XP_0] 00000.000 TimerNew: OOM
[C64XP_0] 00000.000 TimerNew: OOM
[C64XP_0] 00000.000 TimerNew: OOM
[C64XP_0]
[C64XP_0] 129:48 ( 67%) 33:96 ( 51%) 1:128 ( 4%) 0:256
[C64XP_0] 62:512 ( 93%) 0:1536 0:3072
[C64XP_0] (49152/49152 mmAlloc: 1123/3/908, mmBulk: 0/0/0)
[C64XP_0]
[C64XP_0] 5 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 29 blocks alloced in 96 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 62 blocks alloced in 48 byte page
[C64XP_0] (E033D454) (E48E7C00) (E033D4B4) (E48E7C00) (E033D514) (E48E7C00) (E033D574) (E48E7C00) (E033D5D4) (E48E7C00) (E033D694) (E033D664) (E48E7C00) (E
[C64XP_0] 48E7C00) (E033D6F4) (E48E7C00) (E033D754) (E48E7C00) (E033D7B4) (E48E7C00) (E033D814) (E48E7C00) (E033D874) (E48E7C00) (E033D8D4) (E48E7C00) (E03
[C64XP_0] 3D934) (E48E7C00) (E033D994) (E48E7C00) (E033D9F4) (E48E7C00) (E033DA54) (E48E7C00) (E033DAB4) (E48E7C00) (E033DB14) (E48E7C00) (E033DB74) (E48E7
[C64XP_0] C00) (E033DBD4) (E48E7C00) (E033DC34) (E48E7C00) (E033DC94) (E48E7C00) (E033DCF4) (E48E7C00) (E033DD54) (E48E7C00) (E033DDB4) (E48E7C00) (E033DE1
[C64XP_0] 4) (E48E7C00) (E033DE74) (E48E7C00) (E033DED4) (E48E7C00) (E033DF34) (E48E7C00) (E033DF94) (E48E7C00)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 60 blocks alloced in 48 byte page
[C64XP_0] (E0341BF4) (E48E7C00) (E0341C54) (E48E7C00) (E48E7C00) (E0341E04) (E0341D14) (E48E7C00) (E0341D74) (E48E7C00) (E0341DD4) (E48E7C00) (E48E7C00) (E
[C64XP_0] 0341E64) (E48E7C00) (E0341EF4) (E48E7C00) (E0341FB4) (E0341F84) (E48E7C00) (E48E7C00) (E0342194) (E03420A4) (E0342074) (E48E7C00) (E48E7C00) (E03
[C64XP_0] 42164) (E0342134) (E48E7C00) (E48E7C00) (E48E7C00) (E0342284) (E48E7C00) (E03422E4) (E48E7C00) (E03426A4) (E0342374) (E48E7C00) (E0342674) (E0342
[C64XP_0] 524) (E0342434) (E48E7C00) (E0342494) (E48E7C00) (E03424F4) (E48E7C00) (E48E7C00) (E0342584) (E48E7C00) (E03425E4) (E48E7C00) (E0342644) (E48E7C0
[C64XP_0] 0) (E48E7C00) (E48E7C00) (E0342704) (E48E7C00) (E0342764) (E48E7C00) (E0341C84)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 6 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000) (0000) (0000) (0000) (0000)
[C64XP_0] 2 blocks alloced in 512 byte page
[C64XP_0] (0000) (0000)

It seems that there is a problem with  NDK restarting on DM648.
Victor
  • I have enable all printf in my previous experiment and I got  the following error message after the second restart:

    [C64XP_0] InitTx Channel : Unable to allocate 192 BDs for channel 0.512 BDs already in use
    [C64XP_0] NetChOpen: Error in initializing TX channel 0 EMAC should be up and running

    Here is the full log:

    [C64XP_0] TCP/IP Stack 'Hello World!' Application
    [C64XP_0]
    [C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] EMAC should be up and running
    [C64XP_0] EMAC has been started successfully
    [C64XP_0] Registeration of the EMAC Successful
    [C64XP_0] Network Added: If-1:192.168.1.100
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 0
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 1
    [C64XP_0] cpsw_MDIO_PhYReset(0)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] cpsw_MDIO_PhYReset(1)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] Negotiated connection: FullDuplex 1000 Mbs
    [C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 1


    [C64XP_0] NDKRestart  The first restart
    [C64XP_0] Network Removed: If-1:192.168.1.100
    [C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] EMAC should be up and running
    [C64XP_0] EMAC has been started successfully
    [C64XP_0] Registeration of the EMAC Successful
    [C64XP_0] Network Added: If-1:192.168.1.100
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 0
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 1
    [C64XP_0] cpsw_MDIO_PhYReset(0)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] cpsw_MDIO_PhYReset(1)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] Negotiated connection: FullDuplex 1000 Mbs
    [C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 1


    [C64XP_0] NDKRestart  The second restart
    [C64XP_0] Network Removed: If-1:192.168.1.100
    [C64XP_0] Using MAC Address: 7c-8e-e4-d5-52-0d
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] cpsw_MDIO_Init
    [C64XP_0] SetPhyMode:000021E1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0
    [C64XP_0] InitTx Channel : Unable to allocate 192 BDs for channel 0.512 BDs already in use
    [C64XP_0] NetChOpen: Error in initializing TX channel 0 EMAC should be up and running
    [C64XP_0] EMAC has been started successfully
    [C64XP_0] Registeration of the EMAC Successful
    [C64XP_0] Network Added: If-1:192.168.1.100
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 0
    [C64XP_0] cpsw_MDIO_FindingState: PhyNum: 1
    [C64XP_0] cpsw_MDIO_PhYReset(0)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] cpsw_MDIO_PhYReset(1)
    [C64XP_0] Enable Phy to negotiate external connection
    [C64XP_0] NWAY Advertising: FullDuplex-1000 FullDuplex-100 HalfDuplex-100 FullDuplex-10 HalfDuplex-10
    [C64XP_0] Negotiated connection: FullDuplex 1000 Mbs
    [C64XP_0] EMAC_sendPacket() returned error 32000038
    [C64XP_0] Link Status: 1000Mb/s Full Duplex on PHY 1

    I hope it will help you to find out and fix the error.

    Best Regards

    Victor

  • Victor,

    I noticed that this thread never received a reply.  Any update on this issue?

    Dave

  • Victor,

    Does this happen because when NDK restarts, the whole procedure is not done properly? Ideally, I would expect EmacStop to be called up by NDK when a restart/shutdown happens. But I noticed this doesn't happen - http://e2e.ti.com/support/embedded/bios/f/355/t/245724.aspx

    Vinesh

  • Hi Vinesh!

    I haven't had time to investigate this issue. In our project we don't need to restart NDK. I tried to restart it as a temporary workaround for my problem with NDK. But due to the fact that I still don't have a clear understanding when to restart, the restart itself is useless for me.

    InitTx Channel : Unable to allocate 192 BDs for channel 0.512 BDs already in use

    Based on the printout above, I think that the driver merely doesn't free all buffers while shutting down and as the result it runs out of space after second restart. But I haven't investigated why the buffers were not freed.

    Victor