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/CC2652P: Can I send the garbage data from ZNP-UART

Part Number: CC2652P
Other Parts Discussed in Thread: SYSBIOS, CC2530, TEST2

Tool/software: Code Composer Studio

Hi all,

I try to wake-up our gateway by sending garbage data. But after that, the ZNP does not work anymore. How to solve this problem ? Thank you

NPITask_ProcessTXQ()

uint8_t tempbuf[8] = {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa};

NPITL_writeTL(tempbuf, 8);

ti_sysbios_knl_Task_sleep(250*100);
ti_sysbios_knl_Task_sleep(250*100);
ti_sysbios_knl_Task_sleep(250*100);
ti_sysbios_knl_Task_sleep(250*100);
ti_sysbios_knl_Task_sleep(250*100);
NPITL_writeTL(recPtr->npiMsg->pBuf, recPtr->npiMsg->pBufSize);

 

  • Hi,

    I assume the host (gateway) supports wakeup by UART ?

    Can you specify what exactly failure means (non-responsive to host, MCU hanging, etc) ?

    Does the ZNP completely execute the function NPITask_ProcessTXQ ?
    If not, at which point does it fail ? Can you check the return value of the second call to NPITL_writeTL ?

    Regards,
    Toby

  • Hi Toby,

    We do the same thing with CC2530 and it work correctly. Looks like CC2652-ZNP no response to host.

    CC2530 - when ZNP receivce command from ZTool. It sends "tempbuf" 5 times and command response

    osal_memset(tempbuf,0xaa,8);
    for(uint8 i=0;i<5;i++)
    {
    dma_ret=HalUARTWriteDMA(tempbuf, 8);
    HalUARTPollDMA();
    delayMilliseconds(100);

    }

    dma_ret=HalUARTWriteDMA(buf, len);

    CC2652 - when ZNP receivce command from ZTool. It sends "tempbuf" but no response. First Uart-TX return 8, the second return 0

    if(Net3_sleep == 1) {
    test1 = NPITL_writeTL(tempbuf, 8);
    ti_sysbios_knl_Task_sleep(250*100);
    ti_sysbios_knl_Task_sleep(250*100);
    ti_sysbios_knl_Task_sleep(250*100);
    ti_sysbios_knl_Task_sleep(250*100);
    ti_sysbios_knl_Task_sleep(250*100);
    test2 = NPITL_writeTL(recPtr->npiMsg->pBuf, recPtr->npiMsg->pBufSize);
    }
    else {
    NPITL_writeTL(recPtr->npiMsg->pBuf, recPtr->npiMsg->pBufSize);
    }

  • Thanks for confirming.

    The function NPITL_writeTL was designed to handle one tx.
    With this in mind, it enters a critical section (see OsalPort_enterCS() and OsalPort_leaveCS()). While in this critical section, the UART tx callback is blocked from being called, so that the second call to NPITL_writeTL does not succeed (since it thinks the UART tx is not done yet).

    If you want to do two tx in the function, try moving OsalPort_leaveCS() to an earlier place in the code, such as after the Queue_dequeue, like the following:

    static void NPITask_ProcessTXQ(void)
    {
        uint32_t key;
        NPI_QueueRec *recPtr = NULL;
    
        // Processing of any TX Queue should only be done
        // in a critical section since any application
        // task can enqueue items freely
        key = OsalPort_enterCS();
    
        recPtr = Queue_dequeue(npiTxQueue);
    
        OsalPort_leaveCS(key); // move here the critical section exit
    
        // your code here
    
        //...
    
        // OsalPort_leaveCS(key); // remove this exit from CS
    }

  • Hi Toby,

    It works, thank you