Firstly, let me preface by saying I feel silly for asking a question like this. The information should be online, but I can't seem to find it anywhere. I feel like I've looked pretty hard, but nothing seems to get me what I'm looking for.

Here's the situation. I have two Linux mini computer boards. They're exactly the same, manufacturer and everything. The board has 12 serial ports. The problem is that on one board, all the serial ports are working just fine, but on the other, they're all messed up. Most aren't in the /dev directory, I can't find them, etc.

So I figured I'd be able to fix my problem by finding the IO addresses (probably IRQs as well, assuming those aren't changed) of the ports on the working board, then taking this information and making new entries in /dev, since I'm assuming the manufacturer wouldn't have changed the addresses that the pins on the board are mapped to. Seems reasonable, right? What I didn't expect was running into problems actually getting this information out of a working system.

So the real problem is this: I have 12 entries in /dev, they're all mapped to serial ports and they all work, but all the tools for getting the information out of them aren't working. Here's what I've tried:

Filtering dmesg:

root@linaro-ubuntu:/dev# dmesg | grep tty
Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb1:off video=mxcfb2:off fbmem=28M vmalloc=400M
bootconsole [ttymxc0] enabled
imx-uart.0: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX
console [ttymxc0] enabled, bootconsole disabled
imx-uart.1: ttymxc1 at MMIO 0x21e8000 (irq = 59) is a IMX
imx-uart.2: ttymxc2 at MMIO 0x21ec000 (irq = 60) is a IMX
imx-uart.3: ttymxc3 at MMIO 0x21f0000 (irq = 61) is a IMX
imx-uart.4: ttymxc4 at MMIO 0x21f4000 (irq = 62) is a IMX
init: tty1 main process (5754) killed by TERM signal

Ok, this information looks good. I knew that ttymxc0 was a terminal. The rest of these guys are working serial ports. Those IO addresses look good and the IRQs don't conflict with anything in /proc/interrupts. But wait, where's the other serial ports? Shouldn't they be here too? That doesn't really bug me too much, as long as I can find it somewhere else.

setserial Command:

The next logical step was to mess with setserial.

root@linaro-ubuntu:/dev# setserial -g /dev/ttymxc1
/dev/ttymxc1, UART: undefined, Port: 0x0000, IRQ: 59
root@linaro-ubuntu:/dev# setserial -g /dev/ttymxc2
/dev/ttymxc2, UART: undefined, Port: 0x0000, IRQ: 60
root@linaro-ubuntu:/dev# setserial -g /dev/ttymxc3
/dev/ttymxc3, UART: undefined, Port: 0x0000, IRQ: 61
root@linaro-ubuntu:/dev# setserial -g /dev/ttymxc4
/dev/ttymxc4, UART: undefined, Port: 0x0000, IRQ: 62

Ick, not liking this. I mean, it makes sense, because I know setserial doesn't talk with the hardware and just reads driver information, but I was hoping at least the ones I saw when parsing dmesg would show up correctly. At least the IRQs are right, even if it is just a coincidence. But when I try this on the other serial ports:

root@linaro-ubuntu:/dev# setserial -g /dev/ttyHBA1
/dev/ttyHBA1, UART: undefined, Port: 0x0000, IRQ: 0
root@linaro-ubuntu:/dev# setserial -g /dev/ttyHBA2
/dev/ttyHBA2, UART: undefined, Port: 0x0000, IRQ: 0

It's just a whole bunch of that across the board. No addresses, IRQ is set to zero (not sure if this is just the default setting for a device the system knows nothing about or if it's actually set to be IRQ 0. If that's the case, then gross, I'll have to change that.)

So setserial is giving me a whole lot of nothing. I've heard there's a way to have setserial try talking to the hardware directly, but I couldn't find any documentation for this online. The man pages aren't really helping me either. Anyone have some help for me here?

By now I'm kind of at a loss. I don't think stty gives the kind of information I'm after.

I've found a couple things about reading from files, like /proc/tty/driver/serial and /proc/ioports. The first file doesn't exist on my system, and the second one is empty. I've found a couple other file suggestions online, but again, nothing useful.

I've also seen reference to something called "scanport" for Ubuntu? But I can't find it anywhere in the repos or on google.

Ahhhhh. What's going on? I have working serial ports, I just want to know things about them. This is Linux, normally system information like this can be found sideways, backwards, and upside down. Why am I having such problems?

  • Were both the working and the nonworking ones plugged in at the same time when you found out that one of them wasn't working? If so, try plugging in the nonworking one when the working one isn't plugged in. Then did it work? – John Militer Apr 28 '16 at 21:12
  • @John Nope, only one was ever plugged in at a time. Besides, I use a physical connection to access a terminal on these boards, so IP conflicts and the like aren't an issue. The real issue here is that I can't get the port info out of my board. – MD-7 May 3 '16 at 13:51
  • 1
    is the board possibly damaged and/or your distro on it modified/corrupted in any way? – Joe May 6 '16 at 7:35
  • @Joe Brand new board. Distro came with it, so maybe it's modified slightly, but I can't imagine they would change something big enough to effect it like that. – MD-7 May 12 '16 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.