When you enable the (E)USART (which HSERIN does of course) it takes control of the TX/RX pins, thus you can't use the as normal I/O.

/Henrik.