Repository navigation
Emulated nRF52 boards keep what they store - #786
Merged
Merged
Conversation
FICR left CODEPAGESIZE and CODESIZE at zero, so the SoftDevice saw no flash and answered every sd_flash_page_erase and sd_flash_write with NRF_ERROR_FORBIDDEN (found with node.debug's GDB stub: r0 = 0xF after svc 0x28). LittleFS never formatted. Renode also rebuilt flash at every start. NVMC now writes the InternalFS region to the node's directory whenever flash goes back to read-only, and the next start of the same build loads it. Closes #565.
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #565.
There were two faults.
1. The SoftDevice refused every flash operation. I found it with the GDB stub from #191, breaking after the
svc 0x28stub (sd_flash_page_erase) on a RAK_4631:FICR never wrote CODEPAGESIZE (0x010) or CODESIZE (0x014). With both at zero, the SoftDevice sees no flash and forbids every page. So LittleFS never formatted, and
IdentityStore::save()failed. Both registers are now set (4 kB pages, 256 of them). After the fix, the same breakpoint shows r0=0 for pages 0xED, 0xEE, 0xEF and onward.2. Renode rebuilt flash from the image at every start, so even working storage would not have survived a restart. NVMC now writes the InternalFS region (0xED000, 28 kB) to the node's directory whenever CONFIG returns to read-only. The next start of the same build loads it back. The file is keyed by the image's hash, so a different build starts empty, as reflashing a board does.
Live check on RAK_4631 v1.17.1:
set af 7, thennode.stopandnode.start, thenget afreturns7.0(the default is 1.0).As the issue's comment warns, identity is no evidence here because it is seed-derived. The preference is the evidence.