- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
SPI
- Tags:
- 1008
- 1212
- 13955
- 1416
- 2240
- 2297
- 37470
- 43198
- 4342
- 44424
- 45650
- 46876
- 5505
- 56065
- 56267
- 56470
- 56878
- 57079
- 5713
- 58100
- 59325
- 60000
- 9751
- 9861
- 9995
- announcement
- batteries
- board
- checkrunkeepalive
- current
- device
- dump
- high
- long
- lowest
- mode
- packet
- peripherals
- power
- running
- seconds
- sends
- serial
- state
- suspend
- thread
- time
- timeleft
- timer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your application should not be calling platform_power_down_hook(). This is done internally when there isn't any work to do done by any thread.
Instead your application should call wiced_rtos_delay_milliseconds() for the time you want to sleep. The WICED code will determine the duration of time it can sleep before it needs to wake up and service a thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply, but it's not quite what I'm looking for. I need to make sure the system goes into it's lowest power consumption at this point, ie a wfi. Doing a wiced_rtos_delay_milliseconds() is not necessarily going to do that. Plus it will cause that thread to go away for at least the amount of time I request in the iced_rtos_delay_milliseconds(), instead of coming back as soon as something 'interesting' (see my first post) happens and can take action. Also, one of the 'interesting' things is a button press that is on the WKUP pin, prompting an exit from a wfi that needs action taken ASAP. I can't seem to find a way to hook an exit from wfi without doing the platform_power_down_hook().
If there is a way, could that be pointed out?
And, I have to wonder if the platform_power_down_hook() wasn't meant to be called by user code, why it isn't documented as such.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When every thread is waiting or sleeping the idle thread will run which simply calls WFI causing the MCU to go to sleep.
Instead of delaying for a number of milliseconds you can wait on a message queue and have the events that you are interested in post messages to that queue.
All functions beginning with "platform_" are designed so they do not need to be called by any user application. They are used internally to abstract platform specific functionality from common WICED core code.
I will follow up later with some guidance on how to create custom power down hooks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried implementing with a semaphore (I haven't tried yet with an event), but now when the power usage is at its lowest, it is at 3.8ma. Switching off the semaphore and using the pd_hook, I get 3.0ma. For a while I was getting 2.1ma with the same setup (same AP, same distance from AP, same number of devices on the AP, same password, etc.). I don't know what's changed. But the wiced_rtos_get_semaphore using 0.8ma more is worrisome. I'm running on 4AA batteries. I need this even lower than the 2.1ma I was getting before.
If I switch to using an event instead of semaphore, will that change power? Is the order of wiced_wifi_enable_powersave & wiced_network_suspend done correctly, or do I have to NOT do one or both of them?
Also, as I suspected, my button does not work, since it's tied to the WKUP pin, and WICED takes over that ISR. Is there a way to insert my code into that ISR? Or some other way that my code can notice that the WKUP pin has been tickled.
And, a question has come up, does the module wake up (and wake up the processor) if it receives a broadcast from an AP it is not currently attached to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you run the the snip.ping_powersave app and see what kind of power usage you are getting at the lowest point?
Also, what instruments are you using and what is your test setup to measure the power usage?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this still an issue for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is still an issue, but not in the same way.
By messing with the power_down_hook code, and installing something that would call my code on a wfi wakeup so I can check my button state, I am able to get my button to wake things up.
But with or WITHOUT that code in place, I now get other power problems. We had current leakage on an other place on our board, taking an extra ~1ma (which is now fixed). And the differences I saw between the 3.1 and 2.1 was whether or not the Olimex dongle was attached or not. Now we have acceptable power draw at first. But if the network drops connection (I get a notification from the wiced_network_register_link_callback) and I then do a wiced_network_down, then restart my network connection, the power usage is up by ~800na (if I can reconnect at all), about twice as much as it is at first connection. If I reset the board, and go through the same reconnect code, it's back to the original power draw.
This is on both our (Rumble Dev) board and an Inventek eval board (ISM43362_M3G_L44). There's an extensive amount of code involved, too big to post here.
Is there an example someplace that shows how to reconnect after a dropped connection? I'm using WICED_STA_INTERFACE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure if its needed but if you need to attach a large file use the "Advanced Editor" (upper right corner).
Thank you for the additional info. We will let you know if we need any other information and see if we can help out.