zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.48k stars 6.41k forks source link

dts: arm: st: u5: incorrect lptim2 clock enable bit #63663

Closed bwitherspoon closed 11 months ago

bwitherspoon commented 11 months ago

Describe the bug

For the STM32U5 The LPTIM2 clock enable should be bit 5 of RCC APB1 clock enable register 2 (RM0456 Rev 4 11.8.34).

See #63655 for fix.

To Reproduce

Enable LPTIM2 using the address currently in the device tree and run an application with PM enabled.

Example overlay:

&lptim2 {
       clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000200>,
                <&rcc STM32_SRC_LSE LPTIM2_SEL(3)>;
       status = "okay";
};

Example config:

CONFIG_SYS_CLOCK_TICKS_PER_SEC=4096
west build -p -b nucleo_u575zi_q zephyr/samples/boards/stm32/power_mgmt/blinky

The application will hang at boot waiting for the clock to be enabled.

Expected behavior

Use the correct register bit and the application runs as expected.

&lptim2 {
       clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000020>,
                <&rcc STM32_SRC_LSE LPTIM2_SEL(3)>;
       status = "okay";
};

Impact

LPTIM2 cannot be used. Trivial fix.

Environment (please complete the following information):

Notes:

There might also be an issue with the use of the st,static-prescaler property on LPTIM2. I will submit another issue or discussion for this.

github-actions[bot] commented 11 months ago

Hi @bwitherspoon! 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. šŸ¤–šŸ’™