Hello. A few days ago I got a copy of the ESP32 Demo Board V2, which I immediately happily announced at my FB. Of course, it’s not very easy to get it now: the first batch (600 pieces), which went on sale at Seeed Studio, was scattered in a matter of hours!

But as a developer and hardware integrator of the
Open-Source library for Blynk, I often get early access to various devices. Blynk allows you to quickly prototype and build iOS / Android Apps for the Internet of Things using drag'n'drop blocks right on your phone.
The fee, which fell into my hands, looks like this:
')
ESP32 promises to make a revolution in the IoT world again , as its younger brother ESP8266 did in due time (and I sincerely hope that it will be so). If you have not heard anything about ESP8266 before - read, for example,
here and
here (and Google).
What is the new ESP32? Even at first glance, it is clear that this is a very powerful platform. For example, Ivan Grokhotkov (developer of Arduino support for ESP8266) published a photo of the game DOOM on ESP32:
ESP32 specifications
CPU: Xtensa Dual-Core 32-bit LX6, 160 MHz or 240 MHz (up to 600 DMIPS)
Memory: 520 KByte SRAM, 448 KByte ROM
Flash on the module: 1, 2, 4 ... 64 MB
Wireless:- Wi-Fi: 802.11b / g / n / e / i, up to 150 Mbps with HT40
- Bluetooth: v4.2 BR / EDR and BLE
Peripheral interfaces:- 12-bit SAR ADC up to 18 channels
- 2 × 8-bit DAC
- 10 × touch sensors
- Temperature sensor
- 4 × SPI
- 2 × I²S
- 2 × I²C
- 3 × UART
- 1 host (SD / eMMC / SDIO)
- 1 slave (SDIO / SPI)
- Ethernet MAC with DMA and IEEE 1588 support
- CAN 2.0
- IR (TX / RX)
- Motor pwm
- LED PWM up to 16 channels
- Hall sensor
- Ultra low power analog pre-amplifier
Security:- IEEE 802.11 security WFA, WPA / WPA2 and WAPI
- Secure boot
- Flash encryption
- 1024-bit OTP, including up to 768-bit per task
- Cryptographic engine: AES, SHA-2, RSA, ECC, RNG
In the picture it looks like this:
More detailed (and almost complete) information is
on off. Espressif Systems website . ESP32 will be available (at least) in several forms:
»
ESP-WROOM-32 module ($ 5?)
Pinout |
Datasheet»
Module AI-Thinker ESP3212 , similar to the ESP-12F ($ 6.9). On the ESP3212 no legs for SD-card, in contrast to the WROOM-32.

Eagle Library |
KiCAD LibraryChip ESP32-D0WDQ6 ($ 2.8?) |
Datasheet
- D : Dual-core
- 0 : No internal flash
- W : Wi-Fi
- D : Dual-mode Bluetooth
- Q : Quad Flat No-leads (QFN) package
- 6 : 6 mm × 6 mm package body size
It is worth noting that before the ESP32 release, the ESP31B (test version) was available as an Espressif ESP-WROOM-03 module, and on the Internet it is often confused with ESP32.
Caution! Almost all references to ESP32 until 09.2016 is actually about ESP31B, which is not the same at all.
Setting up the development environment
On the offsite now you can find links to two SDKs:
»
ESP31_RTOS_SDK - SDK for ESP31B, built on FreeRTOS.
»
Espressif IDF (IoT Development Framework) - Official development framework for ESP32.
Although it is not obvious from the description on the site,
only ESP-IDF is suitable for the release version. There are installation instructions for
linux ,
windows ,
macos .
I have 64-bit Ubuntu Linux. First downloaded the compiler:
sudo mkdir /opt/Espressif sudo chmod a+rw /opt/Espressif cd /opt/Espressif wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-59.tar.gz tar -xzf xtensa-esp32-elf-linux64-1.22.0-59.tar.gz
The
xtensa-esp32-elf
folder should appear. Then I downloaded esp-idf (in the same
/opt/Espressif
folder):
git clone --recursive https://github.com/espressif/esp-idf.git
A folder
esp-idf
should appear.
Writing Hello World
Espressif has prepared a template for us, so it's very easy to start:
cd ~ git clone https://github.com/espressif/esp-idf-template.git myapp cd myapp
You can try to run a pure template, but it seemed uninteresting to me. I added a little
main/app_main.c
to flash the LED. That's what happened.
main / app_main.c #include <stdio.h> #include "rom/gpio.h" #include "esp_system.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #define LED_PIN 18 #define LOG(msg, ...) printf("[%u] " msg "\n", system_get_time(), ##__VA_ARGS__) void pingTask(void *pvParameters) { while (1) { GPIO_OUTPUT_SET(LED_PIN, 0); LOG("low"); vTaskDelay(1000 / portTICK_PERIOD_MS); GPIO_OUTPUT_SET(LED_PIN, 1); LOG("high"); vTaskDelay(1000 / portTICK_PERIOD_MS); } } void app_main() { xTaskCreatePinnedToCore(&pingTask, "pingTask", 2048, NULL, 5, NULL, 0); }
We collect and fill the board
To build a project, you first need to configure the environment
cd ~/myapp export PATH=/opt/Espressif/xtensa-esp32-elf/bin:$PATH export IDF_PATH=/opt/Espressif/esp-idf
Now we connect the board, turn on the power, and look at which port it appeared (I have this / dev / ttyUSB3). Run the configurator:
make menuconfig
You need to go to the "Serial flasher config" and install the "Default serial port" on the port of the board. You can still see other settings.
All save and exit.
Compile:
make
If everything is good, fill in the fee:
make flash
It should display something like ... Flashing project app to 0x10000... esptool.py v2.0-dev Connecting... Changing baud rate to 921600 Changed. ******************************** IS HSPI: 0x00000000 <type 'int'> -------------------------- IS LEGACY: 0x00 <type 'int'> ********************************* SENDING SPI ATTACH COMMAND -------------- SEND ESP SPI ATTACH CMD START DOWNLOADING... Erasing flash... Unc size 6656 comp size 3900 comp blocks 4 Took 0.09s to erase flash block Wrote 3900 bytes at 0x00001000 in 0.2 seconds (194.1 kbit/s)... Hash of data verified. Erasing flash... Unc size 378208 comp size 210815 comp blocks 206 Took 1.99s to erase flash block Wrote 210815 bytes at 0x00010000 in 4.6 seconds (366.2 kbit/s)... Hash of data verified. Erasing flash... Unc size 96 comp size 57 comp blocks 1 Took 0.04s to erase flash block Wrote 57 bytes at 0x00004000 in 0.1 seconds (5.0 kbit/s)... Hash of data verified. Leaving...
Connect to the board using Putty (screen, or another terminal emulator). We distort the power, and see:
Initial initialization ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:QIO, clock div:2 load:0x3ffc0000,len:0 load:0x3ffc0000,len:2268 load:0x40078000,len:3788 load:0x40098000,len:532 entry 0x4009813c ************************************** * hello espressif ESP32! * * 2nd boot is running! * * version (V0.1) * ************************************** compile time 18:10:20 SPI Speed : 40MHz SPI Mode : QIO SPI Flash Size : 4MB Partition Table: ## Label Usage Type ST Offset Length 0 factory factory app 00 00 00010000 00100000 1 rfdata RF data 01 01 00110000 00040000 2 wifidata WiFi data 01 02 00150000 00040000 End of partition table Loading app partition at offset 00010000 section 0: paddr=0x00000020 vaddr=0x00000000 size=0x0ffe8 ( 65512) section 1: paddr=0x00010010 vaddr=0x3f400010 size=0x086fc ( 34556) map section 2: paddr=0x00018714 vaddr=0x3ffba950 size=0x01248 ( 4680) load section 3: paddr=0x00019964 vaddr=0x40080000 size=0x00400 ( 1024) load section 4: paddr=0x00019d6c vaddr=0x40080400 size=0x1326c ( 78444) load section 5: paddr=0x0002cfe0 vaddr=0x00000000 size=0x03030 ( 12336) section 6: paddr=0x00030018 vaddr=0x400d0018 size=0x2c540 (181568) map start: 0x4008078c Initializing heap allocator: Region 19: 3FFBBB98 len 00024468 tag 0 Region 25: 3FFE8000 len 00018000 tag 1 Pro cpu up. Pro cpu start user code nvs_flash_init misc_nvs_load g_misc_nvs=0x3ffbbd04 frc2_timer_task_hdl:3ffbc880, prio:22, stack:2048 tcpip_task_hdlxxx : 3ffbe62c, prio:20,stack:2048 phy_version: 80, Aug 26 2016, 13:04:06, 0 pp_task_hdl : 3ffc3360, prio:23, stack:8192
[213450] low [1212827] high [2212827] low [3212828] high [4212828] low
If you connect the LED to the
IO18
, it also flashes. So our code works!
Debugging
Another good news is that ESP32 has a JTAG interface on
IO12, IO13, IO14, IO15
. I will try to use it for debugging programs. But about this in the next article.
Well, it remains only to wait for the availability of ESP32 in stores, stabilization of the SDK (I hope it will initially be much more stable than ESP8266). Bluetooth is also not available yet. Soon (according to my data, very soon), beta support for the Arduino IDE and
MicroPython should appear, then
Espruino and something similar to NodeMCU.
What do you think?