Failed to execute script 'esptool' due to unhandled exception!

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
albyva
 
Posts: 14
Joined: Tue Jan 26, 2021 11:10 pm

Failed to execute script 'esptool' due to unhandled exception!

Post by albyva »

I want to report for the record that I recently received a Feather ESP32, followed the docs to configure my Arduino IDE for it using the GIT Clone ( git clone https://github.com/espressif/arduino-esp32.git esp32 ) and everything seemingly configured correctly. I hooked up the ESP32, could see it scanning for Wifi signals. I then snagged the Blink Code and went to upload it. During that upload process it failed with the following error (See Below):

[code]Sketch uses 276797 bytes (8%) of program storage space. Maximum is 3342336 bytes.
Global variables use 22168 bytes (6%) of dynamic memory, leaving 305512 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port /dev/cu.usbserial-54B00072781
Connecting......Traceback (most recent call last):
File "esptool.py", line 34, in <module>
File "esptool/__init__.py", line 1004, in _main
File "esptool/__init__.py", line 790, in main
File "esptool/loader.py", line 1108, in flash_set_parameters
File "esptool/loader.py", line 406, in check_command
File "esptool/loader.py", line 375, in command
File "esptool/loader.py", line 307, in read
StopIteration
[23288] Failed to execute script 'esptool' due to unhandled exception!

Chip is ESP32-PICO-V3-02 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, Embedded PSRAM, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e8:9f:6d:20:7d:20
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Failed uploading: uploading error: exit status 1[/code]

I Googled the error. Tried many different things. Couldn't figure out what was happening. Then I noticed that under Tools>Upload Speed> the setting was 921600. I changed it to 115200 tried to update the blink code again and IT WORKED!!!!! w00t w00t.

So if anybody stubbles across a similar issue, double check your upload speed in the IDE. That might be the issue.


[code]Sketch uses 276797 bytes (8%) of program storage space. Maximum is 3342336 bytes.
Global variables use 22168 bytes (6%) of dynamic memory, leaving 305512 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port /dev/cu.usbserial-54B00072781
Connecting....
Chip is ESP32-PICO-V3-02 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, Embedded PSRAM, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e8:9f:6d:20:7d:20
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00053fff...
Compressed 17440 bytes to 12109...
Writing at 0x00001000... (100 %)
Wrote 17440 bytes (12109 compressed) at 0x00001000 in 1.5 seconds (effective 90.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 398.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 437.7 kbit/s)...
Hash of data verified.
Compressed 277184 bytes to 151115...
Writing at 0x00010000... (10 %)
Writing at 0x0001cf4a... (20 %)
Writing at 0x0002501c... (30 %)
Writing at 0x0002a286... (40 %)
Writing at 0x0002f68c... (50 %)
Writing at 0x00034ff2... (60 %)
Writing at 0x0003ec8f... (70 %)
Writing at 0x00047672... (80 %)
Writing at 0x0004ce37... (90 %)
Writing at 0x00052609... (100 %)
Wrote 277184 bytes (151115 compressed) at 0x00010000 in 14.7 seconds (effective 151.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...


[/code]

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Failed to execute script 'esptool' due to unhandled exception!

Post by mikeysklar »

This is helpful, thank you for sharing your solution.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”