-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
suit: Rework SDFW and SDFW Recovery sinks #18514
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 80e258746b0234964fac28a2806cc6ec15966081 more detailssdk-nrf:
Github labels
List of changed files detected by CI (7)
Outputs:ToolchainVersion: b81a7cd864 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
0e1cfc7
to
4c8ea7e
Compare
4c8ea7e
to
5db4710
Compare
a454115
to
2a07859
Compare
if (NRF_SICR->UROT.UPDATE.OPERATION != SICR_UROT_UPDATE_OPERATION_OPCODE_Nop || | ||
NRF_SICR->UROT.UPDATE.STATUS != SICR_UROT_UPDATE_STATUS_CODE_None) { | ||
|
||
const nrf_mramc_mode_write_t new_write_mode = NRF_MRAMC_MODE_WRITE_DIRECT; |
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 it really necessary to change MRAM write mode here? Shouldn't direct mode be enabled during SDFW startup?
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.
During development I added some logs to show current write mode and as you say, it was already set as you describe.
However, this snippet is based on sdfw_update.c code, where such write mode is being done before changing the register values, so I assumed it is better to ensure it.
Additionally, the mode change is only done when desired mode is different than current one, so I guess it shouldn't be harmful.
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.
@SylwesterKonczyk If you know for sure that the write mode is always going to be appropriate, I can remove the code that checks and adjusts it. I preferred to be cautious here.
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.
Piece of code you are proposing works as intended. At the same time - improper handling of MRAM mode may lead to data incoherency, so it shall be managed in SDFW in a coherent way, and local 'hacks' should be, in my opinion, avoided.
Let me approve it to avoid further blocking of that PR, but please setup a separate thread to deal with MRAM mode in a proper way.
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.
I agree, if we can avoid additional checks and mode setting, we should remove this mechanism.
I've created a Jira task to follow it up: https://nordicsemi.atlassian.net/browse/NCSDK-30143.
New implementation of SDFW and SDFW Recovery sinks. Supports fixed installation order (SDFW, then SDFW Recovery). Treats SDFW Recovery installation as optional. Envelope is saved when SDFW slot is successfully installed. Ref: NCSDK-29561 Signed-off-by: Adam Szczygieł <adam.szczygiel@nordicsemi.no>
2a07859
to
80e2587
Compare
New implementation of SDFW and SDFW Recovery sinks. Supports fixed installation order (SDFW, then SDFW Recovery). Treats SDFW Recovery installation as optional.
Envelope is saved when SDFW slot is successfully installed.
Changes from https://github.com/nrfconnect/sdk-secdom/pull/939 are also needed to make this PR usable.
Note: Similar changes were already introduced in #17837 but were reverted during secdom release process. This PR additionally fixes an issue with reboot loop in scenario of both SDFW and SDFW Recovery update failures.
Ref: NCSDK-29561