AWR2544: AWR2544: Cannot access to the RX data of ENET

Part Number: AWR2544

File location: C:\ti\mmwave_mcuplus_sdk_04_06_00_01\mmwave_mcuplus_sdk_04_06_00_01\ti\demo\awr2544\mmw\mmw_enet\mmw_enet.c

Function name: static void MmwEnet_rxTask(void *args)

I added some codes to print the content of RX data as below. (The program stops at the location marked in red.)

My question is how can I access the data of pktInfo->sgList.list[0].bufPtr;

=================================================================

while(1)
    {
        SemaphoreP_pend(&mmwEnetObj.rxSemObj, SystemP_WAIT_FOREVER);
        /* Get the packets received so far */
        rxReadyCnt = MmwEnet_receivePkts();

 

        if (rxReadyCnt > 0U)
        {
            EnetAppUtils_print("rxReadyCnt = %d\r\n", rxReadyCnt);  // Here is OK
            /* Consume the received packets and release them */
            pktInfo = (EnetDma_Pkt *)EnetQueue_deq(&mmwEnetObj.rxReadyQ);
            while (NULL != pktInfo)
            {
                EnetDma_checkPktState(&pktInfo->pktState,
                                        ENET_PKTSTATE_MODULE_APP,
                                        ENET_PKTSTATE_APP_WITH_READYQ,
                                        ENET_PKTSTATE_APP_WITH_FREEQ);
                frame = (EthFrame *)pktInfo->sgList.list[0].bufPtr;
                EnetAppUtils_print("Filled len = %d, Alloc len = %d\r\n"pktInfo->sgList.list[0].segmentFilledLenpktInfo->sgList.list[0].segmentAllocLen); // Here is OK and print:Filled len = 60, Alloc len = 1536
                EnetAppUtils_print("buf address = %p\r\n", frame); // Here is OK and print:buf address = C025B800
                EnetAppUtils_print("eth Type = %04x\r\n"frame->hdr.etherType); // <====The program stops here !!! And the entire program has been blocked by the this statement. 
                EnetAppUtils_print("Check point 1111 \r\n"); // Cannot  print any log.
 
........
  • Hi, 

    How and where are you defining the frame variable?

    Regards,
    Anirban

  • Sorry, I didn't paste the entire function.

    the variable frame was defined in the function, like other example codes.


    static void MmwEnet_rxTask(void *args)
    {
        EnetDma_Pkt *pktInfo;
        volatile uint32_t rxReadyCnt;
        int32_t status = ENET_SOK;
        EthFrame *frame;   // <=== defined here

        mmwEnetObj.totalRxCnt = 0U;

        /* Wait for packet reception */
       while(1)
        {
            SemaphoreP_pend(&mmwEnetObj.rxSemObj, SystemP_WAIT_FOREVER);
            /* Get the packets received so far */
            rxReadyCnt = MmwEnet_receivePkts();

     

            if (rxReadyCnt > 0U)
            {
                EnetAppUtils_print("rxReadyCnt = %d\r\n", rxReadyCnt);  // Here is OK
                /* Consume the received packets and release them */
                pktInfo = (EnetDma_Pkt *)EnetQueue_deq(&mmwEnetObj.rxReadyQ);
                while (NULL != pktInfo)
                {
                    EnetDma_checkPktState(&pktInfo->pktState,
                                            ENET_PKTSTATE_MODULE_APP,
                                            ENET_PKTSTATE_APP_WITH_READYQ,
                                            ENET_PKTSTATE_APP_WITH_FREEQ);
                    frame = (EthFrame *)pktInfo->sgList.list[0].bufPtr;
                    EnetAppUtils_print("Filled len = %d, Alloc len = %d\r\n"pktInfo->sgList.list[0].segmentFilledLenpktInfo->sgList.list[0].segmentAllocLen); // Here is OK and print:Filled len = 60, Alloc len = 1536
                    EnetAppUtils_print("buf address = %p\r\n", frame); // Here is OK and print:buf address = C025B800
                    EnetAppUtils_print("eth Type = %04x\r\n"frame->hdr.etherType); // <====The program stops here !!! And the entire program has been blocked by the this statement. 
                    EnetAppUtils_print("Check point 1111 \r\n")// Cannot  print any log.
     
    ........
  • Hi,

    Your problem seems to be related to some incorrect pointer operation.

    I'd highly appreciate if you can go over it thoroughly.

    Regards,
    Anirban

  • I cannot find any incorrect operations with the pointer. Can you show me where the error is?

    The pointer 'frame' is a local variable and is set as follows: 'frame = (EthFrame *)pktInfo->sgList.list[0].bufPtr;' This statement is located below the 'EnetDma_checkPktState(...)' call.

    When I comment out or remove the statement: 'EnetAppUtils_print("eth Type = %04x\r\n", frame->hdr.etherType);' the program runs without issues.

    Similarly, if I replace 'frame' with '(EthFrame *)pktInfo->sgList.list[0].bufPtr', the program also stops at that point.

    I'd greatly appreciate if TI engineers could check this. It has beening blocking my work for a few of days.

    How can I access the items of pktInfo->sgList.list[0].bufPtr in the RX task?

  • Hi,

    Can you store the value of ether type in some variable and then print the same?

    BR,

    Animesh Anand

  • Yes, I tried to memcpy the value of bufPrt to another buffer. The program was also blocked the statement of memcpy, as shown below:

    memcpy(tempBuffer, pktInfo->sgList.list[0].bufPtr, 10); // the program is blocked here

    Here, the "tempBuffer" was defined as: uint8_t tempBuffer[10]. 

    P.S. Regardless of the number of cpoied bytes, even for 1 byte, the program will be blocked there.

    Do you have any idea? Thanks.

  • Hi,

    Can you check in CCS, is there any data stored in frame or not? Add the name frame in expression window of CCS.

    BR,

    Animesh Anand

  • Sorry. I cann't check it in CCS because I builded the demo with the "make" command in the terminal window and burned the image with COM port.

    Is there any other way to find out what the problem is?

    Can the TI engineers reproduce this issue in their local envirement?

    Thanks.

  • Hi,

    Even if you build the project using make command then also you can check on CCS. Just load the respective binaries .out file on respective core. then step inside the code line by line and check the value of frame inside the expression window.

    BR,

    Animesh Anand