You are here

exit from DEEPSLEEP | Cypress Semiconductor

exit from DEEPSLEEP

Summary: 18 Replies, Latest post by chaplin.u_1533771 on 12 Oct 2016 11:24 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
chaplin.u_1533771's picture
User
106 posts

in http://www.cypress.com/go/AN92584 I read this :

The BLESS DEEPSLEEP and SLEEP modes are entered under application control. The exit may be initiated in one of two ways:
o The application calls the CyBle_EnterLPM() function with the input parameter as ACTIVE.

I can`t find ANY example of calls the CyBle_EnterLPM() function with the input parameter as ACTIVE.

Please help.

user_1377889's picture
User
9627 posts

Open the BLE datasheet and search for CyBle_EnterLPM.

 

Bob

chaplin.u_1533771's picture
User
106 posts

Sorry about my mistake ( I`m not make this word big enough) EXAMPLE of code.

 

user_1377889's picture
User
9627 posts

I should put on my glasses ;-)

 

Bob

user_242978793's picture
User
1042 posts

I think this program covers this.

user_242978793's picture
User
1042 posts

Here are the programs for the App note.

I did notice that they don't have the code for this issue.

chaplin.u_1533771's picture
User
106 posts

In all examples you provided I can`t find CyBle_EnterLPM() function with the input parameter as ACTIVE.

Why you provided it ? I have 100 examples without it ...

user_242978793's picture
User
1042 posts

Low power startup program has this function I checked for it. Did you look at the Ble API spec's it should be in it.

user_242978793's picture
User
1042 posts

This function requests the underlying BLE modules such as BLE Controller, BLE Host Stack and BLE Stack manger to enter into one of the supported low power modes. Application should use this function to put Bluetooth Low Energy Sub-System (BLESS) to Low Power Mode (LPM).

BLE Stack enters and exits low power modes based on its current state and hence the application should consider the BLE Stack LPM state before putting the CPU or the overall device into LPM. This function attempts to set the requested low power mode and if that is not possible, it tries to set the next higher low-power-mode. This behavior is due to the requirement that the application will always try to use the lowest power mode when there is nothing that it needs to process. Note that the CPU will not be able to access the BLESS registers when BLESS is in deep sleep mode.

BLE Stack has the following power modes:

Active
Sleep (Low Power Mode)
DeepSleep with ECO Off (Low Power Mode)
Hibernate (Low Power Mode)

Note that certain conditions may prevent BLE sub system from entering a particular low power mode.

Active Mode

Bluetooth Low Energy Sub System (BLESS) has three sub-modes in Active mode:

Idle
Transmit Mode, and
Receive Mode

These modes draw full current from the device and the CPU has full access to its registers.

Sleep Mode

The clock to the link layer engine and digital modem is gated and the (External Crystal Oscillator) ECO continues to run to maintain the link layer timing. The application cannot enter sleep mode if a Transmit or Receive is in progress.

Deep Sleep with ECO Off Mode

The ECO is stopped and Watch Crystal Oscillator (WCO) is used to maintain link layer timing. All the regulators in the Radio Frequency (RF) transceiver are turned off to reduce leakage current and BLESS logic is kept powered ON from the System Resources Sub System (SRSS) deep-sleep regulator for retention of current BLESS state information. This mode can be entered from either Idle (Active) or Sleep mode. It should be entered when the next scheduled activity instant in time domain is greater than the Deep Sleep total wakeup time (typically 2ms).

NOTE: If application is using ECO as source of HFCLK for higher clock accuracy and calls this API to move BLESS to Deep Sleep mode then HFCLK accuracy and frequency would be impacted as this API switches HFCLK source from ECO to IMO. On BLESS wakeup, the HFCLK source would be switched back to ECO.

Recommendation is that application turns on IMO and sets it as HFCLK source before calling this API. Upon wakeup due to sources other than BLESS, application can turn on ECO and switch HFCLK source to ECO. Pseudo code of recommendation is given below.

Pseudo Code: //Turn on IMO and switch HFCLK to IMO CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP); CySysPmDeepSleep(); //If exit is not due to BLE and application need to use ECO //then turn on ECO and switch HFCLK source to ECO.

Hibernate mode

The application layer should invoke this function with the Hibernate Mode option to put the BLE Stack in to hibernate mode. If this mode is set, the micro-controller can be put in to Hibernate Mode by the application layer. This mode ensures that BLE Sub-system is completely idle and no procedures such ADV, SCAN and CONNECTION are active.

The following table indicates the allowed sleep modes for the complete system (BLE Sub-system and the micro-controller). Modes marked In 'X' are the allowed combinations. The application layer should make sure that the invalid modes are not entered in to:

BLE Stack LPM / PSoC4A-BLE LPM Active Sleep DeepSleep Hibernate
Active X

Sleep X X

DeepSleep (ECO OFF) X X X
Hibernate

X

The application layer is responsible for putting the BLE Sub-system and the micro-controller in to the desired sleep modes. Upon entering the requested sleep mode combination, the BLE Sub-system and the micro-controller are woken up by an interrupt every advertisement interval(in case of a GAP Peripheral) or connection interval (in case of GAP Central). On wakeup, if the application needs to transmit some data, appropriate function(s) including the Stack functions need to be invoked. This needs to be followed by a call to the function CyBle_ProcessEvents, which handles all pending transmit and receive operations. The application can now put the complete system back in to one of the sleep modes. The application should ensure that the above invalid states are never encountered.

Application shall also ensure that BLE Sub-system's low power entry and low power exit interrupts are processed in realtime and not blocked. It is recommended that BLE Sub-system interrupt should be of higher priority. If BLE Sub-system interrupts are blocked for longer time ( > 200us ), BLE Sub-system can violate Bluetooth specification timing for wakeup where ECO is required to perform BLE radio operation. It can also result in race condition where BLE Stack waits for interrupt as ECO is not started correctly and BLE Sub system enters in unknown state, BLE Stack gets stuck in busy loop.

This is a blocking function. In process of entering in BLESS Deep Sleep Mode, BLE Stack puts CPU in Sleep Mode to save power while polling for entry indication to BLESS DSM. No event is generated on calling this function. Based on the return code from this function, the application layer should decide on the sleep mode for the complete system. For example, if the return code is CYBLE_BLESS_DEEPSLEEP, the application can choose to call system wide DeepSleep mode function.

Parameters

pwrMode The power mode that the component is intended to enter. The allowed values are,

CYBLE_BLESS_SLEEP
CYBLE_BLESS_DEEPSLEEP

Returns
CYBLE_LP_MODE_T: The actual power mode that BLE stack is now set to.

chaplin.u_1533771's picture
User
106 posts

I don`t understand why you do it. I can read manuals and I placed link to excellent doc with code snippets. But in all manuals and documents and examples not exist ANY code snippet for using this call. 

Please don`t send spam.

user_242978793's picture
User
1042 posts

I opened a support  case with Cypress on your issue and will get back with you when they respond.

Log in to post new comments.