I have designed and manufactured a PCB which contains an ESP8266 (ESP-WROOM-02D) chip with the serial uart pins connected to a 30pin connector. I made a mistake on the layout (first time designing a PCB), and have the RX (Pin 3) and TX (pin 1) pins connected incorrectly (swapped).

Is there a way to switch these pins in software? There's no nice way to physically modify and I was hoping to not have to have the boards manufactured again if I can avoid it.


  • 1
    no. there is not
    – Juraj
    Aug 17, 2021 at 5:30

1 Answer 1


You could potentially still fix this by using SoftwareSerial.
Instead of using the hard-wired serial, you can create one in software and use any pins you'd like... Have a look at this github project.
This work-around however requires you to have two unused pins to assign to SoftwareSerial.

  • the linked SoftwareSerial library is bundled with esp8266 Arduino boards support package
    – Juraj
    Aug 17, 2021 at 9:21
  • Can I reassign the two hardware serial pins to software serial? It is hardwired to pins 1 and 3...
    – tommy-b-10
    Aug 17, 2021 at 10:14
  • @tommy-b-10, how do you flash the sketch into the esp?
    – Juraj
    Aug 17, 2021 at 15:37
  • @Juraj I flash the initial sketch before the esp is soldered to the board, then future flashes are done OTA using the esp wifi.
    – tommy-b-10
    Aug 18, 2021 at 5:02
  • Had another crack at this and realised I needed to set the pinmode to function_3 for pins 1 and 3 before calling softwareserial.begin. Works perfectly now! Is there any downsides to using softwareserial? I have it working at 115200 baud but a little concerned about stability. Cheers!
    – tommy-b-10
    Aug 19, 2021 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.