Failing to Enable UARTs on Beaglebone Black
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Short and General Question
I'm running Debian 9 (Stretch) on a Beaglebone Black with kernel 4.9. I have tried following the instructions that I've found online, but have thus far been seemingly unable to configure its UART devices. How do I configure my device? How do I debug/trouble-shoot my configuration? How can I verify whether my configuration is correct?
Long and Detailed Question
I'm very new to embedded Linux in general and to Beaglebone in particular. I followed the instructions given here:
- BeagleBoard.org: Getting Started
I downloaded the latest "Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card" image (specifically bone-debian-9.3-iot-armhf-2018-03-05-4gb.img) from the latest images page and flashed the Beagleboard from an SD card. After installation I was able to access the Beaglebone from my Linux desktop via a serial-to-USB cable - in a manner similar to what's described in the following article:
- How to Connect the Beaglebone Black via Serial over USB
I was able to use the following screen
command successfully:
screen /dev/ttyUSB0 115200
I was also able to a Micro-USB to USB cable to connect via SSH:
ssh debian@192.168.7.2
Once connected to the Beaglebone I verified that my kernel version was Linux beaglebone 4.9.82-ti-r102
. I then read through several articles on Beaglebone UART configuration, including the following:
Trevor's Electronics Blog: Enable UARTâÂÂs on Element 14 Beaglebone Black rev C
StackOverflow: Enabling UART on Beaglebone Black
Thing Printer: Cape Manager is Back, Baby!
Flaming Lotus Girls: Beaglebone Black - enable UART1
Billwaa's Blog: Enable All UART Ports at Boot
Tender Love Making(?): Enabling ttyO1 on BeagleBone
ELinux: BeagleBoneBlack Debian
My take-away was that (generally speaking) there are several different configuration files to check for, depending on the operating system and kernel version. These included the following:
/boot/uEnv.txt
/boot/uboot/uEnv.txt
/etc/default/capemgr
/media/BEAGLEBONE/uEnv.txt
There were also several device files mentioned, such as:
- /sys/devices/bone_capemgr.*/slots
I tried adding each of the following lines to each of the various uEnv.txt
files:
cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART3,BB-UART5
I also tried adding the following line to /etc/default/capemgr
:
CAPE=BB-SPI-01,BB-UART1,BB-UART2,BB-UART4
After rebooting I used the following command to check to see if the UART devices had appeared:
ls -l /dev/ttyO*
Unfortunately I got the following (unexpected results):
debian@beaglebone:~$ ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Jan 1 00:00 /dev/ttyO0 -> ttyS0
NOTE: I'm not concerned with ttyO0
, but rather with ttyO1, ..., ttyO5
.
I also tried a few other things but (in the interest of saving time and space) I won't describe every attempt unless it's requested.
What am I doing wrong here? What's the correct way to enable the UART devices?
debian command-line serial-port beagleboneblack uart
add a comment |Â
up vote
1
down vote
favorite
Short and General Question
I'm running Debian 9 (Stretch) on a Beaglebone Black with kernel 4.9. I have tried following the instructions that I've found online, but have thus far been seemingly unable to configure its UART devices. How do I configure my device? How do I debug/trouble-shoot my configuration? How can I verify whether my configuration is correct?
Long and Detailed Question
I'm very new to embedded Linux in general and to Beaglebone in particular. I followed the instructions given here:
- BeagleBoard.org: Getting Started
I downloaded the latest "Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card" image (specifically bone-debian-9.3-iot-armhf-2018-03-05-4gb.img) from the latest images page and flashed the Beagleboard from an SD card. After installation I was able to access the Beaglebone from my Linux desktop via a serial-to-USB cable - in a manner similar to what's described in the following article:
- How to Connect the Beaglebone Black via Serial over USB
I was able to use the following screen
command successfully:
screen /dev/ttyUSB0 115200
I was also able to a Micro-USB to USB cable to connect via SSH:
ssh debian@192.168.7.2
Once connected to the Beaglebone I verified that my kernel version was Linux beaglebone 4.9.82-ti-r102
. I then read through several articles on Beaglebone UART configuration, including the following:
Trevor's Electronics Blog: Enable UARTâÂÂs on Element 14 Beaglebone Black rev C
StackOverflow: Enabling UART on Beaglebone Black
Thing Printer: Cape Manager is Back, Baby!
Flaming Lotus Girls: Beaglebone Black - enable UART1
Billwaa's Blog: Enable All UART Ports at Boot
Tender Love Making(?): Enabling ttyO1 on BeagleBone
ELinux: BeagleBoneBlack Debian
My take-away was that (generally speaking) there are several different configuration files to check for, depending on the operating system and kernel version. These included the following:
/boot/uEnv.txt
/boot/uboot/uEnv.txt
/etc/default/capemgr
/media/BEAGLEBONE/uEnv.txt
There were also several device files mentioned, such as:
- /sys/devices/bone_capemgr.*/slots
I tried adding each of the following lines to each of the various uEnv.txt
files:
cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART3,BB-UART5
I also tried adding the following line to /etc/default/capemgr
:
CAPE=BB-SPI-01,BB-UART1,BB-UART2,BB-UART4
After rebooting I used the following command to check to see if the UART devices had appeared:
ls -l /dev/ttyO*
Unfortunately I got the following (unexpected results):
debian@beaglebone:~$ ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Jan 1 00:00 /dev/ttyO0 -> ttyS0
NOTE: I'm not concerned with ttyO0
, but rather with ttyO1, ..., ttyO5
.
I also tried a few other things but (in the interest of saving time and space) I won't describe every attempt unless it's requested.
What am I doing wrong here? What's the correct way to enable the UART devices?
debian command-line serial-port beagleboneblack uart
2
I don't know the beaglebone black, but it seemsttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.
â meuh
May 17 at 19:34
1
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem thatttyO0
is in some sense an exception, but my question is really aboutttyOn
forn>0
. I'll update my question to reflect that.
â igal
May 17 at 19:38
1
Do you get any clues from the kernel messages given bydmesg
?
â meuh
May 17 at 20:08
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Short and General Question
I'm running Debian 9 (Stretch) on a Beaglebone Black with kernel 4.9. I have tried following the instructions that I've found online, but have thus far been seemingly unable to configure its UART devices. How do I configure my device? How do I debug/trouble-shoot my configuration? How can I verify whether my configuration is correct?
Long and Detailed Question
I'm very new to embedded Linux in general and to Beaglebone in particular. I followed the instructions given here:
- BeagleBoard.org: Getting Started
I downloaded the latest "Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card" image (specifically bone-debian-9.3-iot-armhf-2018-03-05-4gb.img) from the latest images page and flashed the Beagleboard from an SD card. After installation I was able to access the Beaglebone from my Linux desktop via a serial-to-USB cable - in a manner similar to what's described in the following article:
- How to Connect the Beaglebone Black via Serial over USB
I was able to use the following screen
command successfully:
screen /dev/ttyUSB0 115200
I was also able to a Micro-USB to USB cable to connect via SSH:
ssh debian@192.168.7.2
Once connected to the Beaglebone I verified that my kernel version was Linux beaglebone 4.9.82-ti-r102
. I then read through several articles on Beaglebone UART configuration, including the following:
Trevor's Electronics Blog: Enable UARTâÂÂs on Element 14 Beaglebone Black rev C
StackOverflow: Enabling UART on Beaglebone Black
Thing Printer: Cape Manager is Back, Baby!
Flaming Lotus Girls: Beaglebone Black - enable UART1
Billwaa's Blog: Enable All UART Ports at Boot
Tender Love Making(?): Enabling ttyO1 on BeagleBone
ELinux: BeagleBoneBlack Debian
My take-away was that (generally speaking) there are several different configuration files to check for, depending on the operating system and kernel version. These included the following:
/boot/uEnv.txt
/boot/uboot/uEnv.txt
/etc/default/capemgr
/media/BEAGLEBONE/uEnv.txt
There were also several device files mentioned, such as:
- /sys/devices/bone_capemgr.*/slots
I tried adding each of the following lines to each of the various uEnv.txt
files:
cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART3,BB-UART5
I also tried adding the following line to /etc/default/capemgr
:
CAPE=BB-SPI-01,BB-UART1,BB-UART2,BB-UART4
After rebooting I used the following command to check to see if the UART devices had appeared:
ls -l /dev/ttyO*
Unfortunately I got the following (unexpected results):
debian@beaglebone:~$ ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Jan 1 00:00 /dev/ttyO0 -> ttyS0
NOTE: I'm not concerned with ttyO0
, but rather with ttyO1, ..., ttyO5
.
I also tried a few other things but (in the interest of saving time and space) I won't describe every attempt unless it's requested.
What am I doing wrong here? What's the correct way to enable the UART devices?
debian command-line serial-port beagleboneblack uart
Short and General Question
I'm running Debian 9 (Stretch) on a Beaglebone Black with kernel 4.9. I have tried following the instructions that I've found online, but have thus far been seemingly unable to configure its UART devices. How do I configure my device? How do I debug/trouble-shoot my configuration? How can I verify whether my configuration is correct?
Long and Detailed Question
I'm very new to embedded Linux in general and to Beaglebone in particular. I followed the instructions given here:
- BeagleBoard.org: Getting Started
I downloaded the latest "Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle via microSD card" image (specifically bone-debian-9.3-iot-armhf-2018-03-05-4gb.img) from the latest images page and flashed the Beagleboard from an SD card. After installation I was able to access the Beaglebone from my Linux desktop via a serial-to-USB cable - in a manner similar to what's described in the following article:
- How to Connect the Beaglebone Black via Serial over USB
I was able to use the following screen
command successfully:
screen /dev/ttyUSB0 115200
I was also able to a Micro-USB to USB cable to connect via SSH:
ssh debian@192.168.7.2
Once connected to the Beaglebone I verified that my kernel version was Linux beaglebone 4.9.82-ti-r102
. I then read through several articles on Beaglebone UART configuration, including the following:
Trevor's Electronics Blog: Enable UARTâÂÂs on Element 14 Beaglebone Black rev C
StackOverflow: Enabling UART on Beaglebone Black
Thing Printer: Cape Manager is Back, Baby!
Flaming Lotus Girls: Beaglebone Black - enable UART1
Billwaa's Blog: Enable All UART Ports at Boot
Tender Love Making(?): Enabling ttyO1 on BeagleBone
ELinux: BeagleBoneBlack Debian
My take-away was that (generally speaking) there are several different configuration files to check for, depending on the operating system and kernel version. These included the following:
/boot/uEnv.txt
/boot/uboot/uEnv.txt
/etc/default/capemgr
/media/BEAGLEBONE/uEnv.txt
There were also several device files mentioned, such as:
- /sys/devices/bone_capemgr.*/slots
I tried adding each of the following lines to each of the various uEnv.txt
files:
cape_enable=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART3,BB-UART5
I also tried adding the following line to /etc/default/capemgr
:
CAPE=BB-SPI-01,BB-UART1,BB-UART2,BB-UART4
After rebooting I used the following command to check to see if the UART devices had appeared:
ls -l /dev/ttyO*
Unfortunately I got the following (unexpected results):
debian@beaglebone:~$ ls -l /dev/ttyO*
lrwxrwxrwx 1 root root 5 Jan 1 00:00 /dev/ttyO0 -> ttyS0
NOTE: I'm not concerned with ttyO0
, but rather with ttyO1, ..., ttyO5
.
I also tried a few other things but (in the interest of saving time and space) I won't describe every attempt unless it's requested.
What am I doing wrong here? What's the correct way to enable the UART devices?
debian command-line serial-port beagleboneblack uart
edited May 18 at 21:32
GAD3R
22.1k154891
22.1k154891
asked May 17 at 2:05
igal
4,785930
4,785930
2
I don't know the beaglebone black, but it seemsttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.
â meuh
May 17 at 19:34
1
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem thatttyO0
is in some sense an exception, but my question is really aboutttyOn
forn>0
. I'll update my question to reflect that.
â igal
May 17 at 19:38
1
Do you get any clues from the kernel messages given bydmesg
?
â meuh
May 17 at 20:08
add a comment |Â
2
I don't know the beaglebone black, but it seemsttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.
â meuh
May 17 at 19:34
1
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem thatttyO0
is in some sense an exception, but my question is really aboutttyOn
forn>0
. I'll update my question to reflect that.
â igal
May 17 at 19:38
1
Do you get any clues from the kernel messages given bydmesg
?
â meuh
May 17 at 20:08
2
2
I don't know the beaglebone black, but it seems
ttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.â meuh
May 17 at 19:34
I don't know the beaglebone black, but it seems
ttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.â meuh
May 17 at 19:34
1
1
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem that
ttyO0
is in some sense an exception, but my question is really about ttyOn
for n>0
. I'll update my question to reflect that.â igal
May 17 at 19:38
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem that
ttyO0
is in some sense an exception, but my question is really about ttyOn
for n>0
. I'll update my question to reflect that.â igal
May 17 at 19:38
1
1
Do you get any clues from the kernel messages given by
dmesg
?â meuh
May 17 at 20:08
Do you get any clues from the kernel messages given by
dmesg
?â meuh
May 17 at 20:08
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
I had this problem, and resolved it by simply dropping Debian 9 and using this Debian 8.6 image instead, under the "Older Debian images" category on this page.
Upon booting into it you'll see the /dev/ttyO1,O2,O4 files, but they won't work until you set the pins to the right pinmux (I was thrown for a loop by this, as it all used to be handled by device tree overlays):
#ttyO1:
config-pin P9_24 uart
config-pin P9_26 uart
#ttyO2:
config-pin P9_21 uart
config-pin P9_22 uart
#ttyO4:
config-pin P9_11 uart
config-pin P9_13 uart
You have to do that step on each re-boot. It belongs in some sort of startup script.
You can confirm the UARTs are working with a simple loopback test, e.g. for UART4:
Place a wire between P9_11 and P9_13
screen /dev/ttyO4
Text you type into the window should show up, disconnect the wire and further typing will not show up. The UART works.
This doesn't fix your problem if you need to use the latest Kernel/Debian, but if you just need UART to work (like me) then you should be all set.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I had this problem, and resolved it by simply dropping Debian 9 and using this Debian 8.6 image instead, under the "Older Debian images" category on this page.
Upon booting into it you'll see the /dev/ttyO1,O2,O4 files, but they won't work until you set the pins to the right pinmux (I was thrown for a loop by this, as it all used to be handled by device tree overlays):
#ttyO1:
config-pin P9_24 uart
config-pin P9_26 uart
#ttyO2:
config-pin P9_21 uart
config-pin P9_22 uart
#ttyO4:
config-pin P9_11 uart
config-pin P9_13 uart
You have to do that step on each re-boot. It belongs in some sort of startup script.
You can confirm the UARTs are working with a simple loopback test, e.g. for UART4:
Place a wire between P9_11 and P9_13
screen /dev/ttyO4
Text you type into the window should show up, disconnect the wire and further typing will not show up. The UART works.
This doesn't fix your problem if you need to use the latest Kernel/Debian, but if you just need UART to work (like me) then you should be all set.
add a comment |Â
up vote
1
down vote
I had this problem, and resolved it by simply dropping Debian 9 and using this Debian 8.6 image instead, under the "Older Debian images" category on this page.
Upon booting into it you'll see the /dev/ttyO1,O2,O4 files, but they won't work until you set the pins to the right pinmux (I was thrown for a loop by this, as it all used to be handled by device tree overlays):
#ttyO1:
config-pin P9_24 uart
config-pin P9_26 uart
#ttyO2:
config-pin P9_21 uart
config-pin P9_22 uart
#ttyO4:
config-pin P9_11 uart
config-pin P9_13 uart
You have to do that step on each re-boot. It belongs in some sort of startup script.
You can confirm the UARTs are working with a simple loopback test, e.g. for UART4:
Place a wire between P9_11 and P9_13
screen /dev/ttyO4
Text you type into the window should show up, disconnect the wire and further typing will not show up. The UART works.
This doesn't fix your problem if you need to use the latest Kernel/Debian, but if you just need UART to work (like me) then you should be all set.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I had this problem, and resolved it by simply dropping Debian 9 and using this Debian 8.6 image instead, under the "Older Debian images" category on this page.
Upon booting into it you'll see the /dev/ttyO1,O2,O4 files, but they won't work until you set the pins to the right pinmux (I was thrown for a loop by this, as it all used to be handled by device tree overlays):
#ttyO1:
config-pin P9_24 uart
config-pin P9_26 uart
#ttyO2:
config-pin P9_21 uart
config-pin P9_22 uart
#ttyO4:
config-pin P9_11 uart
config-pin P9_13 uart
You have to do that step on each re-boot. It belongs in some sort of startup script.
You can confirm the UARTs are working with a simple loopback test, e.g. for UART4:
Place a wire between P9_11 and P9_13
screen /dev/ttyO4
Text you type into the window should show up, disconnect the wire and further typing will not show up. The UART works.
This doesn't fix your problem if you need to use the latest Kernel/Debian, but if you just need UART to work (like me) then you should be all set.
I had this problem, and resolved it by simply dropping Debian 9 and using this Debian 8.6 image instead, under the "Older Debian images" category on this page.
Upon booting into it you'll see the /dev/ttyO1,O2,O4 files, but they won't work until you set the pins to the right pinmux (I was thrown for a loop by this, as it all used to be handled by device tree overlays):
#ttyO1:
config-pin P9_24 uart
config-pin P9_26 uart
#ttyO2:
config-pin P9_21 uart
config-pin P9_22 uart
#ttyO4:
config-pin P9_11 uart
config-pin P9_13 uart
You have to do that step on each re-boot. It belongs in some sort of startup script.
You can confirm the UARTs are working with a simple loopback test, e.g. for UART4:
Place a wire between P9_11 and P9_13
screen /dev/ttyO4
Text you type into the window should show up, disconnect the wire and further typing will not show up. The UART works.
This doesn't fix your problem if you need to use the latest Kernel/Debian, but if you just need UART to work (like me) then you should be all set.
answered Jul 13 at 16:48
apprehensivebob
111
111
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444275%2ffailing-to-enable-uarts-on-beaglebone-black%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
I don't know the beaglebone black, but it seems
ttyO0
might be an exception, as it can be the debug console. If you want some more background on the Device Tree that dynamically configures the pins to a given function, this adafruit tutorial on UART1 is quite informative, even though it may be out of date, and does not directly answer your problem.â meuh
May 17 at 19:34
1
@meuh Thanks for the link, but I actually read that one already. And yes, it does seem that
ttyO0
is in some sense an exception, but my question is really aboutttyOn
forn>0
. I'll update my question to reflect that.â igal
May 17 at 19:38
1
Do you get any clues from the kernel messages given by
dmesg
?â meuh
May 17 at 20:08