Skip to content

docs/library/esp: Document esp.flash_read. - #19599

Open
agatti wants to merge 1 commit into
micropython:masterfrom
agatti:esp32-flash-read-docs
Open

docs/library/esp: Document esp.flash_read.#19599
agatti wants to merge 1 commit into
micropython:masterfrom
agatti:esp32-flash-read-docs

Conversation

@agatti

@agatti agatti commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a documentation block for esp.flash_read, describing its usage and the discrepancies in its implementation between ESP8266 and ESP32.

This closes #6553.

Testing

Some manual edge case testing was performed on both ESP8266 and ESP32 boards, and the documentation was built using make html to make sure no incorrect markup was detected.

Generative AI

I did not use generative AI tools when creating this PR.

@agatti agatti added the docs label Aug 10, 2026
Comment thread docs/library/esp.rst Outdated

On ESP8266 the second argument indicates how many bytes to read from the
given starting point, with the requested number of bytes will be returned as
a ``bytes`` object containing the requested data. Requesting more data than

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the requested number of bytes will be returned as
a bytes object containing the requested data.

Suggest : returns a bytes object of the requested length containing the requested data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and FWIW this matches the signature(s) I use in the the MicroPython stubs. ( your description will be pulled as a docstring once merged)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks!

This commit adds a documentation block for `esp.flash_read`, describing
its usage and the discrepancies in its implementation between ESP8266 and
ESP32.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
@agatti
agatti force-pushed the esp32-flash-read-docs branch from 57d37dd to bd7b0c0 Compare August 10, 2026 21:38
Comment thread docs/library/esp.rst
This function is present in both ESP8266 and ESP32, albeit with different
meanings for the second argument.

On ESP8266 the second argument indicates how many bytes to read from the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell by reading the code, esp8266 also supports passing in a pre-allocated buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESP32 execute esp.read_flash() cause exception

3 participants