- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Working on BCM20737 I need to keep some state information when the device enters Deep Sleep (HID off). what I need to keep is a pointer and a write buffer with values changing frequently therefore the NVRAM wouldn't help due to limited write cycles.
is there any way to keep this information in some special memory bank or buffer that won't be cleared when the device enters Deep sleep ?
Thanks !
Solved! Go to Solution.
- Labels:
-
Sleep Modes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi kwang,
sorry for my late reply
there is not much progress since I asked the question, I figured out a way to do my project without needing any of the state bits. but still would be nice if I can use them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that the bb and core are off during deep sleep, and you will also lost the ram content. Upon waking up, the application has to be reloaded onto ram and initialized again. That's why state information is not retained.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is what I know too, but since even in Deep sleep some parts of the chip are still powered on (the RTC and GPIO logic) I was wondering if there is an auxiliary memory that is retained, just a few bytes would be enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> We do not support the NVRAM feature in Deep Sleep mode.
Just to clarify here - what JT means is that no on-chip memory/storage block (RAM or otherwise) is powered on when in deep sleep. So you cannot store anything in it. There are a few bits available, but not enough for a pointer, see bleprofile_ReadNVRAM Return Value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks arvinds ! the mia_setKeepstate1() and mia_getKeepstate1() is exactly what I'm looking for, however when I try to store my values using them the deep sleep operation is disrupted. it seems that they are used internally.
can you confirm which bits are reserved and which are available for user applications ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Confirmed that two 16 bit registers for mia_setKeepstate0() and mia_getKeepstate1() will accomplish what you need.
Note that mia_setKeepstate0() bit 0 is used by the firmware, but the other 31 bits are available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply, however it seems that there is something missing here. starting from the sample application "rtc_sample" I just added one line after ble_trace0("rtc_sample_create()\n") to set upper 4 bits of Keepstate1, so the code is :
ble_trace0("rtc_sample_create()\n");
mia_setKeepstate1(0xF000);
This code enters and exits deep sleep correctly just once, on the second entry to deep sleep the chip never wakes up again (and I see that the current consumption is high, meaning that it didn't actually enter deep sleep)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Confused.
You were looking for a few NV bits to store some data right?
Now you are saying the chip never wakes up, yet because of the current consumption you are not sure it is even asleep. Does sleep work when you are not setting the upper 4 bits of Keepstate1? Not going to sleep is addressed in a dozen or so other threads on the site.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I'm trying to use setKeepstate1 and now the chip is misbehaving.
same project without the "mia_setKeepstate1(0xF000)" call goes to sleep and wakes after 5 seconds just as the example supposed to work.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sheref,
Can you use Keepstate0 bits 15 to 8 and see if this resolves the problem?
Thanks
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi kwang,
sorry for my late reply
there is not much progress since I asked the question, I figured out a way to do my project without needing any of the state bits. but still would be nice if I can use them.