MCU powersave issues

Unsolved
robjderr's picture
robjderr
Junior(0)

I'm having issues with timing when I enable mcu powersave (wiced_platform_mcu_enable_powersave).  I've put a small program at the bottom to demonstrates the issue.

 

The program just prints out the timestamp once a minute.  When mcp powersave is disabled, the timing is very consistent.  When enabled, the interval and the internal time-tracking are messed up.

 

Example output with each line timestamped:

 

Thu Apr 28 14:33:18 2016:  Starting WICED

...

Thu Apr 28 14:33:42 2016:  Enable MCU powersave

Thu Apr 28 14:33:42 2016:  Create thread and timed event

Thu Apr 28 14:33:42 2016:  Running

Thu Apr 28 14:34:20 2016:  Time: 1970-01-01T00:02:19.043568 <-- Should be one minute intervals

Thu Apr 28 14:34:30 2016:  Time: 1970-01-01T00:03:49.029000 <-- Printed 10 seconds later. Module thinks one minute 30 seconds has passed

Thu Apr 28 14:35:13 2016:  Time: 1970-01-01T00:05:50.042392

Thu Apr 28 14:35:55 2016:  Time: 1970-01-01T00:07:50.030248

Thu Apr 28 14:36:36 2016:  Time: 1970-01-01T00:09:49.057640

Thu Apr 28 14:37:17 2016:  Time: 1970-01-01T00:11:48.003000

Thu Apr 28 14:38:06 2016:  Time: 1970-01-01T00:13:55.058392

 

Without mcu powersave enabled:

 

Thu Apr 28 15:02:36 2016:  Starting WICED

...

Thu Apr 28 15:03:00 2016:  Create thread and timed event

Thu Apr 28 15:03:00 2016:  Running

Thu Apr 28 15:04:00 2016:  Time: 1970-01-01T00:01:23.057712

Thu Apr 28 15:05:00 2016:  Time: 1970-01-01T00:02:23.057712

Thu Apr 28 15:06:00 2016:  Time: 1970-01-01T00:03:23.057712

Thu Apr 28 15:07:00 2016:  Time: 1970-01-01T00:04:23.057712

Thu Apr 28 15:08:00 2016:  Time: 1970-01-01T00:05:23.057712

Thu Apr 28 15:09:00 2016:  Time: 1970-01-01T00:06:23.057712

Thu Apr 28 15:10:00 2016:  Time: 1970-01-01T00:07:23.057712

Thu Apr 28 15:11:00 2016:  Time: 1970-01-01T00:08:23.057712

Thu Apr 28 15:12:00 2016:  Time: 1970-01-01T00:09:23.057712

Thu Apr 28 15:13:00 2016:  Time: 1970-01-01T00:10:23.057712

Thu Apr 28 15:14:00 2016:  Time: 1970-01-01T00:11:23.057712

 

 

I'm running WICED SDK 3.5.2 with the Avnet BCM4343W IoT module. Compiled with snip.mcu_powersave-BCM94343W_AVN download run.  Anyone have any idea what's wrong?

 

Thanks,

-Rob

*** Demonstration program

#include "wiced.h"

 

static wiced_result_t timed_event(void* arg);

 

static wiced_worker_thread_t event_worker_thread;

static wiced_timed_event_t timed_event_handle;

 

void application_start(void) {

    WPRINT_APP_INFO(("Starting WICED\n"));

    wiced_init();

 

    WPRINT_APP_INFO(("Connecting WIFI\n"));

    wiced_network_up( WICED_STA_INTERFACE, WICED_USE_EXTERNAL_DHCP_SERVER, NULL );

 

    WPRINT_APP_INFO(("Enable MCU powersave\n"));

    wiced_platform_mcu_enable_powersave();

 

    WPRINT_APP_INFO(("Create thread and timed event\n"));

    wiced_rtos_create_worker_thread(&event_worker_thread, WICED_NETWORK_WORKER_PRIORITY, (10 * 1024), 1);

    wiced_rtos_register_timed_event(&timed_event_handle, &event_worker_thread, timed_event, 60 * 1000, NULL);

 

    WPRINT_APP_INFO(("Running\n"));

}

 

static wiced_result_t timed_event(void* arg) {

wiced_utc_time_ms_t utc_time_ms;

wiced_iso8601_time_t iso8601_time;

 

    wiced_time_get_utc_time_ms(&utc_time_ms);

    wiced_time_convert_utc_ms_to_iso8601(utc_time_ms, &iso8601_time);

 

    WPRINT_APP_INFO(("Time: %.26s\n", (char*)&iso8601_time));

 

wiced_ip_address_t address;

    wiced_hostname_lookup("www.google.com", &address, 30000);

 

return WICED_SUCCESS;

}

 

 

 

 

PeterF's picture
PeterF
Moderator(16)

Rob

 

I was able to repeat the erratic results you were seeing, but your posting yesterday on the WICED WiFi forum is the best approach for getting this resolved, as a wider group of Broadcom specialist resources will be reached there. 

 

Have you already worked through the Broadcom MMPWICED-AN104-R PowerSave App Note? (attached here...)

robjderr's picture
robjderr
Junior(0)

Yes, I've already read through the app note.  The only thing I wasn't able to figure out is if the module has a 32 kHz RTC timer.  The document says "There should be no noticeable difference in the operation of an application when MCU powersave is enabled, other than a significant reduction in current consumption when the processor idles, and a possible reduction in maximum network data throughput."

Unfortunatly, no one has responsed to my question on the WICED Forum yet...  

Thanks,

-Rob

 

Rowan382's picture
Rowan382
Junior(0)

Check your working at MCU power save and see if you are facing any error in the server. The ukbestessays review shares some of the videos which you can watch and try to see where you did the mistake.