cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

hi

MCU : CY8C4248LQI-BL583

Board : CY8CKIT-042-BLE-A

psoc project

- BLE_OTA_UpgradableStack_HID_Keyboard

- BLE_OTA_UpgradableStackExample_Launcher

- BLE_OTA_UpgradableStackExample_Stack

ble OTA working good.

how to stop hibernate power mode?

I want to keep "Active Mode".

thanks.

0 Likes
Reply
5 Replies
Employee

Hello,

The BLE stack event handler function has a condition to put the device into hibernate if the BLE is in disconnected state. You can comment this section to avoid the device going into hibernate.

case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

            DBG_PRINTF("CYBLE_EVT_ADVERTISING, state: %x \r\n", CyBle_GetState());

            if(CYBLE_STATE_DISCONNECTED == CyBle_GetState())

            {  

                /* Fast and slow advertising period complete, go to low power 

                 * mode (Hibernate mode) and wait for an external

                 * user event to wake up the device again */

                DBG_PRINTF("Hibernate \r\n");

                Advertising_LED_Write(LED_ON);

                LowPower_LED_Write(LED_ON);

                SW2_ClearInterrupt();

                Wakeup_Interrupt_ClearPending();

                Wakeup_Interrupt_Start();

                CySysPmHibernate();

            }

            break;

Thanks,

Hima

0 Likes
Reply
New Contributor II

I do not want to stop Ble

Ble status changes to "CYBLE_STATE_DISCONNECTED"

I want to know where to change the ble state to "CYBLE_STATE_DISCONNECTED"

Current Status : run this program (NOT USE BLE OTA) -> after about 1 minute -> Hibernate-> Bluetooth stop state

Desire state : run this program (NOT USE BLE OTA) -> stop Hibernate, run Bluetooth, MCU Active mode

i know if use BLE OTA, OTA function call CySoftwareReset();

It is okay to disconnect Bluetooth when using BLE OTA

thanks

0 Likes
Reply
Employee

Hello,

In the above code snippet , we are just checking if the BLE is in disconnected state. The state is changed to CYBLE_STATE_DISCONNECTED by the BLE susbsystem , user does not have involvement in that. So in the current project if there is no connection with a BLE central for a particular interval, then the device is put into Hibernate mode. You can remove the case statement which handles the Hibernation, then the device would be in active state even when there is no BLE connection.

Please let us know if this explanation helps.

Thanks,

Hima

0 Likes
Reply
New Contributor II

1) case 1

BLE_OTA_UpgradableStackExample_Stack01 -> main.c -> AppCallBack() -> case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

result : Reset -> after about 1 minute -> Hibernate-> Bluetooth stop state (CYSmart App not find PSOC BLE)

serial output :

> BLE Upgradable Stack Example Launcher

> Version: 1.20

> Compile Date and Time: Jan 24 2019 02:37:37

===============================================================================

=              BLE Upgradable Stack HID Keyboard

=              Version: 1.0

=              Compile Date and Time: Feb  2 2019 14:45:18

===============================================================================

Bluetooth On, StartAdvertisement with addr: 00a050cf691d

EVT_ADVERTISING, state: 3

EVT_ADVERTISING, state: 4

Hibernate

---------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------

2) case 2

BLE_OTA_UpgradableStackExample_Stack01 -> main.c -> AppCallBack() -> case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

BLE_OTA_UpgradableStack_HID_Keyboard01 -> main.c -> AppCallBack() -> case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:

result : Reset -> after about 1 minute -> Hibernate ??? -> Bluetooth stop state (CYSmart App not find PSOC BLE)

serial output :

> BLE Upgradable Stack Example Launcher

> Version: 1.20

> Compile Date and Time: Jan 24 2019 02:37:37

===============================================================================

=              BLE Upgradable Stack HID Keyboard

=              Version: 1.0

=              Compile Date and Time: Feb  2 2019 15:14:58

===============================================================================

Bluetooth On, StartAdvertisement with addr: 00a050cf691d

EVT_ADVERTISING, state: 3

EVT_ADVERTISING, state: 4

0 Likes
Reply
Employee

Hello,

Can you please elaborate the issue you are facing. I'm not clear about the requirement.

Thanks,

Hima

0 Likes
Reply