2025-01-09 02:27 AM - last edited on 2025-01-09 03:58 AM by Peter BENSCH
I'm testing the sample project BLE_p2pServer on STM32WB09.
When the low-power mode (LPM) is not activated (CFG_LPM_SUPPORTED = 0 in app_conf.h) the project works OK.
To activate LPM I set CFG_LPM_SUPPORTED to 1, but that doesn't work and there is no advertising.
What must I do to activate LPM ?
2025-01-09 01:37 PM
Hello @LVanr.1
I’ve personally tested this and it works fine on my side. Could you please give more details about the modifications you have done on the project and what you have exactly done on your tests (with a full description including logs, versions of the CubeWB0 and IDEs used, How did you modified the project (on the code or from CubeMX),..).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-10 01:08 AM
STM32CubeIDE
Version: 1.17.0
Build: 23558_20241125_2245 (UTC)
STM32CubMX: Version 6.13.0
I do the following steps starting from scratch:
Remove existing project BLE_p2pServer
Select 'Delete project contents from disk' ==> does not work, so remove from workspace by hand
Import 'Import STM32Cube Example'
MCU/MPU: stm32wb09KEV6TTR
Select BLE_p2pServer -- Next -- Finish
Project BLE_p2pServer is installed in IDE
Build project -- fatal error
:/ST/workspace_1.16.0/BLE_p2pServer/Middlewares/ST/STM32_BLE/queued_writes/src/eatt_pwrq.c:24:10: fatal error: osal.h: No such file or directory
Open BLE_p2pServer.ioc
Project Manager > Code Generator > select 'Add necessary library files as .... '
Save and build -- fatal error
C:/Users/lvrk0/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Utilities/lpm/tiny_lpm/stm32_lpm.c:134: undefined reference to `UTILS_ENTER_CRITICAL_SECTION'
Change CFG_LPM_SUPPORTED from 1 to 0, either in MX (Middleware and Software > STM32_BLE > Configuration) or directly in app_config.h.
Build gives the following warning:
C:/Users/lvrk0/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Utilities/lpm/tiny_lpm/stm32_lpm.c:44:49: warning: implicit declaration of function 'UTILS_ENTER_CRITICAL_SECTION'; did you mean 'UTIL_LPM_ENTER_CRITICAL_SECTION'? [-Wimplicit-function-declaration]
Start debug ==> frame advertised as defined in app_ble.c (a_AdvData[])
In the version of BLE_p2pServer I had installed (and removed), the option CFG_LPM_SUPPORTED = 1 did build correctly (apart from the warning UTILS_ENTER_CRITICAL_SECTION) but did not broadcast, hence my posting on the forum.
2025-01-10 01:26 AM
Hello @LVanr.1
Could you please try to:
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-10 05:13 AM
Hi,
I did as you wrote. Delete project. Clicking on .cproject installed it.
Build ==> error
C:/Users/lvrk0/STM32Cube/Repository/STM32Cube_FW_WB0_V1.1.0/Utilities/lpm/tiny_lpm/stm32_lpm.c:134: undefined reference to `UTILS_ENTER_CRITICAL_SECTION'
Looks like the basic info on my disk is incorrect. The only way out seemed to be reinstalling Cube.
So I removed STM32CubIDE/MX from my PC. Then I installed version 1.17.0 from scratch at a different location and workspace.
Regarding p2pServer I did two things:
1. Via .cproject install BLE_p2pServer in the workspace. The build gave no error. Same problem though: broadcast when CFG_LPM_SUPPORTED has value 0. When CFG_LPM_SUPPORTED has value 1 sometimes there is a broadcast for a brief period, then nothing (I suspect when LPM set in).
2. Via File > Import> Import STM32Cube Example. After correction (updating .ioc) same behaviour.
2025-01-10 05:56 AM
This should not be the case. Could you try this test with different boards and different smartphone and apps. Try also to modify CFG_LPM_SUPPORTED directly on the app_conf.h file (not using MX).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-10 06:33 AM
Hi,
I have only one board. Getting another one may take some time and cost.
I always change CFG_LPM_SUPPORTED directly in app_conf.h.
With LPM mode enabled I sometimes see advertising for a very short period at startup. Hence I don't think the board is an issue. In other projects broadcasting works OK. I think it's a software issue ... but it could be a clocking issue (I'm not an expert in HW).
In a first phase I am not interested in the full p2p functionality, only in legacy broadcast without connect with very low power consumption.
As central scanner I use a smartphone with nRF.
Apart from acquiring another board I don't know how to proceed from here.
I'm open for other suggestions!
2025-01-10 06:39 AM
I've personally tested with two boards and the ST BLE Toolbox app. But I'm not able to reproduce this behavior.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-15 04:14 AM
Hi,
I got another wb09KE board and the problem persists: no advertising when LPM is enabled, except of a short broadcast period at start. I tried both in debug and release modes. When LPM is not enabled the broadcast works fine as well as a connect. I had a colleague check that my actions are correct.
I must mention another problem. On removing the p2pSever project from the workspace I had checked 'remove from disk'. Normally this means (and should mean !!!) 'remove project from workspace'. However having installed the project from .cproject the directory STM32CubeIDE (containing the .cproject file) is removed, so I'm unable to reinstall the project. Is there a way to fix this without doing a full install ?
This also happens when importing an existing project. I imported a project I had saved in a directory. After importing the original was removed (luckily I had made a backup).