Skip to content

ESP32

ESP32

ESP32 processor comes with large set of features already integrated in Arduino framework. Many useful things like wireless connectivity, advanced GPIO control and file systems can be used right away without additional libraries. All of it can be found in official ESP32 Arduino documentation and examples.

Software

RoboBoard Arduino software is based on official ESP32 support to maintain compatibility with third-party libraries and tutorials. All standard functionality is available in addition with Totem RoboBoard functions. For more details read API section.

FreeRTOS

ESP32 software is integrated with FreeRTOS (Real-time operating system for microcontrollers) allowing to utilize both cores and use multithreading features. Processes can be split into asynchronous tasks and controlled with mutex, timers, queues and other operating system utilities.
Default task allocation:
Core 0 - WiFi, Bluetooth, TotemApp, motor driving, other background tasks.
Core 1 - Arduino sketch (setup(), loop()), events.

ESP32 FreeRTOS documentation | examples

Storage

ESP32 contains a total of 8MB flash memory. It is split into separate partitions for whole system to function. Exact partition table can be found in file default_8MB.csv.

  • nvs (20KB) - storage for Board.settingsSave() and Preferences library.
  • otadata (8KB) - holds current state of app partitions.
  • app0 - (3.3MB) - holds Arduino sketch code.
  • app1 - (3.3MB) - second Arduino sketch bank. Loaded during OTA update.
  • spiffs - (1.5MB) - file system (storage) for holding large data and files.
    Files can be created and handled using FS.h and SPIFFS.h.
  • coredump - (65KB) - stores core dumps during system crash.

Note: while total amount of flash is 8MB - only 3.3MB can be used for single Arduino sketch. To overcome this limit - different partition table should be selected.

Examples:

Preferences

Library used for storing user settings in flash memory. Will be preserved during power off.

Preferences documentation | examples

Radio

Wi-Fi

ESP32 has integrated Wi-Fi capability. May be used to connect home network and access the Internet. From there possibilities are endless.

Wi-Fi documentation | examples:

ESP-NOW

A communication protocol developed by Espressif. Alternative to Wi-Fi and Bluetooth solutions. Based on 2.4 Ghz frequency, allows for long distance communication and compatible with legacy ESP8266 chips.

ESP-NOW documentation | examples

Bluetooth (classic)

Older Bluetooth (classic) standard used for multiple purposes like audio headset (A2DP), Serial Port Profile (SPP) and other.
In Arduino environment mostly used with BluetoothSerial.h functionality to connect with PC over Bluetooth virtual serial port. Allows printing to Serial Monitor without USB connected.

BluetoothSerial documentation | examples

Bluetooth Low Energy

Bluetooth standard introduced in Bluetooth 4.0 specification. Consumes less power, but works differently compared to old standard. Mainly used to connect with smartphones (Totem App.

Custom Bluetooth services and implementations can be also created. See information below.

BLE documentation | examples | Simple BLE library

Hardware

Reset Reason

Read processor restart reason upon power on. There are multiple situation how this could happen. Mainly used for detecting unexpected faults.

Reset Reason documentation | example

Deep Sleep

Put processor into deep sleep state to turn it off and use only a fraction of power. It will boot up (wake) after specified time (other conditions are also possible). Mainly used with power saving applications.

ESP.deepSleep(time)

Parameter:
time - wake up time in microseconds (μs).

Deep Sleep documentation | examples

Timer

ESP32 contains 4, 64-bit hardware timers to perform precise timing operations.
Used as configurable counter or alarm interrupts at specified time.

Timer documentation | examples | Ticker library