Skip to main content
Paul_TESSON
Associate II
February 14, 2025
Question

Communicate between STM32F7 and ESP-01 via UART

Hello,

I am reaching out to ask if it would be possible to get some help configuring my esp01.c library.

I am currently developing a library that utilizes DMA, interrupts, and a circular buffer to communicate with an ESP-01 module. The module is connected via PE7 and PE8 on an STM32F767ZI. However, I am encountering difficulties in properly configuring the DMA to handle two-step communication with the component.

Additionally, when I attempt to send the AT\r\n command, the DMA correctly processes the \r\n characters but does not seem to recognize the AT command.

You can find my code on GitHub. The relevant file is esp01.c, located in the SRC folder:
:link:GitHub - SMART_WAKE_UP_UV

Thank you in advance for your help.

Best regards,

This topic has been closed for replies.

5 replies

Pavel A.
February 14, 2025
Andrew Neil
Super User
February 15, 2025

So what you're really asking is how to do UART communication?

The STM32's UART neither knows nor cares what device is connected to its UART - all it does is send data out from its TX pin, and receive data coming in on its RX pin.

So the first step is to forget about the ESP-01, and just get your UART comms working with a PC terminal.

Start with plain, blocking reads & writes first before adding the complications of DMA.

https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step3_Introduction_to_the_UART

https://community.st.com/t5/stm32-mcus/implementing-uart-receive-and-transmit-functions-on-an-stm32/ta-p/694926

See also the examples in CubeIDE.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Paul_TESSON
Associate II
February 15, 2025

Ok, I understand, but I code in bare metal with Kiel uVision5, because I would line to know how it works and I would like to reduce energy consumption.

Andrew Neil
Super User
February 17, 2025

The principle remains the same: start simple - just a terminal, no ESP, blocking.

Get the basics working first - before adding the complications of DMA, etc.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.