1

I recently bought an ESP-01 as well as an FTDI programmer (3.3v-5v) and after typing AT+GMR I noticed it said:

  • AT version:0.40.0.0(Aug 8 2015 14:45:58)
  • SDK version:1.3.0
  • Ai-Thinker Technology Co.,Ltd.
  • Build:1.3.0.2 Sep 11 2015 11:48:04

I have looked and looked on a way to upgrade its firmware (on MacOS) to no avail. How can I upgrade it? I want to be able to change the baud rate to 9600. A lot of examples to do it are in windows requiring another application or something like that but how can I do it in a Macbook? Thanks.

3
  • 1
    use esptool. the firmware binaries are on Espressifs site. the latest versions don't fit into esp-01's flash memory
    – Juraj
    May 7, 2020 at 9:35
  • "I want to be able to change the baud rate to 9600", what do you mean by that? Is that the reason you want to upgrade firmware? The firmware came as binary file, you won't be able to change that. Default baud rate of esp-01 is 115200 bps. You can change it via AT command, run a bare minimum sketch and type in AT+UART_DEF=9600,8,1,0,0 to make the change, the command _DEF will make the setting persistent.
    – hcheung
    May 7, 2020 at 10:48
  • Sorry im really new to Arduino and ESP in general, I read that you need to have both the Arduino and ESP in the same baud rate and to do that I need to upgrade my firmware (please correct me if im wrong).
    – Marcelo_M
    May 7, 2020 at 19:03

3 Answers 3

4

Here is the step-by-step on upgrade the ESP-01 AT Command firmware (for running on macOS).

Wiring

For flashing the ESP-01 firmware, you need to have a USB-TTL adaptor as a programmer.

+---------------------+---------+
|                     | RxD Vcc |
|       Top View      | IO2 RST |
|                     | IO0 CPD |
|                     | GND TxD |
+---------------------+---------+

ESP-01          USB-TTL Adaptor
 VCC   ---------- 3V3
 GND   ---------- GND
 TxD   ---------- RxD
 RxD   ---------- TxD
 CH_PD ---------- see note* below
 GPIO0 ---------- Connect to a push switch (Flash button) to GND
 RST   ---------- a push switch (Reset button) to GND

Note: depend on whether you have ESP-01 or ESP-01S, for ESP-01, you will need to connect CH_PD either directly to 3v3 or via a 3k-10k resistor to 3v3. However, you don't need an extra pull-up resistor for ESP-01S as CH_PD already has on-board pull-up resistor. This picture shows the different between ESP-01 and ESP-01S, visually ESP-01 has 2 LEDs on board near the antenna, while ESP-01S have two extra resistor between header pins and ESP8266EX chip, and with only one LED.

Download and install esptool

Download and install esptool from https://github.com/espressif/esptool. esptool is a python application. You need to have python installed as well.

Download firmware 2.1

Download ESP8266 nonOS SDK - Release 2.1.x, noticed that this is not the latest version as the latest version doesn't works for ESP-01 based on my experience.

Upgrade the firmware

You will actually only need 4 files for the upgrade, I would suggest that you copy and paste those files into your esptool directory from the downloaded bin/ directory. cd into your esptool directory and run the following commands to upgrade the firmware.

To put ESP-01 into programming mode:

  1. Press and hold Flash(GPIO0) button;
  2. Press Reset button once, this will put ESP-01 in programming mode;
  3. Press Reset to start the newly uploaded program when upload is completed.
./esptool.py --port /dev/cu.SLAB_USBtoUART write_flash 0x00000 boot_v1.7.bin
./esptool.py --port /dev/cu.SLAB_USBtoUART write_flash 0x01000 user1.1024.new.2.bin
./esptool.py --port /dev/cu.SLAB_USBtoUART write_flash 0x7c000 esp_init_data_default.bin
./esptool.py --port /dev/cu.SLAB_USBtoUART write_flash 0x3e000 blank.bin
./esptool.py --port /dev/cu.SLAB_USBtoUART write_flash 0x7e000 blank.bin

Please noted that /dev/cu.SLAB_USBtoUART is the USB port for my USB-TTL interface, yours might be different, run ls /dev/tty.* to find out your USB port

7
  • the AT binaries are published separately from SDK too. espressif.com/en/support/download/…
    – Juraj
    May 7, 2020 at 12:11
  • usual is to run esptool as one command started in the at firmware's folder esptool.py write_flash --flash_size 2MB-c1 0x0 boot_v1.7.bin 0x01000 at/1024+1024/user1.2048.new.5.bin 0x1fb000 blank.bin 0x1fc000 esp_init_data_default_v08.bin 0xfe000 blank.bin 0x1fe000 blank.bin (this command is for AT 1.7 and 2 MB or more flash)
    – Juraj
    May 7, 2020 at 12:13
  • 1
    @Juraj You have ESP-01 with 2MB? I never saw any ESP-01 came with 2MB flash unless I buy chip and replace it. Usually I saw it either come with 512kB or 1MB.
    – hcheung
    May 7, 2020 at 13:22
  • I didn't say that it is for esp-01. I have a command for a 2 MB module so I pasted it as example.
    – Juraj
    May 7, 2020 at 14:31
  • I see. Thanks for the one liner.
    – hcheung
    May 7, 2020 at 14:37
0

You use esptool.py available from github.

It's exactly the same usage regardless of which operating system you are using (apart from the serial port device name of course), so instructions for Linux (for example) are the same as instructions for Mac OS X.

-1

The OP doesn't need to upgrade the ESP's firmware, despite that that's what the question said. They apparently want to change its baud rate. That is doable with an AT command in the existing firmware, as described @hcheung described in a comment.

See my answer to a similar question here, noting especially, the last few lines of that post which is essentially a script for manually making the change. Note also, that this is not at all host operating system specific; everything is done with a sketch like the one in that question, and the Arduino IDE Serial Monitor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.