2022-05-29 11:09 AM
See attached clocking setup. When I run this, BLE is unreliable. I am running STM32WB55CGU6 in server/peripheral mode. For example, sometimes on power up advertising is occurring and sometimes it does not. And if advertising does work, connecting from my smart phone almost never works. If I change CPU1 to 32MHz, it works great every time and is 100% reliable. I want to run CPU1 at 16MHz to save battery life. I can't run CPU1 any lower because I am running 5 channel ADC DMA constantly at 400kHz sample rate (5x400kHz is 2MHz sample rate for ADC). Is 16MHz on CPU just too slow with all this DMA to SRAM activity? Note that DMA is active but CPU is not doing anything during this time, except servicing BLE.
Solved! Go to Solution.
2022-06-08 06:16 AM
Hello,
CPU1 can run to 16 MHz with BLE, only CPU2 must run to 32 MHz. I see in your screenshot that HCLK4 is set to 16 MHz but HCLK4 shall run to 32 MHz for SRAM2 access. Can you change HCLK4 HPRE in order to have 32 MHz for HCLK4 and retry your application ?
Best Regards
2022-05-29 11:24 AM
Also forgot to mention that I also ran with debugger via STM32CubeIDE and I see no errors when advertising is not occurring:
Wireless Firmware version 1.13.0
Wireless Firmware build 5
FUS version 1.2.0
SHCI_SUB_EVT_CODE_READY - WIRELESS_FW_RUNNING
DBGMCU_GetRevisionID= 2001
Successfully Start Fast Advertising
2022-05-29 11:42 AM
And if I cycle the power a bunch of times, sometimes advertising works. But in this case the connect from client never works (client says STM32WB is not answering connect request). However the debug output on STM32CubeIDE shows healthy operation.
Wireless Firmware version 1.13.0
Wireless Firmware build 5
FUS version 1.2.0
SHCI_SUB_EVT_CODE_READY - WIRELESS_FW_RUNNING
DBGMCU_GetRevisionID= 2001
Successfully Start Fast Advertising
HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x801
** CONNECTION UPDATE EVENT WITH CLIENT
2022-05-30 09:20 AM
I disabled all my ADC DMA and no change. All the problems described above still occur. Again if I run CPU1 at 32MHz everything works perfectly.
2022-06-03 07:36 PM
From ST:
CPU1 can run only down to 32MHz when running BLE since network co=processor CPU2 must be always clocked at 32 MHz, this is stated in section 5 of AN5289 (https://www.compel.ru/wordpress/wp-content/uploads/2019/12/en.dm00598033.pdf).
CPU1 is capable of running down to 16MHz, however, only if BLE is not needed and therefore CPU2 is shut off.
2022-06-08 06:16 AM
Hello,
CPU1 can run to 16 MHz with BLE, only CPU2 must run to 32 MHz. I see in your screenshot that HCLK4 is set to 16 MHz but HCLK4 shall run to 32 MHz for SRAM2 access. Can you change HCLK4 HPRE in order to have 32 MHz for HCLK4 and retry your application ?
Best Regards
2022-06-08 08:40 PM
I tried HCLK1 16MHz and HCLK4 32MHz and it works great with BLE. Thank you for the information.