ESP32 Arduino

ESP32 Thing Hookup Guide

2 x Cores

Andreas Spiess – #168 ESP32 Dual Core on Arduino IDE including Data Passing and Task Synchronization


Arduino Core

#define FSPI  1 //SPI bus attached to the flash (can use the same data lines but different SS)
#define HSPI  2 //SPI bus normally mapped to pins 12 - 15, but can be matrixed to any pins
#define VSPI  3 //SPI bus normally attached to pins 5, 18, 19 and 23, but can be matrixed to any pins


Arduino Libraries




Getting Started with ESP32 and PlatformIO

Build Panel

Platformio IDE atom – is there a way to display console as tab instead as notification
PlatformIO IDE for Atom: Keep build panel visible


Project Configuration File platformio.ini
Section [platformio]
Section [env:NAME]

Include Arduino Libraries

Including Arduino libraries together with private libraries

Platform Versions

packages/framework-arduinoavr/platform.txt            version=1.6.19
packages/framework-arduinoespressif32/platform.txt    version=0.0.1


  "framework-arduinoespressif32": [
      "sha1": "553fe9ef85dbcff8c0f9ecbc4ada3901a723e91c", 
      "system": "*", 
      "url": "", 
      "version": "1.1.5"
      "sha1": "27df506d863696ef51caf4cbb08e3470abf01f17", 
      "system": "*", 
      "url": "", 
      "version": "1.2.0"
      "sha1": "a36e2dc833f2a6152b341b2dd9f54d4335a8ba0e", 
      "system": "*", 
      "url": "", 
      "version": "1.3.2"
  "frameworks": {
    "arduino": {
      "package": "framework-arduinoespressif32",
      "script": "builder/frameworks/"
    "espidf": {
      "package": "framework-espidf",
      "script": "builder/frameworks/"
    "simba": {
      "package": "framework-simba",
      "script": "builder/frameworks/"
    "pumbaa": {
      "package": "framework-pumbaa",
      "script": "builder/frameworks/"
  "packages": {
    "toolchain-xtensa32": {
      "type": "toolchain",
      "version": "~1.50200.0"
    "framework-arduinoespressif32": {
      "type": "framework",
      "optional": true,
      "version": "~1.2.0"
    "framework-espidf": {
      "type": "framework",
      "optional": true,
      "version": "~2.210.0"
  "packages": {
    "toolchain-atmelavr": {
      "type": "toolchain",
      "version": "~1.40902.0"
    "framework-arduinoavr": {
      "type": "framework",
      "optional": true,
      "version": "~1.10619.0"


Peripheral to Pin Re-Mapping

MCU pin setup, Visual pin layout setup tool for development boards
with an editor mode for community involvement
ESP 32 Pin re-mapping
ESP32 (9) – Basic I/O


$ cd /c/Users/bachman0/.platformio/packages/framework-arduinoespressif32

$ grep -r esp_bluedroid_init .
./libraries/SimpleBLE/src/SimpleBLE.cpp:        if (esp_bluedroid_init()) {
./libraries/SimpleBLE/src/SimpleBLE.cpp:            log_e("esp_bluedroid_init failed");
./tools/sdk/include/bluedroid/esp_bt_main.h:  * @brief     Enable bluetooth, must after esp_bluedroid_init()
./tools/sdk/include/bluedroid/esp_bt_main.h:  esp_err_t esp_bluedroid_init(void);
./tools/sdk/lib/libbt.a:                      (BINARY)


IR Thermometer

Adafruit-MLX90614-Library: Arduino library for the MLX90614 sensors
SparkFun MLX90614 Arduino Library
MLX90614 IR Thermometer Driver Library for Arduino (only for Arduino UNO)
Library for the Melexis Digital IR Thermometer Type MLX90614 (variants)
MLX90615 – A minimal Arduino library for Melexis MLX90615 Infra-red Temperature Sensor
Library for the MLX90615


Partition Table

Looking To The IoT Future With PlatformIO And ESP32

Name Type Subtype Offset Size Flags
bootloader     0x001000    
partition table     0x008000    
nvs data nvs 0x009000 20K  
otadata data ota 0x00e000 8K  
app0 app ota_0 0x010000 1280K  
app1 app ota_1 0x150000 1280K  
eeprom data 153 0x290000 4K  
spiffs data spiffs 0x291000 1468K  
$ pio run -v --target upload

$ /c/Users/bachman0/.platformio/packages/framework-espidf/components/partition_table/ --verify partitions.bin partitions.csv
$ --verify partitions.bin partitions.csv
Parsing binary partition input...

$ "c:\users\bachman0\.platformio\penv\scripts\python.exe" \
  "C:\Users\bachman0\.platformio\packages\framework-arduinoespressif32\tools\" \
  --before default_reset
  --after hard_reset
  --chip esp32
  --port "COM21"
  --before default_reset
  --after hard_reset
  --baud 115200
  --flash_mode dio
  --flash_freq 80m
  --flash_size detect
  0x1000 "C:\Users\bachman0\.platformio\packages\framework-arduinoespressif32\tools\sdk\bin\bootloader.bin"
  0x8000 "C:\Users\bachman0\Documents\PlatformIO\Projects\lolin32-arduino-PA17_bmat_6\.pioenvs\lolin32\partitions.bin"
  0xe000 "C:\Users\bachman0\.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin"
  0x10000 .pioenvs\lolin32\firmware.bin


SPIFFS, DEPRECATED, Arduino plugin for uploading files to ESP32 file system, Tool to build and unpack SPIFFS images
How to `git clone` including submodules?

Store and read some static files using SPIFFS

$ git clone --recursive git://
$ cd bar

$ git clone git://
$ cd bar
$ git submodule update --init --recursive

 -d <0-5>,     --debug <0-5>      Debug level. 0 means no debug output.
 -b <number>,  --block <number>   fs block size, in bytes
 -p <number>,  --page <number>    fs page size, in bytes
 -s <number>,  --size <number>    fs image size, in bytes

#define CONFIG_SPIFFS_BASE_ADDR 0x291000
#define CONFIG_SPIFFS_SIZE 1478656

$  ./mkspiffs \
  -c jquery \
  -b 8192 \
  -p 256 \
  -s 1478656 \

$ \
  --chip esp32 \
  --port "COM21" \
  --baud 115200 \
  write_flash \
  -z \
  --flash_mode "dio" \
  --flash_freq "80m" \
  --flash_size detect \
  0x291000 spiffs.img


Interactive Shell / Interpreter





Digital Potentiometer

MCP45HVX1, Library for MCP45HVX1 digital potentiomters, Arduino Library for MCP45HVX1 digital potentiometers. Includes TCON register and incremental control.

Leave a Reply

Your email address will not be published. Required fields are marked *