Flash ESP-AT firmware to XIAO ESP32C3

ESP-AT is a project based on ESP-IDF. It makes an ESP32-C3 board work as a slave, and an MCU as a host. The host MCU sends AT commands to the ESP32-C3 chip and receives AT responses back. ESP-AT provides a wide range of AT commands with different functions, such as Wi-Fi commands, TCP/IP commands, Bluetooth LE commands, Bluetooth commands, MQTT commands, HTTP commands, and Ethernet commands. (ref: https://docs.espressif.com/projects/esp-at/en/latest/esp32c3/Get_Started/What_is_ESP-AT.html)

This video show steps to flash ESP-AT firmware to XIAO ESP32C3 using esptool in Windows 11. Then, Raspberry Pi Pico is used as USB-to-serial bridge to send and receive command with XIAO ESP32C3.


Connection:

In my test on XIAO ESP32C3:
Download/Log output port is already established internally on the board, via USB connector. You only need to provide USB cable between the board and PC.

For AT command/response port, I use TX/RX pins only:
- GPIO6 (RX)
- GPIO7 (TX)


Download Released Firmware for ESP32C3:

Visit https://docs.espressif.com/projects/esp-at/en/latest/esp32c3/AT_Binary_Lists/esp_at_binaries.html to download ESP-AT released firmware for ESP32C3.

Extract the downloaded file.

We are going to flash factory_XXX.bin (combined bin) in factory directory.

To flash firmware, simple connect XIAO ESP32C3 with USB cable, it's connected to COM6 in my case.

Flash AT Firmware into Your Device:

We are going to download the bins together to one address, ref https://docs.espressif.com/projects/esp-at/en/latest/esp32c3/Get_Started/Downloading_guide.html, using esptool. Make sure no other applications (such as Arduino IDE's Serial Monitor) is connecting to the COM port.


Open Terminal, switch to the downloaded factory sub-directory.

Optionally check chip_id/flash_id:
esptool --chip auto --port <COM> chip_id
esptool --chip auto --port <COM> flash_id
To erase ESP32-C3 flash:
esptool --chip esp32c3 --port <COM> erase_flash
To flash firmware (.bin):
esptool --chip auto --port <COM> --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 <firmware (such as factory_MINI-1.bin)>
Test AT Command:

Connect as shown in Connection part above, Serial Terminal of two Arduino IDE are used to send/receive AT Command and response to/from 

- XIAO ESP32C3 USB connector connected to PC. Act as Download/Log output port and supply separate power to XIAO ESP32C3. It's COM6 in my case.

- Raspberry Pi Pico (programmed with rp_SerialPassthrough_115200_8N1.ino in last exercise UART (Serial1) communication between XIAO ESP32C3 and Raspberry Pi Pico (RP2040), in Arduino framework) act as a USB-to-Serial bridge to send/receive AT command via AT command/response port. It's connected to COM8 in my case.

Links:
~ ESP32-AT User Guide https://docs.espressif.com/projects/esp-at/
~ AT Command Set (for ESP32C3) https://docs.espressif.com/projects/esp-at/en/latest/esp32c3/AT_Command_Set/index.html
~ AT Command Examples (for ESP32C3) https://docs.espressif.com/projects/esp-at/en/latest/esp32c3/AT_Command_Examples/index.html






















Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

MicroPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI, using boochow/MicroPython-ST7735 library.