Espressif Flash Download Tool

Use Arduino MKR (SAMD21) as serial proxy/passthrough for sending AT commands, watch bootloader messages or flash ESP firmware

How to use flash download tool? Post by EspressifKelly » Wed Apr 15, 2015 3:20 am. Hi all, 1.Tool name: Flash download tool Click to download. For an ESP8266 with 8 Mbit / 1 Mbyte flash, configure the ESP8266 Download Tool according to the information from the README.md file like below. Some deduction must be done, to find the correct files: For an ESP8266 with 16 Mbit / 2 Mbyte flash, configure the ESP8266 Download Tool according to the information from the README.md file like below.

  • 3 views
  • 0 comments
  • 0 respects

Components and supplies

Arduino MKR Zero
Arduino MKR Zero or compatible
×1
Espressif ESP8266 ESP-01
×1
USB-A to Micro-USB Cable
×1
Male/Female Jumper Wires
×7
Tools

About this project

Flashing ESP8266 (ESP-01) using Arduino MKR or compatible

Tool

The ESP8266 (ESP-01) is a WiFi module running at 3.3V, so it normally requires a 3.3V TTL level USB to Serial port adapter, for serial connection from a PC.

This writeup shows how a compatible MCU can be used as a serial proxy or serial passthrough, to forward USB traffic from the PC to the ESP8266. And of course returning traffic from the ESP8266 back to the PC.

The solution is to use an Arduino MKR series, Arduino Zero or compatible, based on SAMD21 or SAMD51 MCU’s with at least 8 Kbytes of SRAM and 16 Kbyte of flash, working at 3.3 volt. A special Arduino sketch must be flashed on the microcontroller.

The MCU should use native USB for PC connection and a hardware UART for connecting to the ESP. The Arduino SAMD21/51-based MCU’s fulfill these requirements.

This writeup is primarily meant for flashing new firmware on the ESP, but may also be used to watch bootloader messages or execute AT-commands on the ESP from the Arduino Serial Monitor or using a terminal emulator with serial port support.

Hardware setup

Connect the ESP8266 (ESP-01) to the Arduino like this:

Espressif Flash Download Tool

Pin 8, 9 and 10 might be replaced with other pins, just remember to change the definitions in the Arduino sketch.

Software setup

Install the Arduino sketch from https://github.com/ksmith3036/EspSerialPassthrough using Arduino Studio or Visual Micro into the Arduino MKR or compatible,

Firmware from Espressif

Firmware may be found at https://www.espressif.com/en/support/download/at.

Content of firmware downloaded from espressif:

Substitute Fwfolder with a real name, like ESP8266_NonOS_AT_Bin_V1.7.4.

First part of FwfolderbinatREADME.md:

For an ESP8266 with 8 Mbit / 1 Mbyte flash, configure the ESP8266 Download Tool according to the information from the README.md file like below. Some deduction must be done, to find the correct files:

For an ESP8266 with 16 Mbit / 2 Mbyte flash, configure the ESP8266 Download Tool according to the information from the README.md file like below. Some deduction must be done, to find the correct files:

If having a flash of 16 Mbit or more, or wanting to use the AT-SDIO version for 16 Mbit flash, refer to the Fwfolderbinat_sdioREADME.md file.

ESP firmware download tool

The ESP firmware flashing tool may be downloaded from https://www.espressif.com/en/support/download/other-tools.

Unpack and run the flash download tool:

A black window appears.

After 5 to 30 seconds, a window appears: select Developer Mode

Then select ESP8266 DownloadTool

Use SpiAutoSet to get parameters from ESP, by checking SpiAutoSet and then pressing START with no files selected for flashing. Filenames may be listed, but they must be unchecked.

When using an Arduino MKR or Zero, baud rate could be set at up to 1500000 baud. If using an Arduino without native USB, 115200 should be used.

The command window shows the working. Initially the flashing program connect using 115200 baud, sending a stub loader to the ESP. If another baud rate than 115200 is selected in the user interface, the baud rate is switched. Switching baud rates will only work for Arduinos with native USB connection to the PC, since they in fact ignore the baud rate between the PC and Arduino, always running at full USB speed, which for an SAMD21 is 12 Mbit/sec. The EspSerialPassthrough sketch detects the baud rate change command, and changes the baud rate between the Arduino and the ESP accordingly.

The results for an ESP-01 / ESP8266 with 8 Mbit flash:

The program finds the crystal frequency (CrystFreq) and flash size. In my case it also keeps the SPI MODE set to QIO. Several tries flashing with SPI mode set to QIO failed, but an Internet search found that DOUT might be necessary to select manually.

Uncheck SpiAutoSet and select the appropriate SPI MODE, which for my ESP8266 was DOUT. SPI Mode seems to control the way the ESP flashes itself.

Then select the correct files to flash, according to the README.md file of the ESP firmware, and click START:

For baud rates, using an Arduino MKR with SAMD21 microcontroller, connected to the PC using native USB, I successfully have flashed with baud rates up to 1500000.

Verify successful flashing

Flash

Reset the Arduino, which makes the Arduino program reset the ESP8266.

Open a serial monitor or terminal emulator like Putty. Make sure to send both NewLine and Carriage Return as line feeds. May manually be entered as Ctrl-M + Ctrl-J instead of using the ENTER key.

Run the AT+GMR command:

Firmware upgraded successfully!

Code

Esp Serial Passthrough (ESP proxy)
Code to use SAMD21/51 MCU as a serial proxy towards the ESP8266.

Schematics

Author

ksmith3036
  • 1 project
  • 0 followers

Published on

January 23, 2021
Write a comment

Members who respect this project

See similar projects
you might like

Table of contents

Write a comment

How do you completely erase ESP32 flash chip using Flash Download Tool? This has been tricky for a long time (LONG time, especially in case of the ESP8266). This has been made simple in the latest version of the Flash Download Tool.

This version of the Flash Download Tool comes with a simple “Erase” button. This lets you completely erase ESP32 flash memory.

Espressif flash download tool download

This is something you should do every time you get a fresh ESP module and plan to run your own custom firmware on it.

Note that we are not providing a link to the new Download Tool because the link changes rather frequently. You can find the Download Tool on Espressif’s official website. The one download tool supports all of Espressif’s chips (ESP8266 and variants as well).

It would probably be a good idea to select the flash size manually rather than just rely on the automatic size detection. Murphy loves ESP developers most!

Espressif Flash Download Tool Free

Related