0

members

Easy Basics: Project 070b ESP32 Development board - AT commands

of Acoptex.com in ESP8266 ESP-32

Basics: Project 070b

Project name: ESP32 Development board - AT commands

Tags: Arduino, ESP32 Dev Module, ESP32 development board, ESP32 Development board with WiFi and Bluetooth, ESP32-DevKitC V4 development board, ESP-WROOM-32 module with ESP32‑D0WDQ6 chip, Espressif Systems, ESP32-based development board, ESP32 modules, ESP32-WROOM-32, ESP32-WROOM-32U, ESP32-WROOM-32D, ESP32-SOLO-1, USB-UART bridge, IOT, ESP-WROOM-32 Dev Module, ESP32 DEVKITV1, Installing the ESP32 Board in Arduino IDE, Uploading sketch, AT commands

Attachments: none

In this project, you need these parts :

1. ESP32 development board with WiFi and Bluetooth and USB A / micro USB B cable 1 pc

2.Jumper cables F-F

3.USB to TTL/Serial adaptor/converter 1 pc

General

We will learn how to upload AT firmware to ESP32 development board and use it.

There are a lot of different development boards made. You can find more information about them here

Understanding the USB to TTL converter

You can read more about them here.

Understanding the ESP32 Development board with WiFi and Bluetooth

We will discuss here an Espressif Systems products. Our development board is using ESP-WROOM-32 module from Espressif Systems.

Espressif offers a wide range of fully-certified Wi-Fi & BT modules powered by their own advanced SoCs.

1. Dual-core Modules with Wi-Fi & Dual-mode Bluetooth

Features

  • Two independently-controlled CPU cores with adjustable clock frequency, ranging from 80 MHz to 240 MHz
  • +19.5 dBm output at the antenna ensures a good physical range
  • Classic Bluetooth for legacy connections, also supporting L2CAP, SDP, GAP, SMP, AVDTP, AVCTP, A2DP (SNK) and AVRCP (CT)
  • Support for Bluetooth Low Energy (BLE) profiles including L2CAP, GAP, GATT, SMP, and GATT-based profiles like BluFi, SPP-like, etc
  • Bluetooth Low Energy (BLE) connects to smart phones, broadcasting low-energy beacons for easy detection
  • Sleep current is less than 5 μA, making it suitable for battery-powered and wearable-electronics applications
  • Integrates 4 MB flash
  • Peripherals include capacitive touch sensors, Hall sensor, low-noise sense amplifiers, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C
  • Fully certified with integrated antenna and software stacks

2. Single-core Modules with Wi-Fi & Dual-mode Bluetooth

Features

  • High-performance 160 MHz single-core CPU
  • +19.5 dBm output at the antenna ensures a good physical range
  • Classic Bluetooth for legacy connections, also supporting L2CAP, SDP, GAP, SMP, AVDTP, AVCTP, A2DP (SNK) and AVRCP (CT)
  • Support for Bluetooth Low Energy (BLE) profiles including L2CAP, GAP, GATT, SMP, and GATT-based profiles like BluFi, SPP-like, etc
  • Bluetooth Low Energy (BLE) connects to smart phones, broadcasting low-energy beacons for easy detection
  • Sleep current is less than 5 μA, making it suitable for battery-powered and wearable-electronics applications
  • Peripherals include capacitive touch sensors, Hall sensor, low-noise sense amplifiers, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C
  • Fully certified with integrated antenna and software stacks

 

3. Single-core Modules with 802.11b/g/n 2.4 GHz Wi-Fi

Features

  • High-performance 160 MHz single-core CPU
  • +19.5 dBm output at the antenna ensures a good physical range
  • Sleep current is less than 20 μA, making it suitable for battery-powered and wearable-electronics applications
  • Peripherals include UART, GPIO, I2C, I2S, SDIO, PWM, ADC and SPI
  • Fully certified with integrated antenna and software stacks

There are different development Boards made by Espressif Systems and other manufacturers. We will publish some information about Espressif Systems boards but you can also find out more information about other development boards here.

1. 2.4 GHz Wi-Fi & BT/BLE Development Boards

Features

  • PC connectivity: USB
  • Power supply options: USB (by default), or 5V/GND header pins, or 3V3/GND header pins
  • SDK: ESP-IDF source code and example applications

2. 2.4 GHz Wi-Fi Development Boards

Features

 

  • PC connectivity: USB
  • SDK: ESP8266 SDK source code and example applications

 

3. 2.4 GHz Wi-Fi + BT/BLE + Sensor Development Boards

Features

  • PC connectivity: USB
  • SDK: ESP-IOT-SOLUTION source code and example applications

You can find more information (datasheets, schematics, pins descriptions, functional desgn descriptions) about each board by pressing Getting started link close to each board here.

ESP32 chip

ESP32 is a series of low cost, low power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. ESP32 is created and developed by Espressif Systems, a Shanghai-based Chinese company, and is manufactured by TSMC using their 40 nm process. It is a successor to the ESP8266 microcontroller.

ESP32 can perform as a complete standalone system or as a slave device to a host MCU, reducing communication stack overhead on the main application processor. ESP32 can interface with other systems to provide Wi-Fi and Bluetooth functionality through its SPI / SDIO or I2C / UART interfaces.

ESP32 is highly-integrated with in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. ESP32 adds priceless functionality and versatility to your applications with minimal Printed Circuit Board (PCB) requirements.

ESP32 is capable of functioning reliably in industrial environments, with an operating temperature ranging from –40°C to +125°C. Powered by advanced calibration circuitries, ESP32 can dynamically remove external circuit imperfections and adapt to changes in external conditions.

Engineered for mobile devices, wearable electronics and IoT applications, ESP32 achieves ultra-low power consumption with a combination of several types of proprietary software. ESP32 also includes state-of-the-art features, such as fine-grained clock gating, various power modes and dynamic power scaling.

Functional Block Diagram:

Features of the ESP32 include the following:

Processors:

  • CPU: Xtensa dual-core (or single-core) 32-bit LX6 microprocessor, operating at 160 or 240 MHz and performing at up to 600 DMIPS
  • Ultra low power (ULP) co-processor
  • Memory: 520 KiB SRAM

Wireless connectivity:

  • Wi-Fi: 802.11 b/g/n
  • Bluetooth: v4.2 BR/EDR and BLE

Peripheral interfaces:

  • 12-bit SAR ADC up to 18 channels
  • 2 × 8-bit DACs
  • 10 × touch sensors (capacitive sensing GPIOs)
  • Temperature sensor
  • 4 × SPI
  • 2 × I²S interfaces
  • 2 × I²C interfaces
  • 3 × UART
  • SD/SDIO/CE-ATA/MMC/eMMC host controller
  • SDIO/SPI slave controller
  • Ethernet MAC interface with dedicated DMA and IEEE 1588 Precision Time Protocol support
  • CAN bus 2.0
  • Infrared remote controller (TX/RX, up to 8 channels)
  • Motor PWM
  • LED PWM (up to 16 channels)
  • Hall effect sensor
  • Ultra low power analog pre-amplifier

Security:

  • IEEE 802.11 standard security features all supported, including WFA, WPA/WPA2 and WAPI
  • Secure boot
  • Flash encryption
  • 1024-bit OTP, up to 768-bit for customers
  • Cryptographic hardware acceleration: AES, SHA-2, RSA, elliptic curve cryptography (ECC), random number generator (RNG)

Power management:

  • Internal low-dropout regulator
  • Individual power domain for RTC
  • 5uA deep sleep current
  • Wake up from GPIO interrupt, timer, ADC measurements, capacitive touch sensor interrupt

You can find ESP32 chip datasheet here, hardware design here, technical reference manual here.

Signals and connections of the ESP32 Development board with WiFi and Bluetooth

You can find more information (datasheets, schematics, pins descriptions, functional desgn descriptions) about each board (made by Espresiff Systems) by pressing Getting started link close to each board here.

Let's check our development board - ESP32 DEVKITV1 with ESP-WROOM-32 module from Espressif Systems:

Pinout diagram for the ESP Wroom 32 breakout:

ESP32-WROOM-32 - ESP32-WROOM-32 module soldered to the development board. Optionally ESP32-WROOM-32D, ESP32-WROOM-32U or ESP32-SOLO-1 module may be soldered instead of the ESP32-WROOM-32.

USB-UART Bridge - A single chip USB-UART bridge provides up to 3 Mbps transfers rates.

BOOT button - Download button: holding down the Boot button and pressing the EN button initiates the firmware download mode. Then user can download firmware through the serial port.

EN button - Reset button: pressing this button resets the system.

Micro USB Port - USB interface. It functions as the power supply for the board and the communication interface between PC and the ESP module.

TX0, TX2 - transmit pin. GPIO pin

RX0, RX2  - receive pin.  GPIO pin

3V3 (or 3V or 3.3V) - power supply pin (3-3.6V). 

GND - ground pin.

EN - Chip enable. Keep it on high (3.3V) for normal operation.

Vin - External power supply 5VDC.

Wiring

1. Uploading AT firmware/Firmware upgrade

2. Using USB to TTL converter for AT communication


Step by Step instruction

1. Uploading AT firmware/Firmware upgrade

Before doing firmware update:

  • Follow the steps as described below. Check your module firmware version. Enter “AT+GMR” and press Send button.  
  • Always make sure that you have your firmware version on hands so you can restore previous version if next firmware version is bad.
  • Read all information about firmware update available on Web.
  • Just think if you realy need to do it as it is a risk to damage the module!!!
  • If you decided to do it make sure that the next firmware version which you are planing to upload is not older than existing.
  • You need to have MS Windows installed in order to get AT firmware flashed to your ESP32 development board.
  • You need to have USB to TTL.
  • Espressif AT firmware for ESP32 (You can always check for new versions here):

ESP32-WROOM-32

ESP32-WROOM-32 AT Bin V1.1.1 2018.07.11

ESP32-WROOM-32 AT Bin V1.1 2018.06.13

ESP32-WROOM-32 AT Bin V1.0 2017.11.17

ESP32-WROOM-32 AT Bin V0.10 2017.06.14

See Release notes for more details.

ESP32-WROVER

ESP32-WROVER AT Bin V1.1.1 2018.07.11

ESP32-WROVER AT Bin V1.1 2018.06.13

ESP32-WROVER AT Bin V0.10 2017.09.18

  1. Do wiring for uploading AT firmware/firmware update.
  2. Download Flash Download Tools (ESP8266 & ESP32) from espressif.com
    The ESP32 Flash Download Tool, just like the ESP8266 download tool, is the official Espressif Download tool that runs on Windows platform. The tool can be used to modify and generate init BINs, generate consolidated BIN files or program multiple chips for production runs.
    The tool uses COM port to send BIN files from PC to the ESP32, which then flashes the data to the primary flash chip.
    The ESP32 Flash Download Tool, just like the ESP8266 download tool, is the official Espressif Download tool that runs on Windows platform. The tool can be used to modify and generate init BINs, generate consolidated BIN files or program multiple chips for production runs.
    The tool uses COM port to send BIN files from PC to the ESP32, which then flashes the data to the primary flash chip.
  3. Download and unzip the latest AT firmware for your module (Check which module you have, for example we have ESP32-WROOM-32). We used this firmware here: ESP32-WROOM-32 AT Bin V1.1.1 2018.07.11
  4. Go to the folder ESP32-WROOM-32_AT_V1.1.1 and find file named download.config
  5. You can open it with Notepad program. This file has configuration for ESP32 download tool: --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader/bootloader.bin 0x20000 at_customize.bin 0x21000 customized_partitions/ble_data.bin 0x24000 customized_partitions/server_cert.bin 0x26000 customized_partitions/server_key.bin 0x28000 customized_partitions/server_ca.bin 0x2a000 customized_partitions/client_cert.bin 0x2c000 customized_partitions/client_key.bin 0x2e000 customized_partitions/client_ca.bin 0xf000 phy_init_data.bin 0x100000 esp-at.bin 0x8000 partitions_at.bin.
  6. You will need to upload 9 files to your ESP32 development board: 0x1000 bootloader/bootloader.bin 0x20000 at_customize.bin 0x21000 customized_partitions/ble_data.bin 0x24000 customized_partitions/server_cert.bin 0x26000 customized_partitions/server_key.bin 0x28000 customized_partitions/server_ca.bin 0xf000 phy_init_data.bin 0x100000 esp-at.bin 0x8000 partitions_at.bin
  7. Unzip, open FLASH_DOWNLOAD_TOOLS_V3.6.4 folder and double-click on ESPFlashDownloadTool_v3.6.4.exe
  8. Click on ESP32 DownloadTool button. Select SPIDownload tab. Set configuration as shown below:
  9. Select COM port (port ESP32 attached to) and baud rate 115200.
  10. Click on Start button. You will see the status SYNC.
  11. Press and hold Boot button on your ESP32 develpment board until you see that status changed to Download and the bar below starts to show the process of uploading. 
  12. Wait till you see that status changed to Finish.
  13. Click on STOP button. You can disconnect your ESP32 development board from PC.

2. Using USB to TTL converter for AT communication with ESP32 dev board

AT commands will not work with USB A / micro USB B cable. When you press EN button on ESP development board you will reset it and get the status only, no AT commands will work:

To communicate (use AT commands) with ESP32 development board you need USB to TTL converter. 

For using this USB to UART Converter you need a software tool. You can use different software tools: TerminalUSR-TCP232-Test V1.4AiThinker_Serial_Tool_V1.2.3cooltermsscom3.2 , KiTTYputty,tera termAccess port and so on. We recommend you to use AiThinker_Serial_Tool_V1.2.3 or sscom3.2, as you can save your AT commands and it's very easy to use.

  1. Do wiring for using USB to TTL converter for AT communication.
  2. Plug your USB to TTL converter into your PC USB port. Download and install drivers. See more info here.
  3. Download and install software tool. We will use AiThinker_Serial_Tool_V1.2.3 here.
  4. Set the baud rate 115200, data bits 8, parity bits none,stop bits one.
  5. Click on Open Serial button.
  6. First you need to check if AT commands are working - enter “AT” and press  Send button.This would print "OK" which signifies of working connection and operation of the module.
  7. Requests TA revision identification. Enter "AT+GMR" and press Send button.
  8. For other AT commands see list here.

Summary

We have learnt how to upload AT firmware to ESP32 development board and use it.

Library

 

  • No library required for this project

 

Sketch

  • None


Other projects of Acoptex.com
Easy Basics: Project 086d ESP-12E module, BME280 sensor - Web server of Acoptex.com in ESP8266 ESP-12 18-07-2019

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 08-05-2018
Viewed: 2736 times