zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.63k stars 6.51k forks source link

No power consumption is generated when Bluetooth is not needed on board nucleo_wba52cg #70934

Open 2024markLuo opened 6 months ago

2024markLuo commented 6 months ago

Is your feature request related to a problem? Please describe. We call bt_enable() on board nucleo_wba52cg, it will increase power consumption by more than 300 uA. Call bt_disable(), it always failed, and the power comsumption, power consumption will never decrease. The overall power consumption target of our product when sleeping is less than 10uA.

Describe the solution you'd like The overall power consumption target of our product when sleeping is less than 10uA, so the bluetooth can not generate power comsumption when produce enter sleeping mode.

Describe alternatives you've considered

Additional context

asm5878 commented 5 months ago

Hello @2024markLuo,

I can confirm the behavior you have is the "expected" one, as "close" is not (yet) implemented in the STM32WBA hci driver.

Just having a look at bt_enable / bt_disable implementations at zephyr\subsys\bluetooth\host\hci_core.c: "bt_enable" is mapped on "open" of hci driver. "bt_disable" is mapped on "close" of hci driver.

You should obtain ENOSUP error as we have this snippet in bt_disable:

    if (!bt_dev.drv->close) {
        return -ENOTSUP;
    }

Sorry for any inconvenience and we will keep you posted when this function will be implemented.