Page 1 of 2

manually entering flash mode

Posted: Fri May 11, 2018 4:47 pm
by mzimmers
Hi all -

My company has built a prototype board based on the ESP-WROOM-32, but (currently) without the UART circuitry to automatically enter flash mode. So, I'm experimenting with button pushing for the first time. I've read The Bible, as well as this page: https://github.com/espressif/esptool/wi ... -Selection, and I just want to confirm: to enter flash mode, I hold down the EN button, and press BOOT, right? And at this point, I should expect the "make flash" command to work?

Currently I get this message:
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Oh, and once I enter flash mode, how much time do I have to initiate the flash download?

Thanks for any insight.

Re: manually entering flash mode

Posted: Fri May 11, 2018 5:23 pm
by kolban
The "ROM Serial Bootloader" mode is entered by booting/resetting with GPIO0 and GPIO2 held low ... see:

https://github.com/espressif/esptool/wi ... -Selection

Once the device enters "ROM Serial Bootloader" mode, it stays there until the device is subsequently reset.

Re: manually entering flash mode

Posted: Fri May 11, 2018 6:09 pm
by fly135
mzimmers wrote:I just want to confirm: to enter flash mode, I hold down the EN button, and press BOOT, right? And at this point, I should expect the "make flash" command to work?

Currently I get this message:
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
You've got it backwards. Hold both the BOOT and EN, then release EN and wait for the dots and dashes to change to a downloading message then let up the BOOT. It will give you a DL msg in several seconds after you releas EN.

John A

Re: manually entering flash mode

Posted: Fri May 11, 2018 6:20 pm
by mzimmers
Thanks, guys. Tried and failed...I'm guessing there's a glitch somewhere in the board.

Re: manually entering flash mode

Posted: Fri May 11, 2018 6:41 pm
by fly135
Does the EN button reset your board? If so then it works. Then the question is whether it's seeing the BOOT button, which signals DL mode.

John A

Re: manually entering flash mode

Posted: Fri May 11, 2018 6:55 pm
by mzimmers
Hi John -

Yeah, according to the scope, the EN button is working.

There's nothing special I need to do for the first programming of the device, is there? Because the python tool will load a bootloader as well. Or am I leaving out a step?

Re: manually entering flash mode

Posted: Fri May 11, 2018 11:29 pm
by kolban
You should be able to test that the ESP32 is in flash mode by attaching a console to it and booting it in flash mode. You should see the following messages:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x26 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
waiting for download
When you use "esptool" (depending on your board and parameters passed), esptool will use CTS/RTS and a circuit to reboot the board for you in flash mode before sending flash commands.

Re: manually entering flash mode

Posted: Sat May 12, 2018 5:21 pm
by fly135
mzimmers wrote:Hi John -

Yeah, according to the scope, the EN button is working.

There's nothing special I need to do for the first programming of the device, is there? Because the python tool will load a bootloader as well. Or am I leaving out a step?
Yes, the make flash will burn the 2nd stage bootloader. The 1st stage is what handles the button checking and download.

In my experience you...

make flash

then when the dots and dashes start, press both EN and BOOT, then release EN, wait until the dots and dashes stop, then release BOOT.

The devkit board I have will automatically work without the button pressing. But the prototype board from the company I'm working for requires the button dance to flash.

John A

Re: manually entering flash mode

Posted: Mon May 14, 2018 2:49 pm
by mzimmers
Hmm...now you have me wondering whether the problem is a bit more fundamental than I first thought. Perhaps the problem isn't that the board isn't entering flash mode, but that it's simply not seeing any input on the port.

Does the first-stage bootloader produce output that would be seen by "make monitor?"

Re: manually entering flash mode

Posted: Mon May 14, 2018 3:14 pm
by fly135
I don't use make monitor. I use Teraterm. But I can't think of a single why make monitor wouldn't work. I put a command line interface in my app and others testing at the company claim that they can't type user input into the "monitor". I just tell them to use teraterm.

John