Downloading Guide

[中文]

This Guide demonstrates how to download AT firmware and flash it into an ESP32-C3-MINI-1 device by taking ESP32-C3-MINI-1 as an example. The Guide is also applicable to other ESP32-C3 modules.

Before you start, please make sure you have already connected your hardware. For more details, see Hardware Connection.

For different series of modules, the commands supported by AT firmware are different. Please refer to ESP-AT Firmware Differences for more details.

Download AT Firmware

To download AT firmware to your computer, please do as follows:

  • Navigate to AT Binary Lists

  • Find the firmware for your device

  • Click the link to download it

Here, we download ESP32-C3-MINI-1_AT_Bin_V2.3.0.0 for ESP32-C3-MINI-1. The list below describes the structure of this firmware and what each bin file contains. Other AT firmware has similar structure and bin files.

.
├── at_customize.bin                 // secondary partition table
├── bootloader                       // bootloader
│   └── bootloader.bin
├── customized_partitions            // AT customized binaries
│   ├── ble_data.bin
│   ├── client_ca.bin
│   ├── client_cert.bin
│   ├── client_key.bin
│   ├── factory_param.bin
│   ├── factory_param_MINI-1.bin
│   ├── mqtt_ca.bin
│   ├── mqtt_cert.bin
│   ├── mqtt_key.bin
│   ├── server_ca.bin
│   ├── server_cert.bin
│   └── server_key.bin
├── download.config                  // configuration of downloading
├── esp-at.bin                       // AT application binary
├── esp-at.elf
├── esp-at.map
├── factory                          // A combined bin for factory downloading
│   ├── factory_MINI-1.bin
│   └── factory_parameter.log
├── flasher_args.json                // flasher arguments
├── ota_data_initial.bin             // ota data parameters
├── partition_table                  // primary partition table
│   └── partition-table.bin
├── phy_init_data.bin                // phy parameters
└── sdkconfig                        // compilation configuration for AT firmware

The file download.config contains the configuration to flash the firmware into multiple addresses:

--flash_mode dio --flash_freq 40m --flash_size 4MB
0x8000 partition_table/partition-table.bin
0xd000 ota_data_initial.bin
0xf000 phy_init_data.bin
0x0 bootloader/bootloader.bin
0x60000 esp-at.bin
0x1e000 at_customize.bin
0x1F000 customized_partitions/ble_data.bin
0x3a000 customized_partitions/mqtt_key.bin
0x27000 customized_partitions/server_key.bin
0x3c000 customized_partitions/mqtt_ca.bin
0x2d000 customized_partitions/client_key.bin
0x2b000 customized_partitions/client_cert.bin
0x31000 customized_partitions/factory_param.bin
0x2f000 customized_partitions/client_ca.bin
0x38000 customized_partitions/mqtt_cert.bin
0x29000 customized_partitions/server_ca.bin
0x25000 customized_partitions/server_cert.bin

  • --flash_mode dio means the firmware is compiled with flash DIO mode.

  • --flash_freq 40m means the firmware’s flash frequency is 40 MHz.

  • --flash_size 4MB means the firmware is using flash size 4 MB.

  • 0xd000 ota_data_initial.bin means downloading ota_data_initial.bin into the address 0xd000.

Flash AT Firmware into Your Device

Follow the instructions below for your operating system.

Windows

Before starting to flash, you need to download Flash Download Tools for Windows. For more details about the tools, please see the doc folder in the zip folder.

  • Open the ESP32-C3 Flash Download Tool.

  • Select chipType. (Here, we select ESP32C3.)

  • Select a workMode according to your need. (Here, we select Developer Mode.)

  • Select a loadMode according to your need. (Here, we select uart.)

Firmware Download Configurations

Firmware Download Configurations

  • Flash AT firmware into your device. You can select either of the two ways below.

    • To download one combined factory bin to address 0, select “DoNotChgBin” to use the default configuration of the factory bin.

      Download to One Address

      Download to One Address

    • To download multiple bins separately to different addresses, set up the configurations according to the file download.config and do NOT select “DoNotChgBin”.

      Download to Multiple Addresses

      Download to Multiple Addresses

In case of flashing issues, please verify what the COM port number of download interface of the ESP32-C3 board is and select it from “COM:” dropdown list. If you don’t know the port number, you can refer to Check port on Windows for details.

When you finish flashing, please Check Whether AT Works.

Linux or macOS

Before you start to flash, you need to install esptool.py.

You can select either of the two ways below to flash AT firmware into your device.

  • To download the bins separately into multiple addresses, enter the following command and replace PORTNAME and download.config:

    esptool.py --chip auto --port PORTNAME --baud 115200 --before default_reset --after hard_reset write_flash -z download.config
    

    Replace PORTNAME with your port name. If you don’t know it, you can refer to Check port on Linux and macOS for details.

    Replace download.config with the content inside the file.

    Below is the example command for ESP32-C3-MINI-1.

    esptool.py --chip auto --port /dev/tty.usbserial-0001 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0xd000 ota_data_initial.bin 0xf000 phy_init_data.bin 0x0 bootloader/bootloader.bin 0x60000 esp-at.bin 0x1e000 at_customize.bin 0x1F000 customized_partitions/ble_data.bin 0x3a000 customized_partitions/mqtt_key.bin 0x27000 customized_partitions/server_key.bin 0x3c000 customized_partitions/mqtt_ca.bin 0x2d000 customized_partitions/client_key.bin 0x2b000 customized_partitions/client_cert.bin 0x31000 customized_partitions/factory_param.bin 0x2f000 customized_partitions/client_ca.bin 0x38000 customized_partitions/mqtt_cert.bin 0x29000 customized_partitions/server_ca.bin 0x25000 customized_partitions/server_cert.bin
    
  • To download the bins together to one address, enter the following command and replace PORTNAME and FILEDIRECTORY:

    esptool.py --chip auto --port PORTNAME --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 FILEDIRECTORY
    

    Replace PORTNAME with your port name. If you don’t know it, you can refer to Check port on Linux and macOS for details.

    Replace FILEDIRECTORY with the file directory you would flash to the address 0x0. It is normally factory/XXX.bin.

    Below is the example command for ESP32-C3-MINI-1.

    esptool.py --chip auto --port /dev/tty.usbserial-0001 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 factory/factory_MINI-1.bin
    

When you finish flashing, please Check Whether AT Works.

Check Whether AT Works

To check whether AT works, do as follows:

  • Open a serial port tool, such as SecureCRT;

  • Select the Port attached to “AT command/response” line (see Hardware Connection for details);

  • Set Baudrate to 115200;

  • Set Data Bits to 8;

  • Set Parity to None;

  • Set Stop Bits to 1;

  • Set Flow Type to None;

  • Enter the command “AT+GMR” with a new line (CR LF).

If the response is OK as the picture below shows, AT works.

Response from AT

Response from AT

Otherwise, you need to check your ESP32-C3 startup log, which is visible on PC over “Download/Log output connection”. If it is like the log below, it means that ESP-AT firmware have been initalized correctly.

ESP32-C3 startup log:

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x1948
load:0x403ce000,len:0x8dc
load:0x403d0000,len:0x2de0
entry 0x403ce000
I (31) boot: ESP-IDF v4.3.1-354-g98d34e5 2nd stage bootloader
I (32) boot: compile time 11:21:56
I (32) boot: chip revision: 3
I (34) boot.esp32c3: SPI Speed      : 40MHz
I (39) boot.esp32c3: SPI Mode       : DIO
I (44) boot.esp32c3: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (54) boot: Partition Table:
I (58) boot: ## Label            Usage          Type ST Offset   Length
I (65) boot:  0 otadata          OTA data         01 00 0000d000 00002000
I (72) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (80) boot:  2 nvs              WiFi data        01 02 00010000 0000e000
I (87) boot:  3 at_customize     unknown          40 00 0001e000 00042000
I (95) boot:  4 ota_0            OTA app          00 10 00060000 001d0000
I (102) boot:  5 ota_1            OTA app          00 11 00230000 001d0000
I (110) boot: End of partition table
I (114) esp_image: segment 0: paddr=00060020 vaddr=3c140020 size=29060h (168032) map
I (158) esp_image: segment 1: paddr=00089088 vaddr=3fc90800 size=03dfch ( 15868) load
I (162) esp_image: segment 2: paddr=0008ce8c vaddr=40380000 size=0318ch ( 12684) load
I (167) esp_image: segment 3: paddr=00090020 vaddr=42000020 size=130764h (1247076) map
I (433) esp_image: segment 4: paddr=001c078c vaddr=4038318c size=0d588h ( 54664) load
I (446) esp_image: segment 5: paddr=001cdd1c vaddr=50000000 size=00004h (     4) load
I (447) esp_image: segment 6: paddr=001cdd28 vaddr=50000008 size=00010h (    16) load
I (457) boot: Loaded app from partition at offset 0x60000
I (458) boot: Disabling RNG early entropy source...
module_name:MINI-1
max tx power=78,ret=0
2.3.0