Repository navigation
fix(flash): split writes that cross a flash page - #87
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Page-spanning write handling src/flash_nrf5x.c, changelog.md |
flash_nrf5x_write copies data in page-sized portions and flushes and loads the cache when the write moves to another page. The changelog documents this behavior and the current UF2 write pattern. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: hathach
Merge Risk: 
Minimal · up to bae57
-
The change safely handles cross-page writes without introducing a confirmed merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit taps the page with care,
Then carries bytes across from there.
The cache is flushed, the next page read,
Each block arrives where writes must lead.
The changelog marks the pathway clear.
Comment @coderabbitai help to get the list of available commands.
Checklist
tools/build_all.py(or CI's board matrix) passesDescription of Change
flash_nrf5x_writecopied a write into its 4 KB page buffer without checking the page end, so a write crossing a page boundary ran past_fl_bufand its tail never reached flash. It now loops page by page, as Adafruit did inca46deb. Hardening only: the UF2 path is the only caller andis_uf2_block()accepts just 256 B blocks at 256 B-aligned addresses, which never cross a page.Tested on the RAK4631 (S140 6.1.1): misaligned blocks are dropped by
is_uf2_block()on master and on this branch alike, and aligned app plus 64 KB pattern writes read back with 0 mismatches 3 of 3 times, app booting. A host harness built from the realflash_nrf5x.cwriting 64 KB at a 128 B offset shows master losing the 128 B after each of 16 page boundaries (2040-2042 B wrong, overflow abort under fortify) and this branch 0 wrong on 3 seeds.Summary by CodeRabbit