Xinyuan-LilyGO / TTGO-T-Display

MIT License
1.02k stars 335 forks source link

GPIO0 button and uploading #81

Open stevempotter opened 2 years ago

stevempotter commented 2 years ago

Sometimes I can upload new code in Arduino without pressing any buttons, sometimes it aborts flashing code with "Fatal error. Timed out waiting for packet content". Holding down the GPIO0 button seems to fix it but is painful. Is there a way to get around this or make it more reliable to upload without pressing any buttons?

stevempotter commented 2 years ago

Here is the error I keep getting, even sometimes when I am holding down the GPIO0 button. Any ideas how to prevent this?

esptool.py v3.1
Serial port COM23
Connecting......
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:11:ae:a5:f2:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x000b1fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 8192 bytes to 47...

A fatal error occurred: Timed out waiting for packet content
A fatal error occurred: Timed out waiting for packet content
MrMcChip commented 2 years ago

My first point of focus would be your programming USB cable. I have a dedicated 18-in cable that I know has consistent results with multiple boards using both micro USB and USB-C (with add-on adapter).

On Sun, Mar 27, 2022, 10:20 AM Steve M. Potter @.***> wrote:

Here is the error I keep getting, even sometimes when I am holding down the GPIO0 button. Any ideas how to prevent this?

esptool.py v3.1 Serial port COM23 Connecting...... Chip is ESP32-D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 4c:11:ae:a5:f2:98 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00001000 to 0x00005fff... Flash will be erased from 0x00010000 to 0x000b1fff... Flash will be erased from 0x00008000 to 0x00008fff... Compressed 8192 bytes to 47...

A fatal error occurred: Timed out waiting for packet content A fatal error occurred: Timed out waiting for packet content

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1079952204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVUIZVP2QEQGKPDKTI3VCCDC3ANCNFSM5RUXTOAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

stevempotter commented 2 years ago

On your suggestion, I tried several cables, including some expensive thick well-shielded ones, and short ones. I still can only upload about half of the time. None of them fixed the problem. Sadly, I have gone back to an old DOIT Devkit ESP32 to avoid this problem.

MrMcChip commented 2 years ago

A lot of troubleshooting is a process of elimination. Other variables to consider are the board itself so if you have another board to work with or test? The other simple thing to do is lower the board rate and see if that shows you anything?

On Mon, Mar 28, 2022, 3:26 PM Steve M. Potter @.***> wrote:

On your suggestion, I tried several cables, including some expensive thick well-shielded ones, and short ones. I still can only upload about half of the time. None of them fixed the problem. Sadly, I have gone back to an old DOIT Devkit ESP32 to avoid this problem.

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1081107225, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVV5QI25QI6HMFM77ILVCIIX7ANCNFSM5RUXTOAA . You are receiving this because you commented.Message ID: @.***>

stevempotter commented 2 years ago

Is there a way to understand this problem and measure something (e.g., with my oscilloscope) to see how to fix it? I have tried several boards, and the problem is that they all sometimes work and sometimes give the timeout error. An intermittent problem is hard to track down by just trying random changes. My latest tests suggest that if the LilyGO ESP32 board has nothing attached but the USB-C cable, it always uploads. But I don't want to have to unplug the board from its circuits every time I upload new code.

stevempotter commented 2 years ago

Here are my board settings: ESP32LilyGO board settings (works)

MrMcChip commented 2 years ago

Which UART bridge controller does your board have? Which operating platform are you running?

On Tue, Mar 29, 2022, 8:15 AM Steve M. Potter @.***> wrote:

Here are my board settings: [image: ESP32LilyGO board settings (works)] https://user-images.githubusercontent.com/5586932/160619459-9b4e4584-7fb1-494f-92e5-5b2fdb401912.JPG

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1081856989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVTMDN5DKYEYPRBK4NLVCL65FANCNFSM5RUXTOAA . You are receiving this because you commented.Message ID: @.***>

stevempotter commented 2 years ago

Which UART bridge controller does your board have? Which operating platform are you running?

I am running Arduino IDE 1.8.15 on Windows10. Here is a photo of the USB chip on the ESP32 that is giving me a hard time.

LilyGO TTGO V1 1 USB chip

MrMcChip commented 2 years ago

You have a Sil Lab CP 2104 which is the best available IMO. Get yourself a datasheet.pdf for that bridge. You should verify Windows is loading the proper driver every time you plug in the USB with TTGO board attached before doing your upload. If you get a timeout recycle the USB connector with board attached. Windows driver utility should provide that Intel.

USB sniffer and protocol analyzer for Windows would be my next move to further troubleshoot USB port communications. This should prove more useful than an oscilloscope at this point. I operate on a Linux platform... I don't do windows! So I can't make any recommendations but there are options available on the web for this type of utility.

On Wed, Mar 30, 2022, 3:19 AM Steve M. Potter @.***> wrote:

Which UART bridge controller does your board have? Which operating platform are you running?

I am running Arduino IDE 1.8.15 on Windows10. Here is a photo of the USB chip on the ESP32 that is giving me a hard time.

[image: LilyGO TTGO V1 1 USB chip] https://user-images.githubusercontent.com/5586932/160784930-a9f7bb41-6e0b-4dc7-b74f-a77155194779.jpg

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1082770991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVQPYMWEOV5OE3UDRY3VCQFBNANCNFSM5RUXTOAA . You are receiving this because you commented.Message ID: @.***>

MrMcChip commented 2 years ago

Which bridge controller chip is on your DOIT development ESP32 board? Are they same same as the TTGO?

Also, I believe windows command line prompt will allow you to use the LSUSB command... If it works in terminal mode/ command line you should see CP210x listed

On Wed, Mar 30, 2022, 4:32 AM M Robarton @.***> wrote:

You have a Sil Lab CP 2104 which is the best available IMO. Get yourself a datasheet.pdf for that bridge. You should verify Windows is loading the proper driver every time you plug in the USB with TTGO board attached before doing your upload. If you get a timeout recycle the USB connector with board attached. Windows driver utility should provide that Intel.

USB sniffer and protocol analyzer for Windows would be my next move to further troubleshoot USB port communications. This should prove more useful than an oscilloscope at this point. I operate on a Linux platform... I don't do windows! So I can't make any recommendations but there are options available on the web for this type of utility.

On Wed, Mar 30, 2022, 3:19 AM Steve M. Potter @.***> wrote:

Which UART bridge controller does your board have? Which operating platform are you running?

I am running Arduino IDE 1.8.15 on Windows10. Here is a photo of the USB chip on the ESP32 that is giving me a hard time.

[image: LilyGO TTGO V1 1 USB chip] https://user-images.githubusercontent.com/5586932/160784930-a9f7bb41-6e0b-4dc7-b74f-a77155194779.jpg

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1082770991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVQPYMWEOV5OE3UDRY3VCQFBNANCNFSM5RUXTOAA . You are receiving this because you commented.Message ID: @.***>

stevempotter commented 2 years ago

Which bridge controller chip is on your DOIT development ESP32 board? Are they same same as the TTGO?

It looks the same as the SIL 2104 but has no markings whatsoever. Etched off? This DOIT board is probably a clone.

From Windows Device Manager: Both boards invoke the "Silicon Labs CP210x USB to UART Bridge" driver when plugged in.

Also, I believe windows command line prompt will allow you to use the LSUSB command...

"LSUSB" was not a recognized command at the Terminal command line.

I downloaded "Free Device Monitoring Studio" to look at the USB packets to and from the ESP32. But I have no idea what to look for, and have not used a packet sniffer before. Do you have any suggestions?

MrMcChip commented 2 years ago

Look into USB device enumeration. It looks like the device and driver are communicating when given a push button reset when needed. At this point I would research your CP210X driver version and see if there's an update available from silicon labs? I believe your chip is date code 2015? Again having no desire to give Bill Gates any of my money I'm not a Windows fan

On Wed, Mar 30, 2022, 8:40 AM Steve M. Potter @.***> wrote:

Which bridge controller chip is on your DOIT development ESP32 board? Are they same same as the TTGO?

It looks the same as the SIL 2104 but has no markings whatsoever. Etched off? This DOIT board is probably a clone.

From Windows Device Manager: Both boards invoke the "Silicon Labs CP210x USB to UART Bridge" driver when plugged in.

Also, I believe windows command line prompt will allow you to use the LSUSB command...

"LSUSB" was not a recognized command at the Terminal command line.

I downloaded "Free Device Monitoring Studio" to look at the USB packets to and from the ESP32. But I have no idea what to look for, and have not used a packet sniffer before. Do you have any suggestions?

— Reply to this email directly, view it on GitHub https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/81#issuecomment-1083154612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWCIWVQ63RUR7VOOQYCJFYTVCRKUNANCNFSM5RUXTOAA . You are receiving this because you commented.Message ID: @.***>