cancel
Showing results for 
Search instead for 
Did you mean: 

ESP 32 as wifi modul communication issues by AT command

vikas7
Visitor

Hello,

I am trying to establish UART communication between STM32G070RBTX and ESP32 Devkit using AT commands.

Connections: STM32 UART TX ESP32 RX, STM32 UART RX ESP32 TX, and common GND

Power ESP32 powered from 5V pin by usb or base board

Baud rate 115200

On reset, ESP32 does not print ok or any AT response.

Very rarely once in many tries I get a single AT command response,
but after that no communication happens.

Even pressing the reset button does not bring it back.

 

When I connect the ESP32 module via USB  to Dockight and send AT commands, the communication works fine.

4 REPLIES 4
Aime
ST Employee

Hello @vikas7 ,

Your issue with unreliable UART communication between STM32G070RBTX and ESP32 Devkit running AT firmware is common and can be caused by several factors. Below is a systematic checklist and recommendations to help you troubleshoot and resolve the problem:

 

Power Supply:

  • If you power ESP32 from 5 V USB or board pin, ensure the onboard regulator is working properly.
  • Measure the 3.3 V line on ESP32 to confirm stable voltage.
  • Unstable or noisy power can cause ESP32 to malfunction or reset.

UART Lines Voltage Levels:

  • STM32G070 UART pins are 3.3 V logic compatible, which matches ESP32.
  • No level shifter needed, but verify no 5 V signals are present on ESP32 RX pin.

Wiring:

  • Double-check TX-RX cross connections (STM32 TX → ESP32 RX, STM32 RX ← ESP32 TX).
  • Use short and shielded cables if possible to reduce noise.

Boot Mode Pins:

  • Ensure the ESP32 boot pins are not floating or forced to wrong levels by STM32 or external circuitry.
  • Floating or incorrect boot pins can prevent AT firmware from running.

Reset Behavior:

  • Pressing reset should cause ESP32 to output boot messages and respond to AT commands.
  • If no response, check reset pin wiring and ensure STM32 is not driving reset or boot pins unintentionally.

AT Firmware:

  • Confirm ESP32 has AT firmware flashed and working (as verified by USB connection).
  • Sometimes ESP32 Devkits come with different firmware or require re-flashing

Baud Rate:
       - Confirm both devices use exactly 115200 baud, 8 data bits, no parity, 1 stop bit.

Flow Control:
      -  Disable hardware flow control (CTS/RTS) unless explicitly connected and supported.

 

Best regards,
Aime
 

Andrew Neil
Super User

Welcome to the forum

Please see How to write your question to maximize your chances to find a solution for best results.

 


@vikas7 wrote:

On reset, ESP32 does not print ok or any AT response..


Do you really mean that the ESP does not send anything, or is it just that the STM32 does not receive anything ?

It's really important to know this - as it tells you where to look for the problem:

  • If the ESP does not send anything, then that's an ESP problem - nothing to do with STM32;
  • If the ESP does send as expected, then the problem is on the STM32 side.

See here for some tips on debugging serial comms.

 


@vikas7 wrote:

Baud rate 115200


Have you checked that your STM32 baud rate is accurate? And the ESP32?

Have you thoroughly tested your STM32 serial comms on its own - before adding the complications of ESP32?

eg, have you tested your STM32 against a PC terminal (such as Docklight) ?

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.
Ozone
Principal II

The in/output levels of the STM32 UART pins (Tx, Rx) are 3.3V.
This is not sufficient to drive a 5V device - including a 5V USB-to-serial adapter - directly.

The "5V tolerance" property of those pins only means they can tolerate 5V input signals, but not generate them.


@Ozone wrote:

This is not sufficient to drive a 5V device - including a 5V USB-to-serial adapter - directly.


You might get away with it - but then you may not.

Certainly a recipe for unreliable comms - which does seem to be what @vikas7 is experiencing ...

 


@Ozone wrote:

The "5V tolerance" property of those pins only means they can tolerate 5V input signals


Indeed.

So the STM receiving from the ESP should be OK ...

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.