Skip to content

Conversation

etienne-lms
Copy link
Contributor

Use Zephyr function stm32_backup_domain_enable_access() and stm32_backup_domain_disable_access() to enable/disable access to LSE configuration registers under back domain access protection instead of raw access. These functions have a reference counter for access requests to ensure access remains enabled when other component require it.

@etienne-lms
Copy link
Contributor Author

This change is related to zephyrproject-rtos/zephyr#92005.
I'm not 100% it well allows BLE stack to not compromise the Backup Domain access refcount handled in Zephyr.
@asm5878, I'd greatly appreciate your feedback.

@erwango erwango requested review from asm5878 and benothmn-st June 24, 2025 07:33
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAL libraries are not supposed to call Zephyr code.
Alternative it to move these porting functions within zephyr repo, where they're supposed to be implemented. See https://github.com/zephyrproject-rtos/zephyr/soc/st/stm32/stm32wbax/hci_if/linklayer_plat_adapt.c

@etienne-lms
Copy link
Contributor Author

Ok, thanks, I'll update this P-R and created the related one in Zephyr.

@etienne-lms
Copy link
Contributor Author

Updated.

Add LINKLAYER_PLAT_EnableBackupDomainAccess()  and
LINKLAYER_PLAT_DisableBackupDomainAccess() to use Zephyr resources
that use a reference counter for access requests, for enabling
and disabling access the BackupDomain resources.

Signed-off-by: Etienne Carriere <[email protected]>
@etienne-lms
Copy link
Contributor Author

Updated to lower impact on lib/stm32wba maintenance.

Copy link

@mathieuchopstm mathieuchopstm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd move the entire LINKLAYER_PLAT_ClockInit away, but that seems easier said than done...

So this is fine for me 🙂

Copy link
Collaborator

@asm5878 asm5878 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks perfect for me.
Also to highlight changes required for Zephyr use case.

@erwango
Copy link
Member

erwango commented Jun 24, 2025

@asm587, as mentionned by @mathieuchopstm ideally we should move whole function to zephyr repo.
I won't block for now give the delays but this should be targeted for next release.

@asm5878
Copy link
Collaborator

asm5878 commented Jun 24, 2025

@erwango Indeed I totally agree with you

@erwango erwango merged commit 55b5d9a into zephyrproject-rtos:main Jun 25, 2025
2 checks passed
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.

4 participants