Skip to content

fix(nrf54l15): give the LittleFS File shim the readBytes() Stream API - #11638

Draft
cvaldess wants to merge 1 commit into
meshtastic:developfrom
cvaldess:fix/nrf54l15-file-readbytes
Draft

fix(nrf54l15): give the LittleFS File shim the readBytes() Stream API#11638
cvaldess wants to merge 1 commit into
meshtastic:developfrom
cvaldess:fix/nrf54l15-file-readbytes

Conversation

@cvaldess

Copy link
Copy Markdown
Contributor

nrf54l15dk does not build on current develop.

#10920 added WaypointStore::loadFromFlash(), which reads the store header and each record through File::readBytes() (src/WaypointStore.cpp, lines 313-314 and 326). On nRF54L15, File is the Zephyr/LittleFS-backed shim in src/platform/nrf54l15/InternalFileSystem.h — a plain class rather than an Arduino Stream subclass — and it never implemented that method, so the build stops with:

src/WaypointStore.cpp:313:19: error: 'class Adafruit_LittleFS_Namespace::File' has no member named 'readBytes'
src/WaypointStore.cpp:314:19: error: 'class Adafruit_LittleFS_Namespace::File' has no member named 'readBytes'
src/WaypointStore.cpp:326:31: error: 'class Adafruit_LittleFS_Namespace::File' has no member named 'readBytes'

This adds readBytes() on top of the shim's existing read(), looping until fs_read() stops making progress. A short read is legal there, and the caller already treats a count below the requested size as end-of-file, so returning the number of bytes actually delivered matches what the Arduino Stream version does.

Verified: pio run -e nrf54l15dk goes from FAILED to SUCCESS (RAM 46.8%, flash 36.8%). The change is confined to the nRF54L15 platform shim, so no other target is affected.

WaypointStore::loadFromFlash() (added in meshtastic#10920) reads its header and
records through File::readBytes(), which the Zephyr-backed shim never
implemented, so nrf54l15dk stopped compiling.

Add it on top of the existing read(), looping until fs_read() stops
making progress: a short read is legal and the callers treat a
byte count below the requested size as end-of-file.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

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.

1 participant