Generic ESP32-WROOM-32 boards

Support for generic ESP32-WROOM-32 boards.

Overview [TOC]

This board definition covers not just a single board, but rather a large set of generic boards that use an ESP32-WROOM-32 module and simply break out all GPIOs to external pads without having any special hardware or interfaces on-board. Examples are Espressif’s ESP32-DevKitC or NodeMCU-ESP32S and a large number of clones.

Hardware [TOC]

This section describes

MCU [TOC]

Most features of ESP32 boards are provided by the ESP32 SoC. The following table summarizes these features and gives an overview of which of these features are supported by RIOT. For detailed information about the ESP32, see section .

MCU ESP32 Supported by RIOT
Vendor Espressif
Cores 1 or 2 x Tensilica Xtensa LX6 1 core
FPU yes (ULP - Ultra low power co-processor) no
RAM 520 kByte SRAM 16 kByte RTC SRAM yes
ROM 520 kByte yes
Flash 512 kByte … 16 MByte yes
Frequency 240 MHz, 160 MHz, 80 MHz yes
Power Consumption 68 mA @ 240 MHz 44 mA @ 160 MHz 31 mA @ 80 MHz 5 uA in deep sleep mode yes yes yes no
Timers 4 x 64 bit yes
ADCs 2 x SAR-ADC with up to 18 x 12 bit channels total yes
DACs 2 x DAC with 8 bit yes
GPIOs 34 (6 of them are only inputs) yes
I2Cs 2 yes
SPIs 4 yes
UARTs 3 yes
WiFi IEEE 802.11 b/g/n built in yes
Bluetooth v4.2 BR/EDR and BLE no
Ethernet MAC interface with dedicated DMA and IEEE 1588 support yes
CAN version 2.0 no
IR up to 8 channels TX/RX no
Motor PWM 2 devices x 6 channels yes
LED PWM 16 channels no
Crypto Hardware acceleration of AES, SHA-2, RSA, ECC, RNG no
Vcc 2.5 - 3.6 V
Documents Datasheet Technical Reference

Board Configuration [TOC]

Generic ESP32-WROOM-32 boards do not have special hardware on board and all GPIOs are simply broken out for flexibility. Therefore, the board configuration is the most flexible one with provides:

18 x ADC channels at maximum 2 x DAC channels at maximum 2 x SPI at maximum 1 x I2C at maximum 2 x UART

Since all GPIOs have broken out, GPIOs can be used for different purposes in different applications. For flexibility, GPIOs can be listed in various peripheral configurations. For example, GPIO13 is used in the ADC channel definition and the definition of the MOSI signal of spi.h::SPI_DEV.

This is possible because GPIOs are only used for a specific peripheral interface when

  • the corresponding peripheral module is used, eg. periph_i2c, or
  • a corresponding init function is called z. adc_init, dac_init and pwm_init or
  • The corresponding peripheral interface is used for the first time, eg. spi_aqcuire.

That is, the purpose for which a GPIO is used depends on which module or function is used first.

For example, if module periph_i2c is not used, the GPIOs listed in I2C configuration can be used for the other purposes.

The following table shows the default board configuration, which is sorted according to the defined functionality of GPIOs. This configuration can be overridden by .

Function GPIOs Remarks Configuration
BUTTON0 GPIO0
ADC GPIO0, GPIO2, GPIO4, GPIO12, GPIO13, GPIO14, GPIO15, GPIO25, GPIO26, GPIO27, GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO39 see
DAC GPIO25, GPIO26
pwm.h::PWM_DEV GPIO0, GPIO2, GPIO4, GPIO16, GPIO17 -
pwm.h::PWM_DEV GPIO27, GPIO32, GPIO33 -
i2c.h::I2C_DEV:SDA GPIO21
i2c.h::I2C_DEV:SCL GPIO22
spi.h::SPI_DEV:CLK GPIO18 VSPI is used
spi.h::SPI_DEV:MISO GPIO19 VSPI is used
spi.h::SPI_DEV:MOSI GPIO23 VSPI is used
spi.h::SPI_DEV:CS0 GPIO5 VSPI is used
spi.h::SPI_DEV:CLK GPIO14 HSPI is used
spi.h::SPI_DEV:MISO GPIO12 HSPI is used
spi.h::SPI_DEV:MOSI GPIO13 HSPI is used
spi.h::SPI_DEV:CS0 GPIO15 HSPI is used
uart.h::UART_DEV:TxD GPIO1 Console (configuration is fixed)
uart.h::UART_DEV:RxD GPIO3 Console (configuration is fixed)
uart.h::UART_DEV:TxD GPIO10 not available in qout and qio flash mode
uart.h::UART_DEV:RxD GPIO9 not available in qout and qio flash mode

Note

  • The configuration of ADC channels contains all ESP32 GPIOs that can be used as ADC channels.
  • The configuration of DAC channels contains all ESP32 GPIOs that can be used as DAC channels.
  • GPIO9 and GIOP10 can only be used in dout and dio .

For detailed information about the configuration of ESP32 boards, see section .

Optional Hardware Configurations [TOC]

MRF24J40-based IEEE 802.15.4 radio modules and ENC28J60-based Ethernet network interface modules have been tested with the board. You could use the following code in your to use such modules:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#ifdef BOARD_ESP32_WROOM-32

#if MODULE_MRF24J40
#define MRF24J40_PARAM_CS       GPIO16      /* MRF24J40 CS signal    */
#define MRF24J40_PARAM_RESET    GPIO17      /* MRF24J40 RESET signal */
#define MRF24J40_PARAM_INT      GPIO34      /* MRF24J40 INT signal   */
#endif

#if MODULE_ENC28J80
#define ENC28J80_PARAM_CS       GPIO32      /* ENC28J80 CS signal    */
#define ENC28J80_PARAM_RESET    GPIO33      /* ENC28J80 RESET signal */
#define ENC28J80_PARAM_INT      GPIO35      /* ENC28J80 INT signal   */
endif

#endif
For other parameters, the default values defined by the drivers can be used.

Note

The RESET signal of MRF24J40 and ENC28J60 based modules can also be connected to the RST pin of the board (see ) to keep the configured GPIO free for other purposes.

Board Pinout [TOC]

The following figure shows the pinout of the defined default configuration for the EPS32-DevKitC board as an example of generic ESP32-WROOM-32 boards. The light green GPIOs are not used by configured on-board hardware components and can be used for any purpose. However, if optional off-board hardware modules are used, these GPIOs may also be occupied, see in table board configuration.

The corresponding board schematics can be found her here

MCU [TOC]

Most features of ESP32 boards are provided by the ESP32 SoC. The following table summarizes these features and gives an overview of which of these features are supported by RIOT. For detailed information about the ESP32, see section .

MCU ESP32 Supported by RIOT
Vendor Espressif
Cores 1 or 2 x Tensilica Xtensa LX6 1 core
FPU yes (ULP - Ultra low power co-processor) no
RAM 520 kByte SRAM 16 kByte RTC SRAM yes
ROM 520 kByte yes
Flash 512 kByte … 16 MByte yes
Frequency 240 MHz, 160 MHz, 80 MHz yes
Power Consumption 68 mA @ 240 MHz 44 mA @ 160 MHz 31 mA @ 80 MHz 5 uA in deep sleep mode yes yes yes no
Timers 4 x 64 bit yes
ADCs 2 x SAR-ADC with up to 18 x 12 bit channels total yes
DACs 2 x DAC with 8 bit yes
GPIOs 34 (6 of them are only inputs) yes
I2Cs 2 yes
SPIs 4 yes
UARTs 3 yes
WiFi IEEE 802.11 b/g/n built in yes
Bluetooth v4.2 BR/EDR and BLE no
Ethernet MAC interface with dedicated DMA and IEEE 1588 support yes
CAN version 2.0 no
IR up to 8 channels TX/RX no
Motor PWM 2 devices x 6 channels yes
LED PWM 16 channels no
Crypto Hardware acceleration of AES, SHA-2, RSA, ECC, RNG no
Vcc 2.5 - 3.6 V
Documents Datasheet Technical Reference

Board Configuration [TOC]

Generic ESP32-WROOM-32 boards do not have special hardware on board and all GPIOs are simply broken out for flexibility. Therefore, the board configuration is the most flexible one with provides:

18 x ADC channels at maximum 2 x DAC channels at maximum 2 x SPI at maximum 1 x I2C at maximum 2 x UART

Since all GPIOs have broken out, GPIOs can be used for different purposes in different applications. For flexibility, GPIOs can be listed in various peripheral configurations. For example, GPIO13 is used in the ADC channel definition and the definition of the MOSI signal of spi.h::SPI_DEV.

This is possible because GPIOs are only used for a specific peripheral interface when

  • the corresponding peripheral module is used, eg. periph_i2c, or
  • a corresponding init function is called z. adc_init, dac_init and pwm_init or
  • The corresponding peripheral interface is used for the first time, eg. spi_aqcuire.

That is, the purpose for which a GPIO is used depends on which module or function is used first.

For example, if module periph_i2c is not used, the GPIOs listed in I2C configuration can be used for the other purposes.

The following table shows the default board configuration, which is sorted according to the defined functionality of GPIOs. This configuration can be overridden by .

Function GPIOs Remarks Configuration
BUTTON0 GPIO0
ADC GPIO0, GPIO2, GPIO4, GPIO12, GPIO13, GPIO14, GPIO15, GPIO25, GPIO26, GPIO27, GPIO32, GPIO33, GPIO34, GPIO35, GPIO36, GPIO39 see
DAC GPIO25, GPIO26
pwm.h::PWM_DEV GPIO0, GPIO2, GPIO4, GPIO16, GPIO17 -
pwm.h::PWM_DEV GPIO27, GPIO32, GPIO33 -
i2c.h::I2C_DEV:SDA GPIO21
i2c.h::I2C_DEV:SCL GPIO22
spi.h::SPI_DEV:CLK GPIO18 VSPI is used
spi.h::SPI_DEV:MISO GPIO19 VSPI is used
spi.h::SPI_DEV:MOSI GPIO23 VSPI is used
spi.h::SPI_DEV:CS0 GPIO5 VSPI is used
spi.h::SPI_DEV:CLK GPIO14 HSPI is used
spi.h::SPI_DEV:MISO GPIO12 HSPI is used
spi.h::SPI_DEV:MOSI GPIO13 HSPI is used
spi.h::SPI_DEV:CS0 GPIO15 HSPI is used
uart.h::UART_DEV:TxD GPIO1 Console (configuration is fixed)
uart.h::UART_DEV:RxD GPIO3 Console (configuration is fixed)
uart.h::UART_DEV:TxD GPIO10 not available in qout and qio flash mode
uart.h::UART_DEV:RxD GPIO9 not available in qout and qio flash mode

Note

  • The configuration of ADC channels contains all ESP32 GPIOs that can be used as ADC channels.
  • The configuration of DAC channels contains all ESP32 GPIOs that can be used as DAC channels.
  • GPIO9 and GIOP10 can only be used in dout and dio .

For detailed information about the configuration of ESP32 boards, see section .

Optional Hardware Configurations [TOC]

MRF24J40-based IEEE 802.15.4 radio modules and ENC28J60-based Ethernet network interface modules have been tested with the board. You could use the following code in your to use such modules:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#ifdef BOARD_ESP32_WROOM-32

#if MODULE_MRF24J40
#define MRF24J40_PARAM_CS       GPIO16      /* MRF24J40 CS signal    */
#define MRF24J40_PARAM_RESET    GPIO17      /* MRF24J40 RESET signal */
#define MRF24J40_PARAM_INT      GPIO34      /* MRF24J40 INT signal   */
#endif

#if MODULE_ENC28J80
#define ENC28J80_PARAM_CS       GPIO32      /* ENC28J80 CS signal    */
#define ENC28J80_PARAM_RESET    GPIO33      /* ENC28J80 RESET signal */
#define ENC28J80_PARAM_INT      GPIO35      /* ENC28J80 INT signal   */
endif

#endif
For other parameters, the default values defined by the drivers can be used.

Note

The RESET signal of MRF24J40 and ENC28J60 based modules can also be connected to the RST pin of the board (see ) to keep the configured GPIO free for other purposes.

Board Pinout [TOC]

The following figure shows the pinout of the defined default configuration for the EPS32-DevKitC board as an example of generic ESP32-WROOM-32 boards. The light green GPIOs are not used by configured on-board hardware components and can be used for any purpose. However, if optional off-board hardware modules are used, these GPIOs may also be occupied, see in table board configuration.

The corresponding board schematics can be found her here

Flashing the Device [TOC]

Flashing RIOT is quite easy. The board has a Micro-USB connector with reset/boot/flash logic. Just connect the board to your host computer and type using the programming port:

1
make flash BOARD=esp32-wroom-32 ...
For detailed information about ESP32 as well as configuring and compiling RIOT for ESP32 boards, see .