2024-11-14 06:10 AM
Hi,
I am programming the nucleo_wba55cg using Zephyr v3.7.0.
My application is based on a BLE peripheral example, whereby I have also configured an LED on the nucleo_wba55cg board to toggles at the rate of 1s.
Also, I modified the rcc section the nucleo_wba55cg.dts file to adapt to the higher system clock (96 MHz, similar to that of the nucleo_wba52cg) shown below:
&pll1 {
div-m = <8>;
mul-n = <48>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll1>;
clock-frequency = <DT_FREQ_M(96)>;
ahb-prescaler = <1>;
ahb5-prescaler = <4>;
apb1-prescaler = <1>;
apb2-prescaler = <1>;
apb7-prescaler = <1>;
};
main.c
scm_setsystemclock(SCM_USER_APP, HSE_32MHZ);
Could you please let me know how to correct this behavior and achieve the correct blinking pattern of the LED (1 seconds). In case this involves PLL settings, how to do it?
Solved! Go to Solution.
2024-11-14 08:19 AM
Hello @BKaiwalya
Could you please update the function:
scm_setsystemclock(SCM_USER_APP, HSE_32MHZ);
to:
scm_setsystemclock(SCM_USER_APP, SYS_PLL);
After setting the PLL mode and parameters through (mendatory before calling the scm_setsystemclock) :
void scm_pll_setconfig(const scm_pll_config_t *p_pll_config);
With PLLM = 8, PLLN = 48 PLLR = 2 and PLLFractional = 0.
More details about those functions are available on the scm.c and scm.h files.
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.
2024-11-14 06:16 AM
Hello,
A simulation done on CubeMx:
2024-11-14 08:19 AM
Hello @BKaiwalya
Could you please update the function:
scm_setsystemclock(SCM_USER_APP, HSE_32MHZ);
to:
scm_setsystemclock(SCM_USER_APP, SYS_PLL);
After setting the PLL mode and parameters through (mendatory before calling the scm_setsystemclock) :
void scm_pll_setconfig(const scm_pll_config_t *p_pll_config);
With PLLM = 8, PLLN = 48 PLLR = 2 and PLLFractional = 0.
More details about those functions are available on the scm.c and scm.h files.
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.