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.

CCS/TDA2HV: Ethernet UDP/TCP

Part Number: TDA2HV
Other Parts Discussed in Thread: TDA2E, SYSBIOS

Tool/software: Code Composer Studio

Hello!

I'm trying to figure out some strange data transfer behavior. It's start work, then fall and now not work anyhow.

Preamble:

HW: Our custom board with TDA2HV.

SW: We don't use Vision SDK. Create project for CCS9 from nsp example. Memory: For memory configuration get file from SDK:

 c:\ti\SDK_VI\vision_sdk\sample_app\build\tda2xx\mem_segment_definition_bios.xs
 c:\ti\SDK_VI\vision_sdk\build\rtos\tda2xx\config_a15.bld

changed accordingly.

I start client and continiously send data.

Result:

  1. The error arise 55 (No buffer space available) then it change on error 64 (Host is down). We try to increase pbm buffer size - it's not help.

  2. I noticed that object PBMQ_free not allocated. Why it's heppend I don't know.

  3. I called in send function _mmCheck and get next information.

When it's work by mm we get next information:

     14:48   (  5%)    15:96   ( 11%)     1:128  (  1%)     1:256  (  2%)  
     1:512  (  4%)     0:1536            0:12288         
     (61440/245760 mmAlloc: 41/0/9, mmBulk: 0/0/0)
     
     1 blocks alloced in 512 byte page
     14 blocks alloced in 48 byte page
     1 blocks alloced in 128 byte page
     15 blocks alloced in 96 byte page
     1 blocks alloced in 256 byte page

  1. ProgrammeTDA2HV_a15_0_Ethernet.zip send ARP requests and get answers but transmition not start.

  2. I check my send function on EVM TDA2E and it's work.

Can you help me understend why transmition not start?

  • SYSBIOS: 6.46.06.00
    CCS: 9.3
    NDK: 2.24.02.31
    NSP: nsp gmacsw 4_16_01_01
    SDK: VISION SDK 3.08
    XDS: xdctools 3.32.01.22
    Device: TDA2HV

  • I switch on additional debug information from NKD. Get next result:

    [CortexA15_0] 
    MAC Port 0 Address:
    	00-35-ff-ad-15-f8
    GMACSW has been started successfully
    Registration of the GMACSW Successful
    00002.901 KrnMsg: Msg=[New     ] A=[192.168.001.004] M=[255.255.255.255]
    00004.200 KrnMsg: Msg=[New     ] A=[192.168.001.000] M=[255.255.255.000]
    Network Added: If-1:192.168.1.4
    Phy Status: Phy 1 found on MAC port 0
    00005.501 KrnMsg: Msg=[New     ] A=[000.000.000.000] M=[000.000.000.000]
    Negotiated connection: FullDuplex 1000 Mbs
    Link Status: 1000Mb/s Full Duplex on PHY 1
    After TaskCreate() RUN!!!
     ==================== UDP ==================== 
    sudp: 1077308644
    00009.801 KrnMsg: Msg=[New     ] A=[192.168.001.060] M=[255.255.255.255]
    send unseccsessful, 2
    ERROR task: 55
    ERROR task: 55
    ERROR task: 55
    ERROR task: 55
    
    ERROR task: 55
    ERROR task: 55
    00073.301 KrnMsg: Msg=[Down    ] A=[192.168.001.060] M=[255.255.255.255]
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    ERROR task: 64
    00078.401 KrnMsg: Msg=[Up      ] A=[192.168.001.060] M=[255.255.255.255]
    ERROR task: 55
    ERROR task: 55
    
    ERROR task: 55
    00360.201 KrnMsg: Msg=[Expired ] A=[192.168.001.060] M=[255.255.255.255]
    00360.802 KrnMsg: Msg=[New     ] A=[192.168.001.060] M=[255.255.255.255]
    ERROR task: 55
    
    ERROR task: 55
    00367.901 KrnMsg: Msg=[Down    ] A=[192.168.001.060] M=[255.255.255.255]
    ERROR task: 55
    

    Geoge

  • Which function returned error code 55 and which one returned 64?

  • This error arise in send or sento (I test work both) functions and get it error with  fdError() function return.

    Error 55 happend when run in udp.c:

    if( !(pPkt = SockCreatePacket( hSock, (uint)size + UDPHDR_SIZE)) )
    {
        udps.SndNoPacket++;
        error = ENOBUFS;
        goto UDP_EXIT;
    }

    error 64 returns function in the same file udp.c:

    /* Send the packet */
        error=(int)IPTxPacket(pPkt,SockGetOptionFlags(hSock)&FLG_IPTX_SOSUPPORTED);

    George

  • I get the next information from structure ips and udps:

    ips
    Total	1328					/* total packets received */
    Odropped	0					/* lost packets due to nobufs, etc. */
    Badsum	0					/* checksum bad */
    Badhlen	0					/* ip header length < data size */
    Badlen	0					/* ip length < ip header length */
    Badoptions	0					/* error in option processing */
    Badvers	0					/* ip version != 4 */
    Forward	0					/* packets forwarded */
    Noproto	0					/* unknown or unsupported protocol */
    Delivered	1328					 /* datagrams delivered to upper level */
    Cantforward	1					 /* packets rcvd for unreachable dest */
    CantforwardBA	0					 /* packets rcvd with illegal addressing */
    Expired	0					/* Packets not forwards becaused expired */
    Redirectsent	0					/* packets forwarded on same net */
    Localout	2440713					/* total ip packets generated here */
    Localnoroute	486					  /* Local packets discarded due to no route */
    Reassembled	0					  /* total packets reassembled ok */
    Fragments	0					   /* fragments received */
    Fragdropped	0					  /* frags dropped (dups, out of space) */
    Fragtimeout	0					 /* fragments timed out */
    Fragmented	0					  /* datagrams successfully fragmented */
    Ofragments	0					  /* output fragments created */
    Cantfrag	0					/* don't fragment flag was set, etc. */
    CacheHit	2441685					/* Route cache hit */
    CacheMiss	3					   /* Route cache miss */
    Filtered	0					/* packets filtered by firewall */

    udps

    RcvTotal	0
    RcvShort	0
    RcvBadLen	0
    RcvBadSum	0
    RcvFull	        0
    RcvNoPort	0
    RcvNoPortB	0
    SndTotal	2441200
    SndNoPacket	0
    

    Should ARP packages be included in the information udps.RsvTotal? 

    George

  • I can't find where located MAC address destination after ARP request send. If I set in plli->Status == LLI_STATUS_VALID and set MAC manualy in plli->MacAddr data start send:

    George

  • I think, that we solved this problem. The problem was in delay what need for work in signal CFG_RGMII0_RXC_IN.

    To tune up delay wrote add function:

    void netCloseHook()
    {
        uint32_t regValue, delta, coarse, fine, siliconRev;
        static int fine_val = 3;
        static int coarse_val = 0;
    
        /* Global unlock for I/O Delay registers */
        CFG_IO_DELAY_LOCK = CFG_IO_DELAY_UNLOCK_KEY;
    
        /* Tweaks to RGMII0 Rc delay */
        CFG_RGMII0_RXC_IN = (CFG_IO_DELAY_ACCESS_PATTERN & ~CFG_IO_DELAY_LOCK_MASK);
        SYSCFG_PAD_RGMII0_RXC = (SYSCFG_PAD_RGMII0_RXC & ~0xF) | 0x0;
        delta       = (coarse_val << 5) + fine_val;     /* Delay value to add to calibrated value */
        regValue    = CFG_RGMII0_RXC_IN & ~0xFFFFFC00;
        coarse      = ((regValue >> 5) & 0x1F) + ((delta >> 5) & 0x1F);
        coarse      = (coarse > 0x1F) ? (0x1F) : (coarse);
        fine        = (regValue & 0x1F) + (delta & 0x1F);
        fine        = (fine > 0x1F) ? (0x1F) : (fine);
        regValue    = CFG_IO_DELAY_ACCESS_PATTERN | CFG_IO_DELAY_LOCK_MASK | ((coarse << 5) | (fine));
        CFG_RGMII0_RXC_IN = regValue;
    
        /* Global lock */
        CFG_IO_DELAY_LOCK = CFG_IO_DELAY_LOCK_KEY;
    
        if (fine_val >= 0x1F) {
            fine_val = 0;
            coarse_val++;
        }
        fine_val++;
    
        if (coarse_val >= 0x1F) {
            coarse_val = 0;
            BIOS_exit(0);
        }
    
        printf("Fine val: %d\n Coarse val: %d\n", fine_val, coarse_val);
        if (mCtrl.biosKILL) BIOS_exit(0); // Выход
    
        //DaemonFree( hHello );
    }

    In function send I add:

            if (status_fdError != 0){
                ErrorCounter++;
                outputData("ERROR task: %d\n", status_fdError); // C:\ti\SDK_VI\ti_components\networking\ndk_2_25_01_11\packages\ti\ndk\inc\serrno.h
                if (ErrorCounter > 3){
                    printf("ERROR task: %d\n", status_fdError);
                         ErrorCounter = 0;
                         NC_NetStop(1);
                         fdCloseSession( TaskSelf() );
                         /* Close the socket. */
                         fdClose( sudp );
                         TaskExit();
                         //NDK_hookExit(TaskSelf());
                }
            }

    George

  • Please, do not close the theme, I will close it myself. Maybe I will can add something in coming weeks.

    George

  • George,

    If IOdelay settings were missing on RX side, I assume you were observing some kind of errors, such as CRC. Anyway, great that the bug is solved.

    You can create a new E2E ticket and mention that it's related to this one, so this ticket focuses on only one problem.