STM32 WiFi Guide: Add WiFi to Your STM32 Projects

In this tutorial, we’ll discuss STM32 WiFi and every practical way to connect an STM32 microcontroller to a WiFi network. You’ll learn why STM32 microcontrollers don’t have WiFi built in, the four architectures you can choose from, and how the WiFi modules used with STM32 (ESP32-C3, ESP-01 / ESP8266, ST’s new ST67W611M1, WizFi360, and others) compare to each other.

Then, we’ll get an STM32 Blue Pill online with an ESP32-C3 WiFi co-processor and a few AT commands, and we’ll measure how the ESP32-C3 and the ESP8266 compare on the bench. This is the first part of our STM32 WiFi tutorial series, where we’ll build HTTP clients, a web server, MQTT, WebSocket, and OTA updates on top of it. Without further ado, let’s get right into it!

STM32 WiFi Tutorial Series: Part 1 of 8
1 STM32 WiFi2 STM32 ESP82663 STM32 ESP32-C34 HTTP Client5 Web Server6 MQTT7 OTA Update8 WebSocket

Does STM32 Have WiFi?

No STM32 microcontroller has WiFi built in. To add WiFi to an STM32, you connect a WiFi module (a co-processor) that runs the radio and, in most cases, the whole TCP/IP stack too. The STM32 talks to it over UART, SPI, or SDIO. For most projects (and for this tutorial series), the simplest option is an ESP32-C3 running Espressif’s ESP-AT firmware on a UART: it works with any STM32, even a Blue Pill, and the STM32 only sends short text commands like AT+CWJAP. ST’s own option is the ST67W611M1 Wi-Fi 6 module, controlled with AT commands over SPI.

Note: ST’s wireless STM32 microcontrollers (the W series) don’t do WiFi either: the STM32WB and STM32WBA are Bluetooth LE and IEEE 802.15.4 (Zigbee, Thread, Matter), and the STM32WL is a sub-GHz radio for LoRa. The STM32MP1 and STM32MP2 are microprocessors that run Linux, and their WiFi also comes from a separate chip.

Note: The STM32 code examples in this tutorial are tested with: STM32 Blue Pill (STM32F103C8T6), ESP32-C3, and ESP8266 with ESP-AT firmware.


How to Add WiFi to STM32: The 4 Architectures

Every way of connecting an STM32 to a network comes down to one question: where does the TCP/IP stack run? On the WiFi module, on the STM32 itself, on a Linux processor, or in a hardwired Ethernet chip. That one choice decides how much flash, RAM, and code the STM32 has to spend on networking, which is why it’s the first thing to settle before you pick a module.

4 ways to connect an STM32 to a network: AT command co-processor, network co-processor, Linux MPU with WiFi chip, and wired Ethernet

1. AT Command WiFi Co-Processor (UART)

The WiFi module runs the radio, the TCP/IP stack, TLS, and even MQTT and HTTP clients. The STM32 sends it plain-text AT commands over a UART ( AT+CWJAP="MyWiFi","password" to join a network, AT+CIPSTART to open a TCP connection, and so on) and gets text replies like OK or WIFI GOT IP. The STM32 needs only a UART and a small command driver, so this works on the smallest STM32 parts. This is the approach of the ESP32-C3 and ESP32 with ESP-AT, the ESP-01 (ESP8266), the WizFi360, and the ST67W611M1 in its “LwIP off-load” mode (ST calls it architecture T01, with AT commands over SPI).

2. Network Co-Processor (SPI / SDIO)

The WiFi module only handles the radio and the WiFi link, and passes raw network packets to the STM32 over SPI or SDIO. The STM32 runs the TCP/IP stack (usually LwIP), TLS (Mbed TLS), and a host driver, mostly on top of an RTOS. You get full control and standard sockets, but you need a bigger STM32 (F4, F7, H5, H7, U5) and a lot more firmware. Examples: Espressif’s ESP-Hosted, Murata and Infineon CYW43xxx modules, and the ST67W611M1 in its “LwIP on host” mode (architecture T02).

3. Linux Microprocessor + WiFi Chip

The STM32MP1 and STM32MP2 run embedded Linux, so WiFi works like on any Linux board: a WiFi chip on SDIO or USB with a Linux driver, and the Linux network stack. ST’s STM32MP157C-DK2 kit, for example, carries a Murata WiFi/Bluetooth module. This is a different world from microcontroller firmware, so we’ll leave it out of this series.

4. Wired Ethernet (When WiFi Isn’t a Must)

If the device can reach the router with a cable, Ethernet is simpler and more reliable than any radio. The WIZnet W5500 has a hardware TCP/IP stack and connects to any STM32 over SPI, while larger STM32 parts (F4, F7, H7) have an Ethernet MAC and only need a PHY chip like the LAN8720 plus LwIP.


STM32 WiFi Modules Compared

Here is how the WiFi options you’ll find for STM32 compare. “Works with a Blue Pill” means it runs with an STM32F103C8T6 (64KB flash, 20KB RAM) without an RTOS or a TCP/IP stack on the STM32.

WiFi OptionInterface to STM32TCP/IP + TLS Runs OnWiFi StandardWorks With a Blue Pill?Notes
ESP32-C3 + ESP-ATUART (AT commands)Module802.11 b/g/n, 2.4GHzYesCurrent Espressif AT firmware, cheap tiny boards, also has BLE. Used in this series.
ESP-01 (ESP8266) + ATUART (AT commands)Module802.11 b/g/n, 2.4GHzYesCheapest and most common in old tutorials. Needs a 3.3V supply that can deliver its current peaks. Also covered in this series.
ST67W611M1 (ST + Qualcomm)SPI (AT commands)Module (T01) or STM32 with LwIP (T02)Wi-Fi 6 (802.11 b/g/n/ax), 2.4GHz + BLE 5.4No (ST’s package targets U5, H5, H7S, N6 Nucleo boards)ST’s official STM32 WiFi path: X-CUBE-ST67W61 software and the X-NUCLEO-67W61M1 expansion board
WizFi360 (WIZnet)UART (AT commands)Module802.11 b/g/n, 2.4GHzYesAT command WiFi module from the maker of the W5500
ESP-Hosted (ESP32-C3/C6 …)SPI / SDIO / UARTSTM32 (host)Depends on the ESP chipNoTurns an ESP32 into a network co-processor; the host runs the network stack
Murata / Infineon CYW43xxxSDIO / SPISTM32 (host)802.11 b/g/n (ac on some)NoCertified modules for products; needs a big STM32, an RTOS and LwIP
Inventek ISM43362SPI (AT-style commands)Module802.11 b/g/n, 2.4GHzPossibleThe WiFi module on ST’s B-L475E-IOT01A Discovery kit
W5500 Ethernet (no WiFi)SPIW5500 chip (hardwired)10/100 EthernetYesChoose it when a cable to the router is acceptable

Which WiFi Module Should You Pick for STM32?

Which WiFi module for STM32 decision chart: Ethernet, Linux WiFi chip, network co-processor, or AT co-processor over UART

  • Learning, hobby projects, or a small STM32: an ESP32-C3 with ESP-AT over UART. It’s cheap, current, and Espressif still releases new AT firmware for it.
  • You already have an ESP-01: it works with exactly the same AT commands for the basics, as long as you give it a proper 3.3V supply.
  • A product built on a bigger STM32 that has to stay inside ST’s ecosystem: the ST67W611M1 with X-CUBE-ST67W61.
  • You need sockets and LwIP on the STM32 itself: a network co-processor (ESP-Hosted, ST67W611M1 in T02 mode, CYW43xxx).
  • The device sits next to the router: Ethernet with a W5500.

STM32 + ESP32-C3 vs STM32 + ESP8266 (ESP-01)

Both modules speak Espressif’s AT command set over a UART, so the STM32 side is almost the same for both. The differences are in the module itself:

STM32 Blue Pill wired to an ESP-01 ESP8266 module on its 3.3V adapter board for WiFi with AT commands

STM32 Blue Pill ESP8266 / USB-TTL PA9 (USART1 TX) ESP8266 RX PA10 (USART1 RX) ESP8266 TX 3.3V VCC 3.3V CH_PD (EN) GND GND PA2 (USART2 TX) USB-TTL RX GND USB-TTL GND

The ESP8266 connects the same way: its TX to PA10 and its RX to PA9, plus a common ground. Its VCC and CH_PD (enable) pins go to 3.3V. The Blue Pill’s 3.3V pin can feed it, as long as the Blue Pill itself is powered from its USB port and not from the ST-Link’s 3.3V pin. On the common 2×4 breadboard adapters, CH_PD (EN) is not pulled up, so you must wire it to 3.3V yourself, or the module stays off, and its TX line sits low:

PA9 USART1 TX, goes to the ESP8266 RX.

PA10 USART1 RX, goes to the ESP8266 TX.

3.3V Goes to the ESP8266 VCC and CH_PD (EN) pins (Blue Pill powered from its USB port).

GND Goes to the ESP8266 GND: common ground.

STM32 ESP-01 ESP8266 wiring diagram: Blue Pill PA10 to ESP-01 TX, PA9 to ESP-01 RX, VCC and CH_PD to 3.3V

ESP32-C3 (ESP-AT)ESP-01 (ESP8266 AT)
CPU32-bit RISC-V, up to 160MHz32-bit Tensilica L106, 80/160MHz
RadioWiFi 802.11 b/g/n + Bluetooth LE 5WiFi 802.11 b/g/n
AT command portUART1: GPIO6 (RX), GPIO7 (TX), optional RTS/CTS on GPIO4/GPIO5UART0: the TX and RX pins of the 8-pin header
Boot and log outputUART0 / USB, separate from the AT portSame UART as the AT port (boot messages at 74880 baud)
Current AT firmwareESP-AT v4.x (v4.1.1.0 is a direct download, v4.2.0.0 is on request from Espressif)ESP8266 AT branch, v2.3.0.0 (Aug 2025), for 2MB+ flash modules; many 1MB ESP-01 boards ship with older 1.x AT firmware
Flashing new firmwareOver USB on most C3 boardsNeeds a USB-UART adapter and GPIO0 pulled low

We use the ESP32-C3 first in this series because its AT port is separate from its boot output (so the STM32 never sees boot garbage), it can be reflashed over plain USB, and it runs the current ESP-AT releases. The ESP8266 is further discussed in the ESP8266 AT commands with STM32 tutorial, because it’s still the module most people already have in a drawer.

Measured: Connect Time, Ping, and Throughput

To compare them on real hardware, the same Blue Pill ran the same benchmark firmware with each module: the time from AT+RST to ready, the time to join the WiFi network ( AT+CWJAP, 5 runs), the ping round trip to a PC on the same network ( AT+PING, 10 runs), and the TCP upload speed (64KB in 1KB AT+CIPSEND blocks) at 115200 and 921600 baud.

Measurement (Blue Pill + module, ESP AT firmware)ESP32-C3 (ESP-AT v4.1.1.0)ESP-01 (ESP8266 AT 0.21.0.0, SDK 0.9.5)
Boot: AT+RST until the module answers AT again1.22 sabout 0.05 s (this old firmware answers AT almost at once after AT+RST)
Join WiFi (AT+CWJAP until OK), 20 runs1.11 to 1.96 s (average 1.40 s)3.09 to 5.09 s, 7 of 10 runs joined (AT 0.21.0.0)
Ping to the WiFi router (AT+PING), 10 per run4 to 6 ms average, 40/40 repliesnot available: AT+PING does not exist in AT 0.21
TCP upload at 115200 baud (64KB in 1KB AT+CIPSEND blocks)9.9 to 10.0 KB/snot measured: the TCP test did not run on AT 0.21
TCP upload at 921600 baud46.7 to 47.5 KB/snot available: AT+UART_CUR does not exist in AT 0.21

The ESP8266 in our test still runs the AT firmware it shipped with, version 0.21.0.0 on SDK 0.9.5 (from 2015). It joins the network in 3 to 5 seconds, fails to join in some runs, and doesn’t have AT+PING or AT+UART_CUR at all. Most ESP8266 modules sold today are similar, which is the strongest reason to start with an ESP32-C3. We’ll update the ESP-01’s firmware in the ESP8266 part of this series and compare it again.

The upload speed at 115200 baud is limited by the UART, not the WiFi: 115200 baud carries at most 11.5KB/s (10 bits per byte), and the AT command overhead takes part of that. Raising the AT UART baud rate is the first thing to do when an STM32 application needs to move more data.


STM32 WiFi Example: Blue Pill + ESP32-C3 (AT Commands)

Now let’s get an STM32 online. In this example, the Blue Pill sends a handful of AT commands to an ESP32-C3 to join your WiFi network, prints every reply on a serial terminal, turns on its on-board LED when it gets an IP address, and then pings a server every 5 seconds to show that the link is alive.

Required Parts

QTY.Component NameAmazon.comAliExpress
1STM32 Blue Pill (STM32F103C8T6)AmazonAliExpress
1ST-Link V2 DebuggerAmazonAliExpress
1ESP32-C3 board (ESP32-C3 SuperMini; we use the WeAct ESP32-C3 Core Board)AmazonAliExpress
1ESP-01 (ESP8266) module + breadboard adapter (optional, for the comparison)AmazonAliExpress
1USB-TTL (UART) Converter, 3.3VAmazonAliExpress
1BreadBoardAmazonAliExpress
1Jumper Wires PackAmazonAliExpress

STM32 ESP32-C3 Wiring

Connect the STM32’s USART1 to the ESP32-C3’s AT port (UART1), and USART2’s TX pin to your USB-UART adapter for the log (see the Blue Pill pinout for the pin locations, and the STM32 USB-TTL converter tutorial if you haven’t used one before). Remember that TX goes to RX and RX goes to TX, and that the grounds must be connected.

PA9 USART1 TX, goes to the ESP32-C3 GPIO6 (AT RX): AT commands from the STM32 to the module.

PA10 USART1 RX, goes to the ESP32-C3 GPIO7 (AT TX): the module’s replies and events.

PA2 USART2 TX, goes to the USB-UART adapter’s RX: the log to your PC at 115200 baud.

GND Goes to the ESP32-C3 GND and the USB-UART GND: common ground.

Blue Pill PinConnects ToPurpose
PA9 (USART1 TX)ESP32-C3 GPIO6 (AT RX)Commands to the module
PA10 (USART1 RX)ESP32-C3 GPIO7 (AT TX)Replies from the module
GNDESP32-C3 GNDCommon ground
PA2 (USART2 TX)USB-UART RXLog to your PC (115200 baud)
GNDUSB-UART GNDCommon ground
STM32 ESP32-C3 WiFi wiring diagram: Blue Pill PA9 to ESP32-C3 GPIO6, PA10 to GPIO7, and PA2 to a USB-UART adapter

The ST-Link stays on the Blue Pill’s SWD header (SWDIO, SWCLK, GND) as usual and isn’t shown in the diagram.

STM32 Blue Pill wired to a WeAct ESP32-C3 Core Board on a breadboard for WiFi with AT commands

STM32 Blue Pill ESP32-C3 / USB-TTL PA9 (USART1 TX) GPIO6 (AT RX) PA10 (USART1 RX) GPIO7 (AT TX) GND GND PA2 (USART2 TX) USB-TTL RX GND USB-TTL GND

Note: Power the ESP32-C3 board from its own USB port (or 5V on its 5V pin), and power the Blue Pill from its micro-USB port, not from the ST-Link’s 3.3V pin. The ST-Link’s 3.3V output can’t carry a WiFi module’s transmit current peaks, and the Blue Pill’s supply sags with it.

Flash the ESP-AT Firmware on the ESP32-C3

A new ESP32-C3 board doesn’t come with the AT firmware. Download the ESP32-C3 AT firmware from Espressif’s ESP-AT releases (for this tutorial: ESP32-C3-MINI-1-AT-V4.1.1.0.zip), connect the board to your PC with USB, and write the single factory image to address 0x0 with esptool:

Replace COM5 with your board’s port. If you have the Arduino ESP32 core installed, esptool is already on your PC (in the core’s tools/esptool_py folder). The AT firmware listens on UART1 (GPIO6 RX, GPIO7 TX) at 115200 baud, as listed in Espressif’s ESP32-C3 AT hardware connection guide. We’ll cover the AT firmware, its versions, and the web flasher in detail in the ESP32 AT commands with STM32 tutorial.

To check the firmware, connect a USB-UART adapter to GPIO6/GPIO7 and send AT+GMR, or just run the example below, which prints it. Our WeAct ESP32-C3 Core Board replied with:

STM32 CubeMX Configuration Steps

#1

Open STM32CubeMX, create a new project, and select the STM32F103C8T6 in the MCU selector

#2

Set SYS > Debug to Serial Wire (so the board stays programmable over SWD)

STM32CubeMX SYS Debug set to Serial Wire: PA13 SWDIO and PA14 SWCLK on the Blue Pill

#3

Set RCC > High Speed Clock (HSE) to Crystal/Ceramic Resonator, and set HCLK to 72MHz in the Clock Configuration tab

STM32CubeMX RCC High Speed Clock (HSE) set to Crystal/Ceramic Resonator on PD0 and PD1

STM32CubeMX clock configuration for the Blue Pill: 8MHz HSE, PLL x9, HCLK 72MHz, APB1 /2

#4

Enable USART1 in Asynchronous mode (115200 baud, 8N1) and enable the USART1 global interrupt in its NVIC Settings tab

STM32CubeMX USART1 in Asynchronous mode at 115200 baud on PA9 (TX) and PA10 (RX) for the ESP32-C3 AT link

STM32CubeMX USART1 NVIC Settings with the USART1 global interrupt enabled

#5

Enable USART2 in Asynchronous mode (115200 baud, 8N1) for the log

STM32CubeMX USART2 in Asynchronous mode on PA2 (TX) and PA3 (RX) for the debug log

#6

Set PC13 as GPIO_Output with the user label LED_ONBOARD (the Blue Pill’s on-board LED)

STM32CubeMX GPIO configuration of PC13 as Output Push Pull with the user label LED_ONBOARD

Here’s the finished pin configuration: USART1 on PA9 (TX) and PA10 (RX) for the ESP32-C3, USART2 on PA2 (TX) and PA3 (RX) for the log, and PC13 driving the on-board LED.

STM32CubeMX pinout for the STM32 WiFi example: USART1 on PA9/PA10, USART2 on PA2/PA3, and PC13 as the LED output on the Blue Pill

#7

In Project Manager, name the project, set the Toolchain/IDE to STM32CubeIDE, and click Generate Code

STM32CubeMX Project Manager with the project name and Toolchain/IDE set to STM32CubeIDE

STM32 WiFi Example Code (ESP32-C3 AT Commands)

Create a wifi_secrets.h file in Core/Inc with your WiFi name and password:

Then add the following code to main.c, inside the matching USER CODE sections (the rest of the file is generated by CubeMX):

STM32 WiFi Code Explanation

The ESP module can send bytes at any time (replies, but also messages like WIFI DISCONNECT), so the code never waits for a fixed number of bytes. Every byte from USART1 lands in a ring buffer from the UART receive interrupt ( HAL_UART_RxCpltCallback re-arms a 1-byte HAL_UART_Receive_IT each time), and the main code reads from that buffer whenever it wants. That way, nothing is lost while the STM32 is busy printing the log on USART2. If an overrun error stops the reception, HAL_UART_ErrorCallback simply starts it again.

AT_Command() sends one command followed by \r\n and collects the reply until it ends with OK, ERROR, or FAIL, or until the timeout expires. AT_CommandLog() does the same and prints the command, the reply, the result, and how long it took. Notice that joining the network gets a 20-second timeout, because AT+CWJAP only answers after the module has associated with the router and received an IP address from DHCP.

The sequence in main() is the minimum every STM32 WiFi application goes through:

CommandWhat It DoesExpected Reply
ATChecks that the module is alive (retried until it answers)OK
ATE0Turns off the command echo, so replies contain only the answerOK
AT+GMRReads the AT firmware versionAT version, SDK version, OK
AT+CWMODE=1Station mode (the module joins a router, it doesn’t create a network)OK
AT+CWJAP="ssid","pwd"Joins your WiFi networkWIFI CONNECTED, WIFI GOT IP, OK
AT+CIPSTA?Reads the IP address, gateway and netmask+CIPSTA:ip:"192.168.x.x"…
AT+PING="www.google.com"Pings a host on the internet+PING:<time in ms>, OK

Tip: This quick-start code is deliberately short and blocking, so you can see every AT exchange. In the next parts of this series, we’ll replace it with our own non-blocking ESP-AT driver (UART DMA + IDLE line detection, timeouts, events, automatic reconnect), the way it should be done in a real STM32 application.

STM32 WiFi Example Testing

Flash the code, open a serial terminal on the USB-UART adapter’s port at 115200 baud, and reset the Blue Pill. You should see each command with its reply, the IP address your router gave the module, and then a ping every 5 seconds:

The module joined the network in about 1.1 seconds, and the router gave it an IP address. The first WIFI DISCONNECT line is normal when the module was already connected from an earlier run: joining a network drops the old connection first. Also notice that each AT+PING takes about 1 second to answer even though the ping itself took 44 to 65ms. ESP-AT v4.1.1.0 sends the reply only after that 1-second window, so don’t use AT+PING to time anything.

Here’s what the exchange looks like on the wires. CH1 (yellow) is PA9, the STM32’s TX line to the ESP32-C3, and CH3 (blue) is PA10, the module’s reply line. The AT+PING="www.google.com" command is 25 bytes, and at 115200 baud it takes 2.2ms on the wire. The reply (16 bytes: +PING:44 and OK) arrives 1 second later and takes 1.4ms:

Scope capture of an STM32 AT command to an ESP32-C3: AT+PING on PA9 and the reply on PA10 one second later
Scope capture of an STM32 AT command to an ESP32-C3: AT+PING on PA9 and the reply on PA10 one second later

STM32 UART TX on PA9 sending AT+PING to the ESP32-C3 at 115200 baud: 25 bytes in 2.2ms
STM32 UART TX on PA9 sending AT+PING to the ESP32-C3 at 115200 baud: 25 bytes in 2.2ms

ESP32-C3 AT reply on the STM32 PA10 RX pin: +PING and OK, 16 bytes in 1.4ms
ESP32-C3 AT reply on the STM32 PA10 RX pin: +PING and OK, 16 bytes in 1.4ms

That’s the real speed limit of the AT approach: at 115200 baud, every byte takes 87µs (10 bits). Short commands and replies don’t matter, but bulk data does, which is why the benchmark below also tests 921600 baud.


STM32 WiFi Troubleshooting

The ESP module doesn’t answer “AT”

Check, in this order: TX and RX are crossed (STM32 TX to module RX), the grounds are connected, you’re on the right module UART (on the ESP32-C3 the AT port is GPIO6/GPIO7, not the USB port or GPIO20/21), the baud rate is 115200, and the module really has the AT firmware (a new ESP32-C3 board usually runs a demo sketch). Connect the module’s AT port to a USB-UART adapter and type AT from a serial terminal (with CR+LF line endings) to check the module on its own.

AT+CWJAP returns FAIL or ERROR

The reply +CWJAP:<code> tells you why: 1 = connection timeout, 2 = wrong password, 3 = the network (SSID) wasn’t found, 4 = connection failed. Most ESP modules are 2.4GHz only, so they can’t see a 5GHz-only network. Also check that your SSID and password don’t contain characters that need escaping in AT commands (commas, double quotes, and backslashes must be escaped with a backslash).

The module keeps printing WIFI DISCONNECT / WIFI CONNECTED

This is usually power. A WiFi module pulls short current peaks when it transmits, and a weak 3.3V supply sags and resets the radio. Power the module from its own USB or regulator, keep the wires short, and add a bulk capacitor (100µF or more) close to the module’s 3.3V pin.

The ESP-01 never answers, and its TX line stays low

On the plain 2×4 breadboard adapters, the CH_PD (EN) pin of the ESP-01 is left floating, so the chip never starts. Wire CH_PD to 3.3V. A running ESP-01 holds its TX line high (idle) between bytes. If the STM32 receives only 0x00 bytes, the line is low most of the time, or the module talks at a slower baud rate than the STM32 (older ESP-01 firmware is often set to 9600 baud).

Garbage characters at power-up (ESP-01)

The ESP8266 prints its boot messages at 74880 baud on the same UART as the AT port, so the STM32 receives a burst of unreadable bytes right after power-up. Ignore everything until the module prints ready, or until it answers AT (that’s what the retry loop in the example does).

Replies get cut off or bytes go missing

Don’t read the module’s UART with blocking HAL_UART_Receive calls between other work, because the module doesn’t wait for you. Receive with an interrupt or DMA into a buffer, like the example does. At higher baud rates (921600), use DMA with IDLE line detection.


STM32 WiFi FAQ

Can STM32 connect to WiFi?

Yes, with an external WiFi module. The STM32 controls the module over UART, SPI, or SDIO, and the module handles the radio (and usually the TCP/IP stack). The simplest combination is an ESP32-C3 or ESP-01 with AT firmware on a UART.

Which STM32 has WiFi built in?

None. ST’s wireless STM32 microcontrollers (STM32WB, STM32WBA, STM32WL) support Bluetooth LE, 802.15.4, and sub-GHz/LoRa, not WiFi. ST’s WiFi solution is the separate ST67W611M1 module.

Is STM32 better than ESP32 for WiFi projects?

For a project that is mostly about WiFi, an ESP32 on its own is simpler, because the WiFi is on the chip (see our ESP32 WiFi library tutorial). An STM32 makes sense when the project needs what STM32 parts do best (advanced timers, motor control, precise ADCs, CAN, low-power modes, long-term availability, or an existing STM32 design) and WiFi is one feature among others. Then the STM32 runs the application and an ESP32-C3 handles WiFi.

Can I use SPI instead of UART to connect the WiFi module?

Yes. ESP-AT also supports SPI and SDIO as the AT command interface on some chips (it needs a custom ESP-AT build), the ST67W611M1 uses SPI, and network co-processors like ESP-Hosted use SPI or SDIO. UART is the easiest to start with, and at 921600 baud or more it’s fast enough for most sensor and control applications.

Does the STM32 need LwIP or FreeRTOS for WiFi?

Not with an AT command module. The module runs the TCP/IP stack, so a bare-metal STM32 is enough. You need LwIP (and usually an RTOS) only with a network co-processor, where the STM32 itself handles TCP/IP.

Can an STM32 Blue Pill do HTTPS?

Yes, through the module. ESP-AT has SSL/TLS connections and an HTTP client built in, so the TLS work happens on the ESP32-C3, not on the Blue Pill’s 20KB of RAM. The STM32 HTTP client tutorial shows HTTPS GET and POST requests from a Blue Pill.

Is the ESP8266 still supported?

Yes. Espressif keeps a separate ESP8266 AT branch (v2.3.0.0 was released in August 2025). New designs are better off with an ESP32-C3, which is just as cheap and gets the main ESP-AT releases.

Can STM32 do WiFi 6?

Yes, with ST’s ST67W611M1 module (802.11ax on 2.4GHz, plus Bluetooth LE 5.4), which is controlled from the STM32 over SPI.

Can STM32 use Bluetooth instead?

Yes. For a short-range wireless link to a phone or a PC, a Bluetooth module is simpler than WiFi. See the STM32 HC-05 Bluetooth module tutorial, or use an STM32WB / STM32WBA, which have Bluetooth LE built in.


STM32 WiFi Tutorial Series

This tutorial is the first part of our STM32 WiFi tutorial series. Each part builds one complete, tested project with an STM32 Blue Pill and an ESP WiFi module, using our own plain-C ESP-AT driver:

PartTutorialWhat You’ll Build
1STM32 WiFi (this tutorial)Choosing a WiFi module, quick start, ESP32-C3 vs ESP-01 measured
2ESP8266 AT Commands With STM32ESP8266 AT firmware, commands, and our ESP_AT driver
3ESP32 AT Commands (ESP-AT) With STM32ESP-AT firmware, commands, SNTP time, and our ESP_AT driver
4STM32 HTTP Client Over WiFiGET, POST, HTTPS, and JSON parsing
5STM32 Web ServerControl GPIOs and read sensors from a browser
6STM32 MQTTPublish and subscribe, Home Assistant
7STM32 OTA Firmware UpdateUpdate the STM32’s firmware over WiFi
8STM32 WebSocketReal-time data with an ESP32 smart bridge

Download STM32 WiFi Example Projects (ESP32-C3 / ESP-01 AT)

Download all attachment files for this Article/Tutorial (project files, schematics, code, etc.) using the link below. Everything is tested and verified to work on real hardware, as you’ve seen in the demo videos & screenshots. Please consider supporting my work if it helped you.

Wrap Up

To conclude this tutorial, we’ve seen that STM32 microcontrollers don’t have WiFi built in, and that the four ways of connecting them to a network differ in where the TCP/IP stack runs. For most STM32 projects, a WiFi co-processor running AT firmware over a UART is the fastest and lightest route, and the ESP32-C3 is the module we recommend for it. We got a Blue Pill online with a few AT commands, and measured how the ESP32-C3 and the ESP-01 compare.

In the next parts of this series, we’ll build our own non-blocking ESP-AT driver and use it for HTTP, a web server, MQTT, OTA updates, and WebSocket. If you’re new to the STM32 UART, the STM32 UART tutorial and the STM32 UART IDLE line detection tutorial are a good place to start, since everything in this series runs over a UART.

Share This Page With Your Network!
Join Our +25,000 Newsletter Subscribers!

Stay Updated With All New Content Releases. You Also Get Occasional FREE Coupon Codes For Courses & Other Stuff!

Photo of author
Author
Embedded systems engineer with several years of experience in embedded software and hardware design. I work as an embedded SW engineer in the Automotive & e-Mobility industry. However, I still do Hardware design and SW development for DSP, Control Systems, Robotics, AI/ML, and other fields I'm passionate about.
I love reading, writing, creating projects, and teaching. A reader by day and a writer by night, it's my lifestyle. I believe that the combination of brilliant minds, bold ideas, and a complete disregard for what is possible, can and will change the world! I will be there when it happens, will you?

Leave a Comment