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's client project error

hello all,

           I'm New to the forum and Newbie in DSP. I'm running NDK2.0 on a 6747 evaluation board.The project is client.pjt that comes with the NDK.Basically,Some server tasks and net

services are set up on 6747. The board is connected with my PC via a cat5 wire. Some test programs will run on PC.I'm using CCS V4.2.3.

             Here comes my problem, I ran a send.exe program on PC to establish a TCP link to the board , sent some packet to the DSP. The stack received random number of  packets

before it stopped working. Then the stack didn't answer any following connection from PC. The CCS output window showed this info: PBM_enq:Invalid Packet.

             I did some dig on the problem, the User Guide of NDK(spru523_ug) said one possible cause is memory corruption(3.4.4) .Because the example projects of NDK all use full L2

cache. The reads and writes of CPU will cause cache corruption ending up withmemory corruption.I checked this ,changed the L2 cache size from 256K to 128K(that will change L2 to

128K-cache/128-Internal memory mode, right? But I don't know how to configure the remaining 128K space of L2,the pic below shows the configuration after I changed L2 cache

mode) But ,the problem remained the same.

            FYI, I ran the same project using the same configuration under CCS V3.3 before,and it worked fine.

            Any Inputs will be useful,Thanks for your attention. My English is not that fluent ,so ,if I said anything  unclear, please let me know.

 

 

 

 

  • Hi gaotai zhang,

    The projects in NDK 2.0 are not supported in CCSv4 - NDK 2.0 only shipped with CCS v 3.x projects.  So, did you try to import and rebuild the client example in CCSv4?

    gaotai zhang said:
    The board is connected with my PC via a cat5 wire

    I want to make sure that your hardware setup is correct.  It sounds like you are *directly* plugging a cat5 Ethernet cable from your 6747 board into your PC?  Or is there a router or switch in between the PC and board?

    gaotai zhang said:
    FYI, I ran the same project using the same configuration under CCS V3.3 before,and it worked fine.

    Can you try this?

    1. In CCSv3.3, load and run the client example.  Verify that it runs correctly and works with the send.exe program.
    2. Close CCSv3.3, then open CCSv4.2.3.
    3. Load and run *the same client example program* that you just built, ran and verified correctness in CCSv3.3.  Does this example work correctly this time?
    4. Load and run the client example that you re-built in CCSv4.2.3 - does this example *not work*?

    Thanks,

    Steve

  • 1. I imported the example projects into ccsv4 and rebuilded them

    2. Indeed, I 'm "directly" plugging a cable from my PC to 6747 board , and for me, this point looks fine because the board can receive some packets from PC before the stack broke down.

    3.the newly installed CCSv3.3 just don't work,it stays at the start up pharse call "splash" forever. I'm working on it though.

  • Hi steve,

             I'm sorry to brother you with more information  :) . After the stack broke down ,I collected some info from CCS. It's like this,

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                C$L1:
    0xC00D5588:   0002A120            BNOP.S1       C$L1 (PC+8 = 0xc00d5588),5             <== 
    0xC00D558C:   00000000            NOP
    0xC00D5590:   00000000            NOP
    0xC00D5594:   00000000            NOP
    0xC00D5598:   00000000            NOP
    0xC00D559C:   00000000            NOP
                CLK_TIMEFXN, CLK_F_gethtime, _CLK_gethtime:
    0xC00D55A0:   000C0362            B.S2          B3
    0xC00D55A4:   022803E2            MVC.S2        TSCL,B4
    0xC00D55A8:   021018F0            OR.D1X        0,B4,A4
    0xC00D55AC:   00004000            NOP           3
    0xC00D55B0:   00000000            NOP
    0xC00D55B4:   00000000            NOP
    0xC00D55B8:   00000000            NOP
    0xC00D55BC:   00000000            NOP
                cinit, __cinit:

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                   The stack crashed after receiving some packets,but the program continued running.When I push pause button, the program stopped at the line with an arrow(<==).Then I push run,push pause, again, it stopped at the arrow line.

                   It seems to me that the program has gone into a dead end,but that's all I can read.   I guess you know something I don't. If you do, please let me know.

               

  • gaotai zhang said:
    1. I imported the example projects into ccsv4 and rebuilded them

    Unfortunately, this isn't supported.  NDK 2.0 examples are only supported on CCSv3.  While CCSv4 does have a feature that is supposed to "upgrade" a CCSv3 project to CCSv4, it does not work as expected; IMHO your best bet is to get your CCSv3 installation working and use that with the NDK 2.0 projects.

    gaotai zhang said:
    2. Indeed, I 'm "directly" plugging a cable from my PC to 6747 board , and for me, this point looks fine because the board can receive some packets from PC before the stack broke down.

    Are you using a crossover cable?  Or a standard Ethernet cable?  I suspect that you are using a standard Ethernet cable.  If this is true, then this set up will not work.  You must use a router or switch in between the PC and 6747 when using standard Ethernet cables.  If you don't want to use a switch or router in between, then you need to use a crossover cable (this is not related to the NDK stack, but because of the way Ethernet cables are physically wired).

    Also, if you do want to directly connect using a crossover cable, you must configure the NDK application to use a static IP address.

    gaotai zhang said:
    3.the newly installed CCSv3.3 just don't work,it stays at the start up pharse call "splash" forever. I'm working on it though.

    Is anyone helping you with this problem?  If not, please try posting your issue to the CCS forums and someone on the CCS team will be able to help you with this.

    Steve

  • gaotai zhang said:

    Hi steve,

             I'm sorry to brother you with more information  :) . After the stack broke down ,I collected some info from CCS. It's like this,

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                C$L1:
    0xC00D5588:   0002A120            BNOP.S1       C$L1 (PC+8 = 0xc00d5588),5             <== 
    0xC00D558C:   00000000            NOP
    0xC00D5590:   00000000            NOP
    0xC00D5594:   00000000            NOP
    0xC00D5598:   00000000            NOP
    0xC00D559C:   00000000            NOP
                CLK_TIMEFXN, CLK_F_gethtime, _CLK_gethtime:
    0xC00D55A0:   000C0362            B.S2          B3
    0xC00D55A4:   022803E2            MVC.S2        TSCL,B4
    0xC00D55A8:   021018F0            OR.D1X        0,B4,A4
    0xC00D55AC:   00004000            NOP           3
    0xC00D55B0:   00000000            NOP
    0xC00D55B4:   00000000            NOP
    0xC00D55B8:   00000000            NOP
    0xC00D55BC:   00000000            NOP
                cinit, __cinit:

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                   The stack crashed after receiving some packets,but the program continued running.When I push pause button, the program stopped at the line with an arrow(<==).Then I push run,push pause, again, it stopped at the arrow line.

                   It seems to me that the program has gone into a dead end,but that's all I can read.   I guess you know something I don't. If you do, please let me know.

     

    I suspect this crash is due to the means of connection being used (mentioned in previous post).  Please let me know if you still see this once you try with a cross over cable, or a router/switch.

    Steve

  • Steve,

             The cable I am using to connect the PC and the 6747 board is a straight-through cable,and I wikied about the crossover cable.http://en.wikipedia.org/wiki/Crossover_cable_(ethernet)

             The auto-MDIX feature makes a crossover cable not neccesary for peer to peer connection. And according to the document, if one peer of the connection supports auto-MDIX(my PC), the straight-through cable will do.I think the connection is not the cause of my problem because the board can receive some packet before crashing. But of course, I will find a crossover cable and check it out.

             I also get a good news, my CCSv3.3 is working.The bad news is, the NDK project still crashes on v3.3 after several successful sends. The output is the same

      PBM_enq:Invalid Packet.

             Sorry for my bad memory and could you explain more on the memory corruption thing I mentioned in my original post? Maybe we can find some clue there.

     

  • Hi,

    In response to your original post:

    gaotai zhang said:

    I checked this ,changed the L2 cache size from 256K to 128K(that will change L2 to

    128K-cache/128-Internal memory mode, right?

    I'm a little confused about this.  Why did you want to change the cache size to 128K?  Was this an attempt to get the program working?

    gaotai zhang said:

    But I don't know how to configure the remaining 128K space of L2,the pic below shows the configuration after I changed L2 cache

    Yes, changing “64P L2CFG Mode” from 256k -> 128k will give you an extra 128k of free space.  But you would need to create a new memory segment out to be assigned to that memory range in order to use that extra 128k.  Is that what you would like to do?


  • gaotai zhang,

    We have never tested the NDK using auto-MDIX.

    In order to get a better understanding of the problem, can you please confirm the the *original, unmodified* client example, that ships with NDK 2.0, works successfully when connected to your PC via a router or switch, similar to the following diagram?  This diagram illustrates the setup that is supported and tested:

    If the original example works with the above setup up, then can you try changing the hardware setup back to your original configuration, in which you are plugging in the Ethernet cable directly from the PC to the 6747?

    Regarding the memory corruption, I know that the driver requires some L2 cache - meaning that you should not map all L2 cache to be external memory.  It should be OK to map some of L2 to external memory, just not all of it.

    Steve