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

[Secure ROM DL Mode] read_flash command fails (ESPTOOL-567) #810

Closed
1 task done
chipweinberger opened this issue Dec 10, 2022 · 3 comments
Closed
1 task done

[Secure ROM DL Mode] read_flash command fails (ESPTOOL-567) #810

chipweinberger opened this issue Dec 10, 2022 · 3 comments

Comments

@chipweinberger
Copy link

chipweinberger commented Dec 10, 2022

Operating System

macOS 12.5.1

Esptool Version

esptool.py v3.3.2
esp-idf v4.4.3-215-g9f3f82f54b

Python Version

3.9.9

Chip Description

ESP32-S3

Device Description

ESP32-S3 Dev Kit C

How is Esptool Run

Mac OS Terminal

Full Esptool Command Line that Was Run

/Volumes/User/MBP-Google-Drive/jamcorder/firmware/.espressif/python_env/idf4.4_py3.9_env/bin/python /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py -p /dev/cu.SLAB_USBtoUART -b 460800 --before default_reset --after no_reset --chip esp32s3 --no-stub read_flash 0x0 100 /Users/charlesweinberger/Desktop/testdata.bin

Esptool Output

esptool.py v3.3.2
Serial port /dev/cu.SLAB_USBtoUART
Connecting....
Chip is ESP32-S3 in Secure Download Mode
Changing baud rate to 460800
Changed.
Enabling default SPI flash mode...
Traceback (most recent call last):
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 5482, in <module>
    _main()
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 5475, in _main
    main()
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 4907, in main
    operation_func(esp, args)
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 4359, in read_flash
    data = esp.read_flash(args.address, args.size, flash_progress)
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 1058, in read_flash
    return self.read_flash_slow(offset, length, progress_fn)  # ROM-only routine
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 1805, in read_flash_slow
    r = self.check_command("read flash block", self.ESP_READ_FLASH_SLOW,
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 520, in check_command
    val, data = self.command(op, data, chk, timeout=timeout)
  File "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esptool_py/esptool/esptool.py", line 505, in command
    raise UnsupportedCommandError(self, op)
__main__.UnsupportedCommandError: This command (0xe) is not supported in Secure Download Mode
charlesweinberger@Chips-Macbook-Pro-2 jamcorder_app % git describe
fatal: No names found, cannot describe anything.

More Information

Accoording to the docs read_flash should work:

https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/security/flash-encryption.html#best-practices

Secure Download Mode permanently limits the available commands to basic flash read and write only.

I Have Read the Troubleshooting Guide

  • I confirm I have read the troubleshooting guide.
@github-actions github-actions bot changed the title [Secure ROM DL Mode] read_flash command fails [Secure ROM DL Mode] read_flash command fails (ESPTOOL-567) Dec 10, 2022
@radimkarnis
Copy link
Collaborator

Hello @chipweinberger,
thank you for reporting this!

Reading flash is not supported in secure download mode.
I am sorry, but our documentation is wrong. It is being updated at the moment.

I hope this false information didn't cause any material damage (bricked chip) on your side.

@radimkarnis
Copy link
Collaborator

The fixes have been merged, the docs should update automatically today. Thanks again for the report!

@chipweinberger
Copy link
Author

Glad I could help!

espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Dec 22, 2022
…rted

Simple flash read command is not supported if Secure DL mode is enabled on the target.
Remove reference of this from the relevant docs part.

Related: espressif/esptool#810
Related: ESPTOOL-567
Closes IDF-6468
espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Dec 22, 2022
…rted

Simple flash read command is not supported if Secure DL mode is enabled on the target.
Remove reference of this from the relevant docs part.

Related: espressif/esptool#810
Related: ESPTOOL-567
Closes IDF-6468
espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Dec 25, 2022
…rted

Simple flash read command is not supported if Secure DL mode is enabled on the target.
Remove reference of this from the relevant docs part.

Related: espressif/esptool#810
Related: ESPTOOL-567
Closes IDF-6468
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

No branches or pull requests

2 participants