Skip to content

Conversation

AlexJones0
Copy link

See the commit messages. This PR fixes a couple of bugs in the flash controller related to reading keymgr secrets and improves the trace to help catch similar bugs in the future. This bug was causing garbage seeds to be read from flash, which was the reason we previously weren't getting the keymgr errors for unprovisioned flash as suggested by #220.

This wasn't causing any major problems (accidentally reading too many
words from flash when reading keymgr seeds, but the right number of
bytes were copied out when sending to the keymgr), but should be fixed
regardless.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
It turns out I completely misunderstood how `ot_fifo32_pop_buf` worked
and had mistakenly conflated it with the current `fifo8_pop_buf`
function which has a different signature. Correctly read out the flash
secret by repeatedly popping the correct number of words out of the FIFO
instead.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
I would have likely caught the previous bugs if I had properly traced
the seed like the TODO suggests. Add the ability to dump the entire seed
in the trace to make it easier to catch issues involving flash secrets
in the future.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
@AlexJones0 AlexJones0 merged commit 91b1f39 into lowRISC:ot-9.2.0 Oct 9, 2025
9 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.

3 participants