Skip to content

DRAFT: stm32wb55 - sync cpu2 with hsem when entering sleep #4116

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ckrenslehner
Copy link
Contributor

I did not find where to mark this as draft, but here is a basic implementation of using the HSEM for syncing the with the CPU2 when entering sleep.
The stm32wb55 requires this when accessing some peripherals

Among these are:

  • RNG
  • Crypto
  • Stop Mode
  • Flash

The concrete flow charts for entering and exiting STOP mode are in this document
Page 23f.

I have some general questions:

  • How should I handle the HSEM creation
  • Now its created via the init and then passed to the executor again similar to the RTC
  • The HSEM is needed in other places too. But with other underlying HSEM IDs. Should I split the HSEM into separate ID-Structs or how could I model such usecase in rust/embassy the best way?

I would greatly appreciate feedback on how to model this "correctly" :-)

@ckrenslehner
Copy link
Contributor Author

Okay I also realized that keeping the HSEM initialized all the time needs to be avoided. Otherwise, entering the stop mode is not possible because, of the RCC init from the HSEM Module.

So to enter sleep the low power executor needs to init the HSEM peripheral on the inside to sync with CPU 2.

@ckrenslehner ckrenslehner mentioned this pull request Apr 24, 2025
14 tasks
@ckrenslehner ckrenslehner force-pushed the fix/handle-cpu2-when-entering-sleep branch from 69c9173 to 3e4b016 Compare April 25, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant