Time become incorrect when enable bluetooth of board nucleo_wba52cg. #71752
Replies: 8 comments 3 replies
-
Hi @2024markLuo! 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. 🤖💙 |
Beta Was this translation helpful? Give feedback.
-
@erwango any ideas? |
Beta Was this translation helpful? Give feedback.
-
Dear @2024markLuo, Here a snippet of while loop:
Right now I haven't in my hands any nucleo_wba52cg to do the same test. Thanks, |
Beta Was this translation helpful? Give feedback.
-
@2024markLuo Did you try to use clock configuration from nucleo_wba55 to nucleo_wba52? |
Beta Was this translation helpful? Give feedback.
-
Note that currently BLE support on nucleo_wba52 is not enabled in tree, so this is not technically a "bug". Moving to discussion. |
Beta Was this translation helpful? Give feedback.
-
I just stumbled over this issue with the
The relevant clock tree changes from my /*
* reconfigure clock tree
*
* NOTE: 10, 16, 20, 32, 40, 64, 80 or 100
*/
#define __SYSCLK_MHZ 100
&clk_hse { // HSE == 32 MHz oscillator
/delete-property/ hse-div2;
};
&pll {
status = "okay";
clocks = <&clk_hse>;
// VCO configuration
#if (__SYSCLK_MHZ == 100)
div-m = < 8>;
mul-n = <50>;
// -> fVCO = HSE * N / M = 32*50/8 = 200 MHz
#elif (__SYSCLK_MHZ == 16) || (__SYSCLK_MHZ == 32) || (__SYSCLK_MHZ == 64)
div-m = < 2>;
mul-n = < 8>;
// -> fVCO = HSE * N / M = 32* 8/2 = 128 MHz
#else // 10, 20, 40 or 80 MHz
div-m = < 2>;
mul-n = <10>;
// -> fVCO = HSE * N / M = 32*10/2 = 160 MHz
#endif
// PLLCLK = fVCO / R
#if (__SYSCLK_MHZ == 10)
div-q = <16>;
div-r = <16>;
#elif (__SYSCLK_MHZ == 16) || (__SYSCLK_MHZ == 20)
div-q = < 8>;
div-r = < 8>;
#elif (__SYSCLK_MHZ == 32) || (__SYSCLK_MHZ == 40)
div-q = < 4>;
div-r = < 4>;
#else // 64, 80 or 100 MHz
div-q = < 2>;
div-r = < 2>;
#endif
};
&rcc {
clocks = <&pll>;
ahb-prescaler = <1>;
// output -> SYSCLK
clock-frequency = <DT_FREQ_M(__SYSCLK_MHZ)>;
#if (__SYSCLK_MHZ / 1) <= 32
ahb5-prescaler = <1>;
#elif (__SYSCLK_MHZ / 2) <= 32
ahb5-prescaler = <2>;
#else
ahb5-prescaler = <4>;
#endif
apb1-prescaler = <1>;
apb2-prescaler = <1>;
apb7-prescaler = <1>;
}; I compiled my test applications against the Zephyr manifest branches |
Beta Was this translation helpful? Give feedback.
-
I think I'm finally zeroing in on the root cause: [00:00:00.000,000] <inf> bt: BEFORE BT: running on board nucleo_wba55cg with CPU frequency: 100 MHz
[00:00:00.006,000] <inf> bt_hci_core: HCI transport: BT IPM
[00:00:00.007,000] <inf> bt_hci_core: Identity: 00:80:E1:XX:XX:XX (public)
[00:00:00.007,000] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x8014, manufacturer 0x0030
[00:00:00.007,000] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x6014
[00:00:00.007,000] <inf> bt: AFTER BT: running on board nucleo_wba55cg with CPU frequency: 16 MHz I see two options:
|
Beta Was this translation helpful? Give feedback.
-
FYI: created new issue #91409 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I use board nucleo_wba52cg, When I call bt_enable(), then all k_msleep() become not correct.
for example: k_msleep(2000), it was supposed to delay for 2 seconds, but in fact it delayed for 12 seconds.
Describe the solution you'd like
After enabling bluetooth on board nucleo_wba52cg, k_msleep can be accurate and systick can also be accurate.
Describe alternatives you've considered
Additional context
Beta Was this translation helpful? Give feedback.
All reactions