[IMMEDIATE] ESP01 and STM32 UART CONNECTION PROBLEM

I connected the ESP01 module and the STM32F103C8 microcontroller via UART communication. I did this using pins A9 and A10 using the Serial2 connection. Here, STM32 will act as a USB-TTL converter and my computer will communicate with ESP01. However, when I uploaded the code (ESP01 UART is not connected), disconnected the power of the STM32 card, made the connections and applied the power, the STM32 started to work normally, but the computer did not see the STM32 card, and even when I disconnected the connections and reset the card, the computer did not see it. I flashed the bootloader and it was fixed. So how can I do this serial communication? These are my codes:

void setup() {
  Serial.begin(9600);
  Serial2.begin(11500);

}

void loop() {
  if(Serial.available())
    Serial2.write(Serial.read());
  if(Serial2.available())
    Serial.write(Serial2.read());

}

It is not a solution to your main question, just a corrections.

If I not mistaken, PA9 and PA10 is a Serial1 port on STM32F103 mcu

Also, you have a typo in your code

The baudrate probably should be 115200 rather than 11500

1 Like

@om1f ,
I have deleted your other topic on the same subject, please post your questions once only.

Thank you.

Serial2 pins: RX_PA3 , TX_PA2
Serial3 pins: RX_PA10 , TX_PA9

1 Like

Thanks for information

Thank you this information

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.