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.08k stars 6.19k forks source link

Stm32-WB55RG high power consumption between adv peaks #69955

Open edantoni96 opened 4 months ago

edantoni96 commented 4 months ago

Describe the bug I'm migrating my project to Zephyr and tried to reach the same level of Power consumption as in the original project using only HAL and FREERTOS. In my original project I could see the power consumption between two advertising peaks reaching the lowest possible level at around 10uA. I saw an example for this feature in samples/boards/stm32/power_mgmt/stm32wb_ble but I haven't been able to achieve the lowest possible power consumption. I tried to build the example as it is but still couldn't manage to get the same result.

BLE CoProcessor Binary : stm32wb5x_BLE_HCILayer_fw.bin (V1.18.0)

My Observation CPU2 wakes up CPU1 from stop2 modes which is unlikely or CPU2 didn't go to STOP mode after advertising event.

To Reproduce Steps to reproduce the behavior:

  1. flash the coprocessor binary using version 1.18.0
  2. go to zephyrproject
  3. west build -b nucleo_wb55rg samples/boards/stm32/power_mgmt/stm32wb_ble
  4. flash the sample using west flash / stm32 cube programmer
  5. Measure the power using stm32 power monitor Sample, stm32wb pm ble

Expected behavior 37895 image

Impact The device cant reach expected power budget.

Environment (please complete the following information):

github-actions[bot] commented 4 months ago

Hi @edantoni96! We appreciate you submitting your first issue for our open-source project. šŸŒŸ

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. šŸ¤–šŸ’™

whati001 commented 3 months ago

Hi All,

I am facing exactly the same problem, as already explained within my discord message. My goal is to replace the existing application build upon ST hal and FreeRTOS with Zephyr. Unfortunately, as @edantoni96 has mentioned the current consumption during advertisement phase is significantly higher because something does not release the resource during advertisement idle phase.

Just to illustrate my findings, which are exactly what is mentioned by @edantoni96: 1) Board: nucleo_wb55rg 2) Zephyr commit 5d054a7eb8fa7786e6459bf348e3ea1ff7208566 3) Zephyr example: samples/boards/stm32/power_mgmt/stm32wb_ble 3.1) Change BLE advertisement interval to (min) 500 ms and (max) 600 ms 4) ST BLE Stack: stm32wb5x_BLE_HCILayer_fw.bin (V1.18.0) on CPU2

image As we can see in the screenshot above the power consumption statically increases once the ble host executes bt_le_adv_start and remains high until bt_le_adv_stop.


The question for me is now, if the HCI ble stack of ST simply does not stop CPU2 or if there is something else wrong with the host implementation in zephyr. The current app implementation, with the current consumption, leverages the full ble stack of ST.

erwango commented 3 months ago

The question for me is now, if the HCI ble stack of ST simply does not stop CPU2 or if there is something else wrong with the host implementation in zephyr.

This is coming from Zephyr integration.

whati001 commented 3 months ago

The question for me is now, if the HCI ble stack of ST simply does not stop CPU2 or if there is something else wrong with the host implementation in zephyr.

This is coming from Zephyr integration.

Nice that you already have a hint from where the issue comes from. If there is something I can support please let me know. Unfortunately, I am not an expert in zephyr's ble host but happy to help where I can so resolve this issue :)

erwango commented 3 months ago

Unfortunately, this is not high prio compared to others tasks. I'll make sure it won't be forgotten though and will keep you updated about the plan.

github-actions[bot] commented 1 month ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

whati001 commented 2 weeks ago

@Erwango Any update here?

erwango commented 2 weeks ago

@erwango Any update here?

Unfortunately no.