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());
}