I couldnt upload code. it stucks at %6 and give timeout error.

demirdemirel
Posts: 2
Joined: Mon Apr 26, 2021 1:19 am

I couldnt upload code. it stucks at %6 and give timeout error.

Postby demirdemirel » Mon Apr 26, 2021 1:46 am

hi,

I have a circuit that use bare esp32 wroom32e module.
I used to program with and USB-UART converter but it is not working now.
I tried many things in this forum but couldn't find a way to upload it.
Could anyone help ?

this is what I got from terminal:

Code: Select all

esptool.py --port /dev/cu.SLAB_USBtoUART write_flash --flash_mode dio --flash_size 8MB 0x1000 ESP32-WROOM-32_AT_Bin_V2.0/ESP32-WROOM-32_AT_Bin_V2.0/bootloader/bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin --erase-all
esptool.py v2.8
Serial port /dev/cu.SLAB_USBtoUART
Connecting......
Detecting chip type... ESP32
Chip is ESP32D0WDQ5 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 7c:9e:bd:e1:f9:38
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Erasing flash (this may take a while)...
Chip erase completed successfully in 1.2s
Flash params set to 0x0230
Compressed 24352 bytes to 14561...
Wrote 24352 bytes (14561 compressed) at 0x00001000 in 1.3 seconds (effective 151.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1520.0 kbit/s)...

A fatal error occurred: Timed out waiting for packet header
when I use vscode to upload it it gives following error.

Code: Select all

esptool.py v3.0
Serial port /dev/cu.SLAB_USBtoUART
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 7c:9e:bd:e1:f9:38
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 8MB
Flash params set to 0x0230
Compressed 17104 bytes to 11191...
Writing at 0x00001000... (100 %)
Wrote 17104 bytes (11191 compressed) at 0x00001000 in 0.3 seconds (effective 521.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1712.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 5464.0 kbit/s)...
Hash of data verified.
Compressed 919424 bytes to 530162...
Writing at 0x00010000... (3 %)
Writing at 0x00014000... (6 %)

A fatal error occurred: Timed out waiting for packet header
On the other hand I use ESP32 Flash Tool for windows to flash it but it gives 8-download data fail error.

I would be very grateful if someone helps me.

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: I couldnt upload code. it stucks at %6 and give timeout error.

Postby Vader_Mester » Mon Apr 26, 2021 10:09 am

Hi,

It doesn't fail at the same stage, so my guess is that either there is interference on the UART signal lines, or you have power supply issues and either your converter or the ESP module itself resets.
This can happen when the supply voltage is not high enough, or you have poor supply filtering on the 3.3V line.
This can also cause stability problems on the EN (CHIP_PU) line, which is supposed to reset your ESP.
Check this tutorial on how to try to solve it:
https://randomnerdtutorials.com/solved- ... et-header/

Also you can try to use a thicker-better cable for powering it. Are you powering the module from the converter during flashing?

Good Luck
Vader-Ben

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

demirdemirel
Posts: 2
Joined: Mon Apr 26, 2021 1:19 am

Re: I couldnt upload code. it stucks at %6 and give timeout error.

Postby demirdemirel » Tue Apr 27, 2021 5:53 pm

Hi,

Thank you for your reply. It was very helpful to detect and solve the problem.
Long story short, I use an external power supply and the magic happened.
I will buy another bunch of USB cables.

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: I couldnt upload code. it stucks at %6 and give timeout error.

Postby Vader_Mester » Wed Apr 28, 2021 5:22 am

demirdemirel wrote:
Tue Apr 27, 2021 5:53 pm
Hi,

Thank you for your reply. It was very helpful to detect and solve the problem.
Long story short, I use an external power supply and the magic happened.
I will buy another bunch of USB cables.
I'm glad it worked out for you :)

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

Who is online

Users browsing this forum: Bing [Bot] and 105 guests