-
Notifications
You must be signed in to change notification settings - Fork 3k
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
BLE - Nordic: Release crypto cell when not in use. #9372
Conversation
Previously, the CryptoToolbox was allocated once as part of the security manager. This was inneficient memory wise as it is only use to prepare key at initialization and when we need to compute shared keys. This was also inneficient power consumption wise as the Crypto cell was kept enabled even when it wasn't used. This fix creates a CryptoToolbox whenever it is needed and release it once it has fulfilled its purpose. Note that CryptoToolbox allocation happens on the heap as mbed tls data structure are huge and there's an high risk of crushing the stack.
@pan-, thank you for your changes. |
@pan- Is |
@RonEld The issue remaining is a power consumption one (just like the one I link). I call |
@pan- Thanks for the confirmation
This makes me wonder whether they have made modifications to the code |
In addition, perhaps if we upgrade to SDK 15, the power consumption issue will be fixed, in case the actual cause is in the SDK itself |
@RonEld I can try that tomorrow, we have a PR open that updates the SDK to v15. |
@ARMmbed/mbed-os-pan What is the status for this PR? |
Nothing changed, the PR is still good to go. However I do not have any update to provide on the issue exposed by |
@pan- what issue exposed by `Sasi_LibFini``? As you can see in #9372 (comment) , I believe that using SDK 15 fixes the power consumption issue. |
@RonEld As stated above:
I haven't tried with SDK15 and @TacoGrandeTX experiments are just an indication that the issue might have been fixed. It is not a proof (I really hope it is fixed!). |
@pan- Thanks for the confirmation. |
@ARMmbed/mbed-os-pan Please review to finalize the reviews |
CI started |
Test run: FAILEDSummary: 3 of 8 test jobs failed Failed test jobs:
|
Restarted CI |
@alekla01 Why was this build aborted? |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Description
Previously, the CryptoToolbox was allocated once as part of the security manager.
This was inneficient memory wise as it is only use to prepare key at initialization
and when we need to compute shared keys.
This was also inneficient power consumption wise as the Crypto cell was kept enabled even
when it wasn't used.
This fix creates a CryptoToolbox whenever it is needed and release it once it has fulfilled its
purpose. Note that CryptoToolbox allocation happens on the heap as mbed tls data structure are huge
and there's an high risk of crushing the stack.
Fixes: #9276
Pull request type
Reviewers