Skip to content
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

STM32WB RNG: enable use from both M4 and M0+ cores #13219

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

jeromecoutant
Copy link
Collaborator

Summary of changes

When M0+ CPU with BLE and M4 CPU with MBED application are using both RNG feature,
there was some conflict in clock configuration.

Now, M4 CPU is set as the master.

Fix #13145

@ARMmbed/team-st-mcd
@eriknayan

Impact of changes

This enables RNG use in MBED application in parallel of BLE.

This could also improve USB use as USB is sharing the same clock as RNG in STM32WB

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@@ -58,6 +59,9 @@ void hal_deepsleep(void)
PWR_EnterStopMode();
PWR_ExitStopMode();

/* Force complete clock reconfiguration */
SetSysClock();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a generic way indeed to restart all the clocks. But it can take time and have impacts on power consumption. What is actually missing at this point, is it only HSI48 ?
if so, isn't it enough to call again :

while` (LL_HSEM_1StepLock(HSEM, CFG_HW_HSI48_SEMID));

of course that's an optimization only

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Idea was to ease maintenance.
If we change something in SetSysClock, it will be automatically taken into account at STOP mode exit.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it can take time and have impacts on power consumption.

what we are losing here ? Any numbers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But it can take time and have impacts on power consumption.
what we are losing here ? Any numbers?

No measure, but I don't think this takes more time than switching only HSI48 clock here.

@ciarmcom ciarmcom requested a review from a team July 2, 2020 09:00
@ciarmcom
Copy link
Member

ciarmcom commented Jul 2, 2020

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@mergify mergify bot added needs: CI and removed needs: review labels Jul 2, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added the release-type: patch Indentifies a PR as containing just a patch label Jul 3, 2020
@0xc0170 0xc0170 merged commit aeacaa8 into ARMmbed:master Jul 3, 2020
@mergify mergify bot removed the ready for merge label Jul 3, 2020
@jeromecoutant jeromecoutant deleted the PR_WB_RNG branch July 3, 2020 08:55
@eriknayan
Copy link

Thanks @jeromecoutant for this patch!

@adbridge adbridge added release-version: 6.2.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TRNG Error: Conflict between BLE and Wi-SUN
7 participants