Getting comms going on UART1

I’ve been struggling to get serial comms going on UART1. I have enabled it by creating a service that performs

echo BB-UART1 > /sys/devices/bone_capemgr.9/slots

and lo! the device /dev/ttyO1 appears. However, with two terminal windows open, doing ‘cat /dev/ttyO1’ in one and ‘echo “wibble” > /dev/ttyO1’ in the other results in nothing at all appearing in the cat window. I’ve tried several combinations of baud rates and flow control, with no success. What am I missing?

Oh, my board revision is B6.

Hi,

Not and expert here, but I did manage to get communication with a device connected to UART1. What do you have connected? If there is nothing there your transmit data will just go off into space. To see data come back you would have to have a device in loopback mode, or at least the Tx connected to the Rx.

I am running the Debian image, and used the ADAFRUIT-UART2 overlay. It shows up as ttyo1 (thats oh one, not zero one). I have a Sparkfun MAX3232 module that translates the 3V TTL to RS232 which goes to a little micro that responds to commands like “/sh/s” and returns some text. I use screen to type the text commands until I get my C program working on the BBB, or try javascript. Oh, there are also two Zigbee modules in between the micro and the BBB creating a wireless RS232 link.

Hope this helps,

Jonathan

Hi Jonathan

Thanks for your reply. One of the frustrating things is the changes between board revisions - I am on B6, and there are a set of overlays provided for UART support living in /lib/firmware so that if I go (from my recall so can’t get the exact syntax)

echo BB-UART1 > /sys/device/…/capemgr_dev.*/slots

then /dev/ttyO1 appears like magic. Great! I am now talking to the UART via hypertrm on my PC. And it appears that the problem I am experiencing may be a kernel issue. I can read from the UART, but the select() and poll() functions that ought to report as to whether data is ready to read in the FIFOs are not doing so. In fact, I have bypassed UART1 and installed an FTDI USB serial device on the BBB - this appears as /dev/ttyUSB0. Now I try select() on that, and it does come back, but only with every other character that I type. If I just read() from the file, I get the complete string. So I am a bit concerned that the Angstrom kernel is not as good as it could be, or needs to be.