From 5d9d5bebf583e1335ffca9aca181d1dcd7ba2acd Mon Sep 17 00:00:00 2001 From: Tiago Medicci Serrano Date: Tue, 28 May 2024 09:41:01 -0300 Subject: [PATCH 1/2] fix: Do not append SHA256 when `--ram-only-header` When called with `--ram-only-header`, the ROM segments are hidden. In this case, the end of the first two visible segments (in RAM) is not the end of the image and is not suitable for appending the SHA256 digest. --- esptool/__init__.py | 2 +- esptool/cmds.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/esptool/__init__.py b/esptool/__init__.py index 252f34ace6..bc4d102c73 100644 --- a/esptool/__init__.py +++ b/esptool/__init__.py @@ -496,7 +496,7 @@ def add_spi_flash_subparsers( "quantity. This will make the other segments invisible to the ROM " "loader. Use this argument with care because the ROM loader will load " "only the RAM segments although the other segments being present in " - "the output.", + "the output. Implies --dont-append-digest", action="store_true", default=None, ) diff --git a/esptool/cmds.py b/esptool/cmds.py index b7b483894c..4d9975ea41 100644 --- a/esptool/cmds.py +++ b/esptool/cmds.py @@ -1050,7 +1050,10 @@ def elf2image(args): image.min_rev_full = args.min_rev_full image.max_rev_full = args.max_rev_full image.ram_only_header = args.ram_only_header - image.append_digest = args.append_digest + if image.ram_only_header: + image.append_digest = False + else: + image.append_digest = args.append_digest elif args.version == "1": # ESP8266 image = ESP8266ROMFirmwareImage() elif args.version == "2": @@ -1075,7 +1078,10 @@ def elf2image(args): image.elf_sha256_offset = args.elf_sha256_offset if args.ram_only_header: - print("ROM segments hidden - only RAM segments are visible to the ROM loader!") + print( + "Image has only RAM segments visible. " + "ROM segments are hidden and SHA256 digest is not appended." + ) image.sort_segments() before = len(image.segments) From 74ce28698e9f72329c81b5344329682b09f73bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Karni=C5=A1?= Date: Wed, 29 May 2024 15:20:34 +0200 Subject: [PATCH 2/2] docs(troubleshooting): Mention the ESP Hardware Design Guidelines docs --- .github/ISSUE_TEMPLATE/issue-with-hw.yml | 2 +- docs/en/troubleshooting.rst | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/issue-with-hw.yml b/.github/ISSUE_TEMPLATE/issue-with-hw.yml index a2ae0bd709..5fdfcd485c 100644 --- a/.github/ISSUE_TEMPLATE/issue-with-hw.yml +++ b/.github/ISSUE_TEMPLATE/issue-with-hw.yml @@ -7,7 +7,7 @@ body: value: | * Most failures to connect, flash, etc. are problems with the hardware. * Please check any guide that came with your hardware, and also check [the esptool troubleshooting guide](https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html). - * If your board is a custom design, consider using our [free-of-charge schematic and PCB review service](https://www.espressif.com/en/contact-us/circuit-schematic-pcb-design-review). + * If your board is a custom design, check the [ESP Hardware Design Guidelines](https://docs.espressif.com/projects/esp-hardware-design-guidelines/) and consider using our [free-of-charge schematic and PCB review service](https://www.espressif.com/en/contact-us/circuit-schematic-pcb-design-review). * If still experiencing the issue, please provide as many details as possible below about your hardware and computer setup. - type: input id: os diff --git a/docs/en/troubleshooting.rst b/docs/en/troubleshooting.rst index 820bfa2978..7db2337bc6 100644 --- a/docs/en/troubleshooting.rst +++ b/docs/en/troubleshooting.rst @@ -5,7 +5,9 @@ Troubleshooting =============== -Flashing problems can be fiddly to troubleshoot. Try the suggestions here if you're having problems: +Flashing problems can be fiddly to troubleshoot. The underlying issue can be caused by the drivers, OS, hardware, or even a combination of these. If your board is a custom design, check the `ESP Hardware Design Guidelines `_ or consider using our `free-of-charge schematic and PCB review service `_. + +Try the following suggestions if your issues persist: Bootloader Won't Respond ------------------------