How to use the UART on the 40 Pin GPIO header for the cosole

Post Reply
frohro
Posts: 16
Joined: Mon Dec 22, 2014 9:05 am
languages_spoken: english
ODROIDs: Odroid C1
Has thanked: 0
Been thanked: 0
Contact:

How to use the UART on the 40 Pin GPIO header for the cosole

Post by frohro »

I accidentally burned out the regular console, and needed to upgrade, which is supposed to be dangerous using ssh, so I decided to see if I could use the UART on the 40 pin GPIO header. The pins are much easier to connect to for me than the non standard ones on my Odroid C1's regular console. I would have done this instead of using it if I had known how when I first needed the console, as I would not have had to make a special plug for the console.

The UART is connected to /dev/ttyS2.
1) Create a file called /etc/init/ttyS2.conf containing the following:

Code: Select all

# ttyS2 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 115200 ttyS2 vt102
2) Ask upstart to start the getty

Code: Select all

sudo start ttyS2
3) Edit the line in /usr/share/bootini/boot.ini
setenv condev "console=tty0 console=ttyS0,115200n8"
so it looks like this:

Code: Select all

setenv condev "console=tty0 console=ttyS0,115200n8 console=ttyS2,115200n8"   
Then reboot with your 3.3V TTL to USB UART connected to (pin 6 to GND, pin 8 to the RX of the USB-UART, pin 10 to TX of the USB-UART).
You will need some kind of terminal program on your computer. I use minicom on Ubuntu. The baud is 115200 8N1, and no flow control.

User avatar
rooted
Posts: 7877
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 222 times
Contact:

Re: How to use the UART on the 40 Pin GPIO header for the co

Post by rooted »

Nice little how-to, thanks for sharing.

mad_ady
Posts: 8319
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 573 times
Been thanked: 434 times
Contact:

Re: How to use the UART on the 40 Pin GPIO header for the co

Post by mad_ady »

What's your ubuntu version? It looks like pre systemd

Post Reply

Return to “General”

Who is online

Users browsing this forum: superpowter77 and 1 guest