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.
Hi,
When my CC2541 peripheral is inactive for a certain period of time, I would like it to enter power saving mode.
I would like to have two power saving scenarios:
Questions regarding Scenario A:
A.1. According to the CC2541 user guide: "PM3 is used to achieve ultralow power consumption when waiting for an external event. It should be used when expected sleep time exceeds 3 ms.". I assume these "external events" cover button presses. What other (hardware) events can trigger a wake-up from PM3?
A.2. More specifically to the above - which interrupts can wake the processor from PM3, and where can I find the code to control this behavior?
A.3. What is the correct way to enter PM3? There are several API functions that I suspect might work, but aren't documented clearly enough (in my opinion):
Questions regarding scenario B:
B.1. What is the minimum possible power management mode that still listens to wireless communications?
B.2. In the above mode, how fine-grained can I make the wake-up condition without compromising on power usage. Specifically - can I make the peripheral wake up only when communications from a specific "central" occur? Can I make it listen to any request?
B.3. Can the above be effectively achieved by simply turning off advertisement packets (or increasing the advertisement delay to maximum possible)?
B.4. What is the correct way to enter the appropriate power management mode to this scenario?
I realize there are other posts similar to this in the forum, but I didn't find the answers I needed elsewhere, so I thought it best to ask again.
Thanks in advance!
Hi Amir,
Yes, the "external events" cover button presses. It's typically a GPIO configured with interrupt, so you could essentially use any of the pins on the three ports. The power modes PM2 and PM3 are handled automatically by the stack if you use the software define POWER_SAVING. It's the Operating System Abstraction Layer (OSAL) that handles the decision to go into PM2 (ex. during connection and/or if OSAL timers are set) or PM3 (if no events or tasks are pending).
In Bluetooth low energy, a connection is maintained by acknowledging the link continuously during so called connection events, which are separated with a connection interval (minimum 7.5ms up to 4s). Between these connection events, the device will typically be in sleep mode (PM2).
Bottom line, you don't have to over analyze this, it's handled by the stack and it's optimized for lowest possible power consumption..
Best Regards
Hi,
we have a device that does not have any buttons. So we cannot enter PM3 but we should enter PM2.
How can we achieve this? When using the POWER_SAVING Macro, the device seems to enter PM3 and since we
do not have any buttons, it never wakes up.
Thanks!
Marcus
When you use POWER_SAVING in your project, you can use osal_start_timerEx to set a timer event to wake up from PM3.
Thanks for your answer. I just saw this behavior in the hal_sleep implementation.
Anyway, I do have another issue now. On our hardware, the device won't go into power saving mode at all.
The macro POWER_SAVING is enabled.
When calling i.e. "HalSleep(10000)" the device goes into power saving sleep.
However, the OSAL Layer seems to have a problem going to sleep on our hardware.
The sleep actually does work on the hardware...otherwise the HalSleep(10000) hadn't worked.
Any ideas?
If OSAL doesn't enter sleep mode, that means that there is unfinished task in OSAL. I suggest you to check if you keep creating events in application.
I have now made several tests, but I cannot find the root cause.
Our setup is:
- Firmware: Simple BLE Peripheral demo example.
- Hardware: BLE113 (based on CC2541 128k) without any keys/buttons/...
- Compiler / IDE: IAR Workbench 8.20.2
Actually I have identified several issues related to POWER_SAVING enabled:
1) Device does not enter sleep
2) Device is not discoverable or only sometimes. So it does not work reliable
ad1)
- When disabling BLE (by not calling GAPRole_StartDevice) -> power saving seems to work
- When enabling BLE (GAPRole_StartDevice) -> power saving does not work
The advertisement and connection intervals have been set to about 4sec. So there should be enough time for the BLE Layer to go to sleep.
It seems that in hal_sleep.c the following statement is always false:
if ( LL_PowerOffReq(halPwrMgtMode) == LL_SLEEP_REQUEST_ALLOWED )
Is there anything else that we can check?
Thanks
Marcus
Hi Marcus,
I'm facing the same problem.
I'm testing the Simple BLE Peripheral demo on BLE113 128K Flash Hardware without any kays/botton.
All seems to work fine for 10 Hours.. After that, the BLE113 stop to respond to scan request and it is impossible to connect to the device.
The only way to restore the normal work is to disconnect the 3V battery and reconnect again.
I notice also that when the BLE113 stop to work, the battery (CR2032) charge level go down from 90% to 60%.
The Same software compiled and tested on TI CC2540 Keyfob work fine.
Any Feedback from TI ??
Thanks,
Vittorio