Main Site Documentation

Is it possible? Swapping RXD and TXD on COM port


Hi everyone

I’ve just received my custom PCBs for our new project. However I’ve also just discovered an error on my board. I’ve mapped TXD of EMX through TXD of my peripheral and RXD of EMX through RXD…

This stupid mistake delays the due date of the proto board… Therefore for the proof of concept, I would like to know how to remapped the IO used for COM port by software but I don’t know where this mapping is defined.

May anyone help me?



can you do it in hardware? Jumper wires? (I don’t know if you can remap RX and TX functions so can’t comment on that part)


Almost all peripherals can be mapped to a limited number of predefined pins.You could change the map with RLP or direct register access. But I’m sure the SerialPort class will override those.

You can’t swap RXD and TXD pins.

I think the only option is to cut away the bad traces and wire it correctly.


I have temporarly used a ribbon cable to swap RX and TX but I really need a software way to do it because the proto board have to be ready for demos by the end of this month and I will not have time to wait for a new PCB.

Any idea to do it by software would be appreciated :slight_smile:


There is no software solution.

I don’t know how many proto’s you have but “the end of the month” is 25 days from here!
Cutting 2 traces on a PCB and soldering 2 wires is only 5 minutes of work.

BTW: most protype boards have such fixes. That’s why they call them “prototype” :slight_smile:


Hello and thanks for your answer even if it surprises me because RX and TX are just IOs for the NXP chip, am I right?. I fyes the GHI overlay configures Register and adds some API to provide convenient peripherals such as USB, UART, I2C and even more. Thus, modifying the internal registers or the API should solve my mistake but this may not be open to community.

I do not see anything to say that it is technically impossible… if we have the infos.


That is incorrect, UART pins are special pins and are located in special locations. You can check the NXP datasheet if you like.


@ leforban:
There are two types of serial port. One is software only. See OutputCompare. But it is slow, uses a lot of CPU.
The other type is hardware based. The serial port that you are talking about is hardware based. There is some silicon built into the CPU hardware that is connected only to the provided pins. There is no silicon designed into the hardware to allow the pins to be moved anywhere else, except for one port that can be assigned to two other specific pins.


There is more about the topic in this thread:


Ok you’re right, the four UARTs are hard wired on LPC2478 and therefore remapping will not be possible. Sorry to have really insist. Many thanks for all the answers. Next time, I will double check before sending PCB to fab.