cancel
Showing results for 
Search instead for 
Did you mean: 

Can you turn off the radio (BLE) on a BlueNRG LP (355MC)?

IJenk.1
Associate II

I am designing some firmware for a BlueNRG LP (355MC) based device with several sensors. At certain points in the device's processing/lifecycle, I need to turn off the BLE and/or radio to conserve power. In fact, I only need the device to have BLE connection capabilities during a very specific and short window. I don't need any connections until specific event/sensor triggers. The device will be battery powered and conserving energy is essential.

I can't seem to find any documentation on how to command or set the chip into an off, disabled, or standby state. All of the sample programs in the DK show initializing and enabling the BLE, but then it runs forever... So, is this possible to turn it off or disable it? Do I just make the device non-connectable and not advertising?

Thanks!

9 REPLIES 9
CM32
Associate II

I may be completely wrong - i havent tested - , but in rf_driver_ll_radio_2g4 there is:

LL_RADIO_GlobalDisableBlue

which may do what you want.

IJenk.1
Associate II

The LL_RADIO_GlobalDisableBlue (and corresponding Enable) do seem to *kill* the BLE connection. That is, when disabled, I cannot see the device on any BLE scanners, but it becomes immediately available when enabled... however, I don't believe this is turning off the BLE chip or making it go to sleep. In fact, after disabling with the above function, it appears I use *more* current than prior. I'm not sure why or what the BLE chip is doing, but my guess is that whatever configuration it has loaded isn't stopping it. Just its ability to transmit via the radio... maybe?

IJenk.1
Associate II

@Remi QUINTIN​ @Winfred LU​ Might either of you have any suggestions? Thanks.

Winfred LU
ST Employee

If there is not BLE activity, BLE radio will be automatically off.

So if the device is not advertising, and there is no connection, you don't need a specific command to turn the radio off.

IJenk.1
Associate II

Will this put the BLE chip into the standy or lowest power state? I assume this means that after I do the init procedure:

BLE_STACK_Init(&BLE_STACK_InitParams);
BLEPLAT_Init();
if (PKAMGR_Init() == PKAMGR_ERROR)
{
    while (1)
        ;
}
if (RNGMGR_Init() != RNGMGR_SUCCESS)
{
    while (1)
        ;
}
 
/* Init the AES block */
AESMGR_Init();

Then I can setup my gatt and gap:

ret = aci_gap_init(GAP_PERIPHERAL_ROLE, 0, 0x07, STATIC_RANDOM_ADDR, &service_handle, &dev_name_char_handle, &appearance_char_handle);
 
 ret = aci_gap_set_advertising_configuration( 0, GAP_MODE_GENERAL_DISCOVERABLE, ADV_PROP_CONNECTABLE|ADV_PROP_SCANNABLE|ADV_PROP_LEGACY, (ADV_INTERVAL_MIN_MS*1000)/625, (ADV_INTERVAL_MAX_MS*1000)/625,
                                              ADV_CH_ALL,
                                              0,NULL,
                                              ADV_NO_WHITE_LIST_USE,
                                              0, /* 0 dBm */
                                              LE_1M_PHY, /* Primary advertising PHY */
                                              0, /* 0 skips */
                                              LE_1M_PHY, /* Secondary advertising PHY. Not used with legacy advertising. */
                                              0, /* SID */
                                              0 /* No scan request notifications */);
 
ret = aci_gap_set_advertising_data( 0, ADV_COMPLETE_DATA, sizeof(adv_data), adv_data);
 
/* add services */

And from then on out, I can control whether the BLE chip runs using:

 ret = aci_gap_set_advertising_enable(ENABLE, 1, Advertising_Set_Parameters);

Or alternatively, using DISABLE.

Does this work?

@Winfred LU​  Thanks for your input on this. It is very helpful.

Winfred LU
ST Employee

aci_gap_set_advertising_enable() can be used to disable the advertising.

Configure proper wake-up sources and enter low power state with calling HAL_PWR_MNGR_Request() with some level such as POWER_SAVE_LEVEL_STOP_WITH_TIMER.

Please refer to the Micro_PowerManager sample projects in SDK.

IJenk.1
Associate II

@Winfred LU​ If aci_gap_set_advertising_enable() is disabled, do I also need to disable the wakeup generated by the BLE chip to the CPU?

In the RM0480-Rev2 - Radio Controller manual, it mentions BLUE_SLEEP_REQUEST_MODE and WAKEUP_BLE_IRQ_ENABLE... do I need to manually set those or will the HAL and HCI libraries handle this?

IJenk.1
Associate II

@Sebastien DENOUAL​ Do you have any thoughts on this thread? I want to make sure the BLE chip isn't consuming power when I don't need it. Specifically, I want to be able to activate the BLE, for example, on the press of a button... so, while the button is not pressed, no BLE is consuming power.

I've seen the SystemInit call includes the BLE clock. Is there a way to "de-init" that clock in particular? Is that enough? I've seen the documentation describing the BLE stack programming. It mentions a sleep mode, but I don't understand how to trigger it using the provided libraries. No code examples perform this sort of functionality, turning on/off the BLE. Is it enough to set the advertising to DISABLE? Should I be using BLUE_SPEEP_REQUEST_MODE? Disabling the IRQ?

I want the main CPU to function as if BLE doesn't exist... and when triggered, I want BLE to come up and function normally, until the trigger is removed, at which time I want it to disappear again. All of the HAL POWER MANAGER Request functions rely on querying the BLE chip. I want to make sure the BLE never wakes up the main CPU unless the trigger says it BLE time.

Hi @IJenk.1​ ,

Let me endorse previous message from @Winfred LU​  - "If there is not BLE activity, BLE radio will be automatically off."

In your application main loop : you just need to ask for desired level thanks to HAL_PWR_MNGR_Request() API.

During SleepMode negociation (STACK vs Appli vs Timer) .. If there is no BLE activities ongoing, BLE_Stack will accept maximum Sleep mode level. So at the end, if there is no BLE activities, applied level is the one you asked at application level.

For sleep mode management : I would advise to look to dedicated code examples from SDK :

..\BlueNRG-LP_LPS DK 1.2.0\Projects\Periph_Examples\MIX\MICRO\MICRO_PowerManager

Also almost all BLE code examples implements sleep mode (BLE_Beacon, BLE_SensorDemo, BLE_Security,...)

Regards,

Sebastien.