Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

espflash read-flash should also work with --no-stub #757

Open
SergioGasquez opened this issue Feb 10, 2025 · 1 comment
Open

espflash read-flash should also work with --no-stub #757

SergioGasquez opened this issue Feb 10, 2025 · 1 comment
Labels
CLI Issues relating to the command-line interface feature request Request for new feature/functionality

Comments

@SergioGasquez
Copy link
Member

SergioGasquez commented Feb 10, 2025

Here's the result:


espflash read-flash --no-stub 0x9000 0x6000 ./nvs_dump_devkit   

[2024-10-25T10:45:55Z INFO ] 🚀 A new version of espflash is available: v3.2.0

Error: espflash::stub_required



  × This command requires using the RAM stub

  help: Don't use the `--no-stub` option with the command

Originally posted by @DaneSlattery in #697

esptool allows using read_flash subcommand even without stub: https://github.com/espressif/esptool/blob/6d04155e886ae65bdcb28a7993b43f2476f6ce16/esptool/loader.py#L1274-L1275

❯ esptools tool --chip esp32c6 --no-stub read_flash 0 0x20000 flash_content.bin
Tool esptool mounted as `/home/sergio/.cache/esptools/78c195b08bd57bf27167b323600d417a546d3393/esptool`
Executing `esptool`
esptool.py v4.8.1
Found 33 serial ports
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 60:55:f9:00:00:f7:1b:6c
BASE MAC: 60:55:f9:f7:1b:6c
MAC_EXT: 00:00
Enabling default SPI flash mode...
Configuring flash size...
WARNING: In case of failure, please set a specific --flash_size.
131072 (100 %)
Read 131072 bytes at 0x00000000 in 22.0 seconds (47.7 kbit/s)...
Hard resetting via RTS pin...
Status Ok(ExitStatus(unix_wait_status(0)))

See https://github.com/espressif/esptool/blob/master/esptool/targets/esp32.py#L393-L418

@SergioGasquez SergioGasquez added CLI Issues relating to the command-line interface feature request Request for new feature/functionality labels Feb 10, 2025
@SergioGasquez
Copy link
Member Author

According to the docs:

When using the read_flash command in combination with the --no-stub argument, it may be necessary to also set the --flash_size argument to ensure proper reading of the flash contents by the ROM.

https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/basic-commands.html#read-flash-contents-read-flash

But then, it's listed under "Stub loader only": https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/serial-protocol.html#supported-by-stub-loader-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Issues relating to the command-line interface feature request Request for new feature/functionality
Projects
Status: Todo
Development

No branches or pull requests

1 participant