Skip to content

STM32-ESP8266

In the previous section, we directly used the serial port to communicate with the ESP8266 module and tested the AT command. In this section, we will use STM32 to control the ESP8266 module to achieve more functions.

Driver Reference

HANDS-ON

HARDWARE SETUP

Follow the table below to connect the ESP8266 module to the MCU.

ESP8266 PIN MCU PIN
VCC 3.3V (or external VCC)
GND GND (or external GND)
RX PA2
TX PA3

SETUP

SOFTWARE SETUP

CUBEMX configuration:

  1. Enable the USART2 peripheral, keep default settings.

USART2

  1. Enable NVIC configuration for USART2.

USART2-NVIC

  1. Enable DMA for USART2 RX.

USART2-DMA

DRIVER TRANSPLANTATION

Refer to the links above for driver transplantation.