I'm trying to set up a USART serial port on a custom board with a SAMA5D36 processor, but I am unable to read in data from a connected device. When I run setserial -g /dev/ttyS1 I get the following output:

/dev/ttyS1, UART: undefined, Port: 0x0000, IRQ: 22

Now, I have seen a similar question (linked here), but the solutions haven't worked for me. I'm wondering, can I not set the port up this way because it's USART not UART? Or does that not really make a difference?

As far as I can tell, the device tree is correctly setting up the port in the kernel, and I have configured the port as well as I can using stty. Any suggestions?

  • Is it possible that it has a different name then ttyS1. On my device it has the name /dev/APP0. Check dmesg and /dev for other names. – jc__ Jul 26 '16 at 15:38
  • I checked both, but it's definitely ttyS1. The MMIO address is the same as in the device tree. – Alex St. Clair Jul 26 '16 at 16:38
  • Are you compiling your own kernel? Can you see the module load and the hardware initialize on system startup? – jc__ Jul 26 '16 at 17:10
  • I am compiling my own kernel. Here's the output from dmesg: f001c000.serial: ttyS1 at MMIO 0xf001c000 (irq = 22) is a ATMEL_SERIAL – Alex St. Clair Jul 26 '16 at 17:42
  • Looks like the module is loaded and hw is init. If you do a "cat /dev/ttyS1" while data is incoming, do you see anything? What are you using 'setserial' for? – jc__ Jul 26 '16 at 17:56

Solved my problem, so I thought I'd share. It turned out that TX/RX were flipped in the schematic for the PCB, and I didn't figure this out until I checked the data sheet for the processor.

So, USART vs. UART is a non-issue, and setserial -g /dev/ttyS1 returning undefined was an irrelevant distraction. Thus, to solve similar problems, verify device tree addresses (which were correct in my case) and verify pinouts on the hardware level (try swapping TX/RX even if you think they're correct). Also refer to the answers linked in my question.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.