2025-01-10 01:11 AM
Hi,
- MCU: STM32WBA52CGU6
- SDK: 1.1.1
- Configured SYSCLK: PLLCLK: 70 MHz
- Issue: System-Clock-Source auto-change to HSE, upon any BLE related API calls such as start BLE advertisement related API aci_gap_update_adv_data().
- Issue is repeatable.
- Issue is hardware independent as verified with different custom boards and two NUCLEO-STM32WBA52 boards.
- Observed that upon ble_init or BLE related API call, SFR RCC_CFGR1: Bits 3:2 SWS[1:0]: system clock switch status:
Before BLE call: 11: pll1rclk used as system clock
After BLE call: 10: HSE32 or HSE32/2, as defined by HSEPRE, used as system clock.
- For reference attached configuration snapshot:
- Note that upon reconfigure system clock source by API: SystemClock_Config();
Make PLLCLK as SYSCLK till the time BLE related API not call.
- Request to provide solution/workaround for same.
Thanks
2025-01-10 02:44 AM
Hello @rajdeep_01
Infact after starting the BLE on your application, the system clock manager (SCM) is the module that manages the CPU system clock source and frequency. So, in your case, it should be the SCM that always set the system clock source to HSE as you said. To set it to PLL as on your request, you need to call "scm_setsystemclock( SCM user that requests the change, SYS_PLL);" just after configuring the PLL mode and parameters through "scm_pll_setconfig(const scm_pll_config_t *p_pll_config);". More helpful details are available in the wiki:
STM32CubeWBA: System Clock Manager - stm32mcu.
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.