I've just started working with programming the GPIO's on the BBB, but before you can use things like UART, you have to enable it on the pins.
The old way of doing this was to make your own custo "Device tree overlay", and it can be a bit complicated (at least for me, who just wanna start programming).
I then found a site showing a much easier way using the capemgr, simple by adding a line to a text file (uEnv.txt). (http://beaglebone.cameon.net/home/serial-ports-uart)
The above way looks really easy, and just what i need, so i did the following.
- Edited uEnv.txt vi /media/BEAGLEBONE/uEnv.txt
- Added optargs=quiet drm.debug=7 capemgr.enable_partno=BB-UART2 (:wqto save)
- Rebooted reboot
I then ssh to the Beaglebone, and did a quick check to see if the UART was enabled
[email protected]:~# ls -l /dev/ttyO* crw--w---- 1 root tty 248, 0 Jan12000 /dev/ttyO0
No luck... it only returned the ttyO0 wich is the default UART port for debugging and stuff like that on the BBB.
My BBB's eMMC is flashed to boot from SD-card (will probably do a tutorial on this), so naturally i would think that it uses the uEnv.txt from the sd-card during boot.
But i found out that the eMMC also has a uEnv.txt, and that is the one thats being loaded during boot, but it excists both places (bit confusing?).
So to edit the uEnv.txt on the eMMC i did the following:
- Mount eMMC mount /dev/mmcblk0p1 /media/card
- Edit uEnv.txt vi /media/card/uEnv.txt
- Add the capemgr parameter capemgr.enable_partno=UART2
- Reboot the Beaglebone reboot
After reboot i checked again and it now shows up! Hurray!
[email protected]:~# ls -l /dev/ttyO* crw--w---- 1 root tty 248, 0 Jan12000 /dev/ttyO0 crw-rw---- 1 root dialout 248, 2 Jan12000 /dev/ttyO2
A complete list of features that can be enabled this way, can be found with this command: [email protected]:~# ls -l /lib/firmware/BB-*.dts