manually entering flash mode

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

manually entering flash mode

Postby mzimmers » Fri May 11, 2018 4:47 pm

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.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: manually entering flash mode

Postby kolban » Fri May 11, 2018 5:23 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: manually entering flash mode

Postby fly135 » Fri May 11, 2018 6:09 pm

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

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: manually entering flash mode

Postby mzimmers » Fri May 11, 2018 6:20 pm

Thanks, guys. Tried and failed...I'm guessing there's a glitch somewhere in the board.

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

Re: manually entering flash mode

Postby fly135 » Fri May 11, 2018 6:41 pm

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

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: manually entering flash mode

Postby mzimmers » Fri May 11, 2018 6:55 pm

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?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: manually entering flash mode

Postby kolban » Fri May 11, 2018 11:29 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: manually entering flash mode

Postby fly135 » Sat May 12, 2018 5:21 pm

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

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: manually entering flash mode

Postby mzimmers » Mon May 14, 2018 2:49 pm

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?"

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

Re: manually entering flash mode

Postby fly135 » Mon May 14, 2018 3:14 pm

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

Who is online

Users browsing this forum: No registered users and 358 guests