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-LAUNCHXL: How to get device awake time

Part Number: CC3220SF-LAUNCHXL
Hi,
I am using Hibernate (for every 20 mins) once the application routine finishes the task. 
 
1. Is there any way I can get the device statistics like Awake Time? 
 
For example, How much time the controller is awake and serving for the application routine to finish. 
(In detail, after waking up from Hibernate and before going to Hibernate time difference).

I'm planning 2 RTC timestamp differences Application start timestamp and Application End Timestamp this is the only way I can achieve the same or any alternatives please suggest.

2. I am using AWS-MQTT to publish the data, I can see only for sl_WlanRxStatGet() average data packets received, but is there any way I can get the average data packets transferred time? 

Regards,

Suresh

  • Hi Suresh,

    1. If you want to know how much time the application spends awake, the RTC timestamp mechanism is fine. You could also check the fast clock registers, or perhaps use a hardware timer peripheral, depending on your time precision needs.

    2. There isn't any concrete way to get the packet transmission time. If you use the sl_DeviceStatGet() API, you can fetch the SlDeviceGetPmStatAcc_t struct, which has in it the TimeMacAwake and TimeNWPAwake member variables. That corresponds to how long the NWP/MAC has been awake, generally only for data send/receive. It's not quite only the packet transfer time, but you can monitor that to see how long the Wi-Fi functionality is active and use that for power statistics.

    Regards,

    Michael

  • Hi Michael,

    Thanks for your response,

    As I am using Old SDK version v2_10_00_04 along with AWS-FreeRTOS examples, failed to add sl_DeviceStatGet() API support. 

    While adding I am facing the following linker error in IAR. Error[Li005]: no definition for "sl_DeviceStatGet" 

     

    For this particular SDK version(v2_10_00_04) is there any alternative I can get "packet transmission time"?

    or Am I missing something to add sl_DeviceStatGet() API support? Please guide me

    Regards,

    Suresh

  • Hi Suresh,

    The sl_DeviceStatGet() API is only present in newer versions of the SDK. If the AWS-FreeRTOS SDK is using v.2.xx.xx.xx, then it will not have that function.

    You can attempt to add that function into your host driver. To do so, you can copy over the relevant code implementation from the new device.c of the host driver, and also add the defines and opcodes needed. Do note you will also need the supporting functions such as sl_DeviceStatStart().

    As that sl_DeviceStatGet() was the solution to allow the application to fetch more detailed stats on the NWP operation, there isn't any obvious alternative that you can use. You will need to implement that function or update the SDK version used by AWS-FreeRTOS.

    Regards,

    Michael