-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Not able to flash ESP-01m chip (ESPTOOL-580) #816
Comments
I was able to finally flash the Micropython image, but I had to get into the code and adjust the timeouts. Edit DEFAULT_TIMEOUT = 10 #3 # timeout for most flash operations
START_FLASH_TIMEOUT = 40 #20 # timeout for starting flash (may perform erase)
CHIP_ERASE_TIMEOUT = 240 #120 # timeout for full chip erase
MAX_TIMEOUT = CHIP_ERASE_TIMEOUT * 4 #2 # longest any command can run
SYNC_TIMEOUT = 1 # 0.1 # timeout for syncing with bootloader
MD5_TIMEOUT_PER_MB = 16 #8 # timeout (per megabyte) for calculating md5sum
ERASE_REGION_TIMEOUT_PER_MB = 60 # 30 # timeout (per megabyte) for erasing a region
ERASE_WRITE_TIMEOUT_PER_MB = 80 # 40 # timeout (per megabyte) for erasing and writing data
MEM_END_ROM_TIMEOUT = 2 #0.05 # short timeout for ESP_MEM_END, as it may never respond
DEFAULT_SERIAL_WRITE_TIMEOUT = 20 #10 # timeout for serial port write
DEFAULT_CONNECT_ATTEMPTS = 14 #7 # default number of times to try connection
WRITE_BLOCK_ATTEMPTS = 6 #3 # number of times to try writing a data block So it seems that some of the timeouts were too conservative for my case. I wonder if there is a way to get the upload done without messing with the code in such a fashion. |
Hi @besi. We plan to support user configuration files in the near future where similar hacks would be easier. Is this a new chip or have you re-flashed it a lot? (I'm just asking out of curiosity because we've not got similar reports for 8285) |
@dobairoland Thanks for your comment. It was in fact the first flash of that device and also my first time flashing such a device. |
By any chance, can you provide us the used image or give instructions how to build one? |
Of course I did use the ESP8266 2MB Image: https://micropython.org/resources/firmware/esp8266-20220618-v1.19.1.bin |
Thanks. We will try to reproduce. |
Hi @besi, Can you please tell us more about the serial adapter you are using? This information is missing, but I think it's critical for us to understand where this issue is coming from. Also - have you by any chance tried the same setup with a different host machine (maybe a PC)? |
I‘m using a TTL 3.3V FTDI adapter. I‘m only connecting Tx, Rx, GND and 3.3V powering the circuit from the FTDI Adapter. The 5V label is actually wrong and should say 3.3V
Since I‘m using a recent macOS I had to add dedicated serial driver from one of the chinese chip vendors because the hardware stopped working due to Apple‘s Kernel Extension restrictions (I think). FTDI_TTL_232 Latest apple 11.x and 12.x |
Thanks for sharing more. There are two things to consider:
|
Thanks for your comments I might try to revert my changes made to the codebase and re-try while powering the ESP from another source. Also if you can recommend a product that‘s superior to the FTDI-thing feel free to add that. Please note that I did only conect TX and RX in terms of IO . |
@Jason2866 Thanks for pointing that out. I ordered two right away. |
I am using this board: Same issue with MEM_END_ROM_TIMEOUT = 0.05 # short timeout for ESP_MEM_END, as it may never respond When I have changed to MEM_END_ROM_TIMEOUT = 2.5 it worked ... BUT only after closing VS (PlatformIO) and reopening the Visual Code environment (some frustrating retries before ...!)! For beginners as me it would be worth to mention the "Must of Restarting the IDE" ...! Nevertheless - great Thanks! |
Even with this settings some transfers still get stuck in the middle in my wt32-sc01 plus (with esp32s3). Strange that the esp webtools manage to program it normally :/ |
I used to think webtools was better, but to be honest it was just quicker to retry that than firing off another platformIO upload attempt. In the end I modified my timeouts and have not had a problem since. My chip erases (esp32s3) take just over 30seconds for 16mb of flash so I didn't change from the 120s default.
|
Hi @tyeth, could you please try to pinpoint which of these timeouts does the trick for you? By the way, we have implemented a way to configure these variables in esptool without having to dig into the code. You can now create a simple configuration file to override these default values. See https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/configuration-file.html for more information. |
Ah brilliant, config available already! Not sure I can go through and narrow down such timings, other things to be getting on with I'm afraid, unless there's a paid job there ;) - I will have another go when it bites me again in the future. I'd be curious to know if the memory timings of 2.5 rather than 2.0 made a difference for @eried One thing is I am running USBpcap, like wireshark, which I know is never recommended, not actively capturing but installed (v1.5.4.0). That's bound to cause micro-delays. I also only occasionally saw a problem with firmwares under 1-2mb as they transfer so fast. |
Im using the new arduino ide now, upload never fails, never hangs on any %, just normal fast steady upload. I was going to investigate the differences between them to try to post a solution, but for now, I dont have time. |
Operating System
macOS 11.7 (20G817)
Esptool Version
4.4
Python Version
Python 3.10.7
Chip Description
Chip is ESP8285H16
Device Description
ESP-01m from AI Thinker
https://docs.ai-thinker.com/_media/esp8266/docs/esp-01m_product_specification_en.pdf
Hardware Configuration
Nothing functional attached.
How is Esptool Run
Terminal
Full Esptool Command Line that Was Run
esptool.py --port $PORT --baud 460800 write_flash --flash_size=detect 0 $IMAGE --flash_mode=dout
Esptool Output
More Information
The program seems stuck always at the same percentage (eg. 11% or 5% using the
-z
option)Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: