ESP-WROOM-32 Problems programming with esptool.py etc

sam512bb
Posts: 3
Joined: Thu Nov 08, 2018 2:41 am

ESP-WROOM-32 Problems programming with esptool.py etc

Postby sam512bb » Thu Nov 08, 2018 3:03 am

Good day All,

I have spent hours trying to figure out this issue and have read as many similar posts I could fine, but alas I cannot figure out what I cannot program a custom PCB that has a ESP-WROOM-32 mounted to it. The design pretty much follows the Adafruit Feather ESP32 design with the exception that I am using a FTDI FT232R instead of the CP2104. I have checked,checked, and checked to the nth time and everything looks fine electrically. The strapping pins are correct and looking at the "boot:0x13" from reset, this value confirms this. I am using a lab quality 3.3V power supply and so there are no power supply issues. The ESP-WROOM-32 resets fine and goes into the default factory application:

ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
<I removed the remainder>

If I open up a dumb terminal program and manipulate the RTS and DTR signals I can reset the device fine. If I assert DTR (which holds GPIO0 low) and reset the chip I am able to get the ESP-WROOM-32 to enter into a serial download mode:

ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download

At this point the module looks like it is working as expected. However, if I try and program the device via Arduino IDE it fails to connect and I get the following:

esptool.py v2.3.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

If I try using esptool.py directly with the appropriate command line parameters:
esptool.py --chip esp32 --port COM2 flash_id

I get pretty much the same result and the esptool is unable to connect to the device.

I do have a Adafruit Feather ESP32 board and I have no issues connecting and programming it with the Arduino IDE or directly with the esptool program and so I know there are no issues with my serial port or computer. To rule out a bad ESP-WROOM-32 module I assembled two other PCBs (one module from Adafruit and another from Mouser) and I am getting the same results.

So... I was curious do bare modules need to be programmed with a different bootloader in order to work the esptool/Arduino IDE? If not, can anyone offer some advice to help me track down my issue?

Thanks in advance!

Cheers,

Sam

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby ESP_Sprite » Thu Nov 08, 2018 3:11 am

Not sure what's wrong with your board (although I feel it may be something to do with timing... for some reason, the time esptool.py asserts the handshake pins may not be enough for your board? Just guessing here) but I can tell you esptool.py as well as Arduino should be able to flash a blank chip connected to a factory-state ESP32, there's no pre-programmed bootloader involved or needed.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby ESP_Angus » Thu Nov 08, 2018 5:52 am

You can try adding the "--trace" option to esptool.py and see if anything is coming back:
https://github.com/espressif/esptool#tr ... teractions

If you want to rule out a problem with timing, as Sprite suggests, then you can reset the board until it shows you the correct UART bootloader mode prompt and then use "esptool.py --before no_reset ..." to connect without re-asserting DTR/RTS.

Is it possible that you only have one-way UART communication to the chip? ie the FTDI chip is receiving from the ESP32 OK, but commands sent from the ESP32 to the FTDI chip are not getting through due to an electrical issue?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby chegewara » Thu Nov 08, 2018 6:27 am

Ive seen few similar issues on arduino-esp32 github, im pretty sure you can find solution in there.
https://github.com/espressif/arduino-esp32/issues

Usually it was capacitor on reset or GPIO0.

sam512bb
Posts: 3
Joined: Thu Nov 08, 2018 2:41 am

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby sam512bb » Thu Nov 08, 2018 8:22 pm

Good day All,

Thank you all for your replies and suggestions! This is great info! Having clarification that one does not need to load a different bootloader eliminates one possible issue. As for the timing... it could be, as I can see (I have Tx and Rx LEDs connected to the FT232) the Arduino IDE/ esptool.py tickling my module and the module does respond. However, I did not sniff the low level Tx/Rx connections and so perhaps something is preventing the actual Rx/Tx lines from working properly. I will check this pronto. As for the Cap on reset/en... I checked this and even tried a larger cap and found no change. I did implement the --Trace option on esptool.py and I can see data being received by the software. However, I did not check to see if the module is 100% receiving data...

Thanks again! I will report back after trying your suggestions.

Cheers,

Sam

sam512bb
Posts: 3
Joined: Thu Nov 08, 2018 2:41 am

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby sam512bb » Thu Nov 08, 2018 9:25 pm

Good day again all!

Thanks again for all of your suggestions!

Indeed, the problem was that the Tx to the ESP device was not getting through. The issue was a damaged and/or faulty FT232R device. The Tx indicator would flash when a transmitting, but the actual Tx did nothing. I sniffed the line and I could not see any data being transmitted. I desoldered the FT232R and replaced it with a new device and all is working as it should!

Thanks again for all your help!

Cheers,

Sam

MarkIngle
Posts: 30
Joined: Wed Jan 18, 2017 4:48 am

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby MarkIngle » Sun Apr 21, 2019 2:33 pm

@sam512bb - Were you using the SparkFun FT232R FTDI board? Just curious as I am having the same problem....could also share your wiring connections between the FT232R and the ESP32?

Using logic analyzer I see data on RX but not TX....

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: ESP-WROOM-32 Problems programming with esptool.py etc

Postby fly135 » Tue Apr 23, 2019 2:02 pm

I get the same problem sometimes when using a USB extension cable. Then I have to use the BOOT/EN buttons to initiate download mode.

John A

Who is online

Users browsing this forum: No registered users and 121 guests