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.

CC3220SF: network processor state , (busy , idle etc..)

Part Number: CC3220SF

Hi, 

we are using CC3220SF in one of our product, we are use AWS FreeRtos. the mode of communication to the cloud is MQTT with QOS0. 

when we are trying to publish data to the cloud multiple packets , the last packet is missing some times. this is causing the problem. we are using IotMqtt_Publish function. 

When we are using IotMqtt_Publish function we get the status as IOT_MQTT_SUCCESS, then we are closing the connection and going to hibernate , our assumption is we are closing the connection when network processor is still sending the data or about to send data. 

To avoid this is there any way to know the status of the network processor the data is still in queue , or it is sending some data etc.. ? please let me know.  

we cannot use QOS1, we are battery operated device cant give some delay.

thanks, 

Harish  

  • Hi Harish,

    If a socket fails to transmit all queued packets before closing a socket, you should see a SL_ERROR_BSD_ECLOSE event in the async socket handler. Are you receiving one? There is also the SO_LINGER socket option.

    If you provide the following, I can help debug further:

    1. What CC32xx SDK version?
    2. What servicepack version is flashed to the CC3220?
    3. What AWS or MQTT library are you using?

    Best regards,

    Sarah

  • Hi Sarah, 

    Thanks for quick response, please find the details below. unfortunately we are not seeing any socket error at that situation and it is very time consuming to reproduce. since you are saying there is queue at socket, can we read the size of queue and then decide the application connection close. 

    Is it possible for host controller to read the size of the socket queue ?. so that we can check that and disconnect. 

    SDK version :

    #define IOT_SDK_VERSION    "4.0.0" 

    Servicepack version:

    simple link is -> 2.10.004

    AWS MQTT version: 

    Amazon FreeRTOS MQTT V2.1.0

    Amazon FreeRTOS V201908.00

    Thanks, 

    Harish 

  • Hi Harish,

    The network processor manages its own queue, so the application cannot access it. You can use the SO_LINGER option with sl_SetSockOpt() to wait until the queue is empty before closing the socket (or reach a timeout).

    2.10.00.04 is a SDK version. Do you have a servicepack flashed to the serial flash? This servicepack is in the tools/cc32xx_tools/servicepack-cc3x20 folder of the SDK, and it is loaded using UniFlash ImageCreator.

    Best regards,

    Sarah