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.

TMS320C6657: TMS320C6657 : MACSTATUS.TXERRCODE

Part Number: TMS320C6657

Hi.

We are developing Ethernet using PDK and NDK.

But data transmission often stops.

Debug results in the MACSTATUS.TXERRCODE value being 1(SOP error) or 2(Ownership bit not set in SOP buffer).

The following information is included in 2.16.1.5 Host Error Interrupt of KeyStone Architecture EMAC / MDIO User Guide : 

The host error interrupt (HOSTPEND) is issued, if enabled, under error conditions
due to the handling of buffer descriptors detected during transmit or receive DMA
transactions. The failure of the software application to supply properly formatted
buffer descriptors results in this error. The error bit can be cleared by the EMAC soft
reset or by resetting the EMAC module in hardware.

Is there anything else I need to configure in PDK or NDK?

I use pdk_c665x_2_0_14 and ndk_3_60_00_13.

I am using TCP / IP and only modified NDK_TCP_NOPUSH in the default options.

Data is sent using the send() function, and the data size is variable.

Thank you and regards.

Myeongsu

  • Hi,

    First of all, how do you modify the NDK_TCP_NOPUSH, also on which Processor SDK RTOS example are you basing your application, or you just use the NIMU driver and write your own custom application on top of it?

    Best Regards,
    Yordan

  • Hi, Yordan

    I refer to ti/ndk_3_60_00_13/docs/ndk/NDK_API_Reference.html.

    XCONF (*. Cfg) setting related to EMAC is as follows :

    /* Load the CSL package */
    var devType = "c6657";
    var Csl = xdc.useModule('ti.csl.Settings');
    Csl.deviceType = devType;
    Csl.useCSLIntcLib = true;

    /* Load the OSAL package */
    var osType = "tirtos"
    var Osal = xdc.useModule('ti.osal.Settings');
    Osal.osType = osType;

    /* Load the EMAC packages */
    var Emac = xdc.loadPackage('ti.drv.emac');
    Emac.Settings.socType = devType;
    var socType = "c6657";

    var Nimu = xdc.loadPackage('ti.transport.ndk.nimu');
    Nimu.Settings.socType = socType;

    var Global = xdc.useModule('ti.ndk.config.Global');
    Global.enableCodeGeneration = true;
    var Tcp = xdc.useModule('ti.ndk.config.Tcp');
    var Ip = xdc.useModule('ti.ndk.config.Ip');
    Global.stackInitHook = null;
    Global.stackDeleteHook = null;
    Global.networkOpenHook = '&netOpenHook';
    Global.networkCloseHook = '&netCloseHook';

    Tcp.transmitBufSize = 65536;
    Ip.autoIp = false;
    Ip.address = "192.168.1.233";
    Ip.mask = "255.255.255.0";
    Ip.gatewayIpAddr = "192.168.1.254";
    Global.memRawPageCount = 16;

    Code related to TCP / IP is as follows : 

    void netOpenHook()
    {
        hNull = DaemonNew( SOCK_STREAMNC, 0, 4000, TCPIP_SERVER, 
                        OS_TASKPRILOW, OS_TASKSTKLOW, 0, 3 );
    }
    
    void netCloseHook()
    {
        DaemonFree(hNull);
    }
    
    int TCPIP_SERVER(SOCKET s, UINT32 unused )
    {
        int         recvByteNum;
        char        *pBuf;
        void        *hBuffer;
        (void)unused;
    
        recvByteNum = 1;
        setsockopt( s, IPPROTO_TCP, NDK_TCP_NOPUSH, &recvByteNum, 4 );
        server_soc = s;
    
        for(;;) {
    
            recvByteNum = (int)recvnc( s, (void **)&pBuf, 0, &hBuffer );
            if(recvByteNum > 0) {
                ...skip...  
            } else {
                break;
            }
        }
    
        fdClose( s );
        return(1);
    }

    The code of the transmission part is as follows : 

    status = send(server_soc, g_nTxBuffer, size, 0);

    Thank you and regards.

    Myeongsu

  • Hi,

    Sorry for the delay. What you're doing seems correct.

    It is possible that this is some kind of memory issue. Can you try going through the following user guides:
     

     

    And play with the buffer sizes (maybe lower the buffer size , I see you use size of 65536 bytes ?

    Best Regards,
    Yordan