-
Notifications
You must be signed in to change notification settings - Fork 8.1k
STM32WB0x: Add PM support (suspend-to-ram) #94402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7e53340
to
be88807
Compare
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick skimming
1836ad9
to
6e06ff5
Compare
6e06ff5
to
52716ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM AFAICT.
HAL counterpart PR has just been merged, you can update the west manifest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to hichlight recent changes on suspend to ram managment:
PM: Refactor S2RAM kconfigs to rely on devicetree and soc: #96292
soc/st/stm32/stm32wb0x/Kconfig
Outdated
# to use SoC-specific hardware registers for resume detection. | ||
select PM_DEVICE if PM | ||
select PM_S2RAM if PM | ||
select HAS_PM_S2RAM_CUSTOM_MARKING if PM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this option can be selected even when PM is not selected, like HAS_PM
, not blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
soc/st/stm32/stm32wb0x/Kconfig
Outdated
# need to be reinitialized after resuming. CUSTOM_MARKING is enabled | ||
# to use SoC-specific hardware registers for resume detection. | ||
select PM_DEVICE if PM | ||
select PM_S2RAM if PM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This selection is redundant, PM_S2RAM
is enabled automatically based on devicetree. With this line, it is now not possible to enable PM without enabling PM_S2RAM. This may be intentional, so not blocking, but the design allows for enabling PM but disabling the suspend-to-ram
states in the devicetree like any other state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a situation where it makes sense to enable PM
without any low-power state?
On this SoC, the only low-power mode is suspend-to-ram
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only suspend-to-ram
is supported on this SoC; however, I updated to remove redundancy and comply with the design concept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a situation where it makes sense to enable
PM
without any low-power state? On this SoC, the only low-power mode issuspend-to-ram
.
I don't think so, that's what "This may be intentional, so not blocking" was referring to, should have been more precise.
Provide PM support, specifically suspend-to-ram, for STM32WB0x. Enable STM32_RADIO_TIMER Kconfig parameter when PM is set. Signed-off-by: Ali Hozhabri <[email protected]>
Enable UART wake-up line in STM32 driver. Signed-off-by: Ali Hozhabri <[email protected]>
Add PM support to the STM32WB0x Bluetooth HCI driver. Implement PM event register to wake up the device for its BLE events. Signed-off-by: Ali Hozhabri <[email protected]>
Optimize power consumption for the Nucleo-WB09KE board by implementing correct pull-up/pull-down configurations when the device enters lower power states. Disable the SMPS with floating output in suspend-to-ram (deepstop) power state. Signed-off-by: Ali Hozhabri <[email protected]>
Update west.yml to point to the recent changes for hal_stm32. Signed-off-by: Ali Hozhabri <[email protected]>
cb2ee70
49b4402
to
cb2ee70
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is @andyross really the right assignee for this?
I would expect it to be STM or PM maintainers, so probably no? I see no issue in reassigning this one if neccesary |
Provide PM support, specifically suspend-to-ram.
Add PM support to the Bluetooth HCI driver.
Optimize power consumption for the Nucleo-WB09KE board.
Provide radio timer driver for STM32WB0x SoCs to be used as the system timer when Bluetooth and/or PM are enabled.
Set the appropriate value for SYS_CLOCK_HW_CYCLES_PER_SEC and
SYS_CLOCK_TICKS_PER_SEC when radio timer is used as the system timer.
Enable UART wake-up line in STM32 driver.
Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for some
STM32WB0 drivers due to the misunderstanding of its definition.
Update west to point to the recent changes for hal_stm32.
Supplementary PR #303.
@mathieuchopstm, thank you for your support in PM.