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

Version change of the encypted ESP32 (bricked) (VSC-1539) #1366

Open
1 task done
1337ralfy69 opened this issue Dec 13, 2024 · 2 comments · May be fixed by #1373
Open
1 task done

Version change of the encypted ESP32 (bricked) (VSC-1539) #1366

1337ralfy69 opened this issue Dec 13, 2024 · 2 comments · May be fixed by #1373
Assignees
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)

Comments

@1337ralfy69
Copy link

1337ralfy69 commented Dec 13, 2024

OS

Windows

Operating System version

Windows 11

Visual Studio Code version

1.96

ESP-IDF version

5.3.0

Python version

3.11.1

Doctor command output

Executing task: c:\ESPIDF_VERSIONS\V_5_2\tools\python_env\idf5.3_py3.11_env\Scripts\python.exe C:\Users\Ralfs\esp\v5_2\esp-idf\components\esptool_py\esptool\esptool.py -p COM4 -b 460800 --before default_reset --after no_reset --chip esp32s3 write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB --encrypt-files 0x0 bootloader/bootloader.bin 0x20000 Demo.bin 0x10000 partition_table/partition-table.bin 0x16000 ota_data_initial.bin 0x0 bootloader/bootloader.bin 0x20000 Demo.bin 0x10000 partition_table/partition-table.bin 0x16000 ota_data_initial.bin 0x3b2000 storage.bin

usage: esptool write_flash [-h] [--erase-all] [--flash_freq {keep,80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}] [--flash_mode {keep,qio,qout,dio,dout}]
[--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}] [--spi-connection SPI_CONNECTION] [--no-progress] [--verify] [--encrypt]
[--encrypt-files

[ ...]] [--ignore-flash-encryption-efuse-setting] [--force] [--compress | --no-compress]
[ ...]
esptool write_flash: error: argument --encrypt-files: Detected overlap at address: 0x0 for file: bootloader/bootloader.bin

Extension

No response

Description

Last week all worked okay (version was 1.8.1). I had autoupdate enabled for esp-idf vs extesion so it updated to 1.9.0. This week when i tried to upload code, it gave me memory overlap error. Than i noticed version has changed, I went back one version (to 1.8.1 again), it didnt want to compile it, so i needed to delete build dir. Did that and everything compiled again, and uploaded ok. But the issue is when it uploaded it bricked the esp....
Invalid header 0xXXXXX..... So now i cant get back the compiled version that i had that was working on encrypted esp.
Why does recompilation of same project bricks encrypted esp? (no changes neither in code or in menuconfig, same framework (5.3.0))

Debug Message

None

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@1337ralfy69 1337ralfy69 added the bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) label Dec 13, 2024
@github-actions github-actions bot changed the title Version change of the encypted ESP32 (bricked) Version change of the encypted ESP32 (bricked) (VSC-1539) Dec 13, 2024
@radurentea radurentea self-assigned this Dec 17, 2024
@radurentea
Copy link
Collaborator

Hi @1337ralfy69,

Executing task: c:\ESPIDF_VERSIONS\V_5_2\tools\python_env\idf5.3_py3.11_env\Scripts\python.exe C:\Users\Ralfs\esp\v5_2\esp-idf\components\esptool_py\esptool\esptool.py -p COM4 -b 460800 --before default_reset --after no_reset --chip esp32s3 write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB --encrypt-files 0x0 bootloader/bootloader.bin 0x20000 Demo.bin 0x10000 partition_table/partition-table.bin 0x16000 ota_data_initial.bin 0x0 bootloader/bootloader.bin 0x20000 Demo.bin 0x10000 partition_table/partition-table.bin 0x16000 ota_data_initial.bin 0x3b2000 storage.bin

This command was run with 1.9.0 or 1.8.1? Also, can you tell me which command you've used for flash encryption / flash? (if you used the status bar flash icon or you've used a command from Command Palette?

Also, can you provide me the followings things so I can better troubleshoot this specific issue?

  1. Run doctor command and attach the output here in a .txt file
  2. Can you share the flasher_args.json from your project's build folder?
  3. Can you share the sdkconfig file of your project?

@radurentea radurentea linked a pull request Dec 18, 2024 that will close this issue
5 tasks
@radurentea
Copy link
Collaborator

Hi,

From what it looks, you've added an extra storage.bin that was probably set as unencrypted and there was a bug in the code which would add all the files again if some were encrypted and some were not. It will be easier to figure out what happen, if you could provide me with the details from above, to make sure I did not miss anything.

For the time being, I've made a fix for the issue you've encountered, here: #1373 (comment). Could you test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants