BBB UART2 loopback test

Hello and happy holidays to everyone,

I’ve been trying to use the UART on my BBB and I’m having some trouble to figure out why it is not working. To test I have a jumper line between P9.21<=>P9.22 and using a loopback test. The first Putty session (cat /dev/ttyO2)does not respond with any “output”. I thought this would be easier and my google searches indicate this should work.

root@beaglebone:~# uname -r && cat /etc/dogtag

4.1.13-ti-r33

BeagleBoard.org Debian Image 2015-11-12

root@beaglebone:~# cat $SLOTS

0: PF---- -1

1: PF---- -1

2: PF---- -1

3: PF---- -1

4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-UART2

root@beaglebone:~# ls /dev/ttyO*

/dev/ttyO0 /dev/ttyO2

Terminal 1:

root@beaglebone:~# cat /dev/ttyO2

Terminal 2:

root@beaglebone:~# echo “hi” > /dev/ttyO2

many thanks for any assistance.

Cheers,

(cross-post to: https://groups.google.com/forum/#!topic/beaglebone/NT8ZSFTaY-Q by mistake)

You are doing the right thing by having two separate terminal sessions and loading the BB-UART2 cape. Not sure if you’re letting “cat /dev/ttyO2” run while you try to echo text to ttyO2. Make sure you understand that when you “cat /dev/ttyO2”, the cursor steps to a new line, but that just means it’s listening for any incoming messages. After doing that cat command, you should immediately go to the second terminal, echo text into ttyO2 just like you described, and see if your other terminal screen updated itself with the text.

also, try…

stty -F /dev/ttyO2 raw -echo

…as soon as the /dev/ttyO2 is available, especially if you’re not doing this stuff immediately after a fresh boot. stty is used to configure your serial/terminal interface setting. the “raw” argument turns off some pre-processing stuff, which I think may sometime hide outputs unless a certain special character is observed in the string. the “-echo” argument turns off output echoing, which, when you have the rx and tx pins of the same serial port connected together, causes a loop condition that produces a pretty ugly output on my beaglebone black. You probably wouldn’t have to do this if you were trying to communicate between two different UART ports.

Note: another thing you usually have to do with this sort of thing is to use “stty” to apply the correct settings to your serial/terminal interface. For instance,

Hello and thanks for your reply.

as it turns out I had a pin conflict on pin 49. The following lead me to believe that nothing else was loaded and I should be good to go.

root@beaglebone:~# cat $SLOTS

0: PF---- -1

1: PF---- -1

2: PF---- -1

3: PF---- -1

4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-UART2

dmesg showed there was a conflict with the pins and cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups showed the conflict wiht nxp_hdmi_bonelt_pins

I changed my /boot/uEnv.txt to disable HDMI:
##BeagleBone Black: HDMI (Audio/Video) disabled:
dtb=am335x-boneblack-emmc-overlay.dtb

and it is now working. thanks again for your support.