How to Enable Hardware UART1 (Pins 8 & 10) on Tachyon?

Hello,

I am working with a Particle Tachyon and trying to use the hardware UART (UART1_TXD on Pin 8, UART1_RXD on Pin 10) to communicate with a Particle Boron.

I have confirmed my wiring is correct (TX->RX, RX->TX, common GND). When I list the devices in /dev/, I see several ttyHS* ports, but none of them seem to correspond to the pins on the 40-pin header. My Python script using pyserial fails to open or get data from any of them.

This leads me to believe that UART1 is disabled by default in the Device Tree. Could you please point me to the documentation or provide the command/procedure required to enable UART1 on the GPIO header so it can be accessed from Linux (e.g., as /dev/ttyHS0)? Unless it is already enabled by default, then I am at a loss.

Thank you!

Hey!

So, this uart is mapped already at: /dev/ttyHS2 :slight_smile: Works well as we have demos using it.

A helpful command to see which GPIOs are mapped is:

cat /sys/kernel/debug/pinctrl/*/pinmux-pins

The output contains:

pin 34 (GPIO_34): a80000.qcom,qup_uart (GPIO UNCLAIMED) function gpio group gpio34
pin 35 (GPIO_35): a80000.qcom,qup_uart (GPIO UNCLAIMED) function gpio group gpio35

I used this page to find the GPIO number - Input / Output | Particle Developer

You can then check which peripheral this is in the tty driver list:

ls -l /sys/class/tty/

lrwxrwxrwx 1 root root 0 Jun 17  2024 ttyHS0 -> ../../devices/platform/soc/99c000.qcom,qup_uart/tty/ttyHS0
lrwxrwxrwx 1 root root 0 Jun 17  2024 ttyHS1 -> ../../devices/platform/soc/a90000.qcom,qup_uart/tty/ttyHS1
lrwxrwxrwx 1 root root 0 Jun 17  2024 ttyHS2 -> ../../devices/platform/soc/a80000.qcom,qup_uart/tty/ttyHS2
lrwxrwxrwx 1 root root 0 Jun 17  2024 ttyMSM0 -> ../../devices/platform/soc/994000.qcom,qup_uart/tty/ttyMSM0

This could do with going into the docs - we'll make an update! Let us know if it works :slight_smile:

Thanks!

1 Like

Crazy handy!! Thank you very much!!

Thank you for the information about the UART being enabled by default and using /dev/ttyHS2.

I've spent the evening running detailed tests and have unfortunately hit a wall.

To isolate the issue, I performed UART loopback tests (connecting TX directly to RX) on both my Boron and my Tachyon independently.

  1. Boron Loopback Test (TX to RX): PASSED. The Boron can successfully send and receive data on its Serial1 port without any issues. This confirms my Boron's hardware is working correctly.
  2. Tachyon Loopback Test (Pin 8 TXD to Pin 10 RXD): FAILED.
  • I have a jumper wire connecting Pin 8 to Pin 10.
  • The Python script successfully opens /dev/ttyHS2.
  • The ser.write() command executes without error.
  • However, ser.readline() consistently returns empty. No data is ever received.

Hey! It might be hardware flow control is turned on. I'll ask the team to do this:

a) test this feature and configure the serial port correctly
b) update this help ticket with the instructions and add these to the docs as well

I might try this in the interim:

stty -F /dev/ttyHS2 -crtscts -ixon -ixoff -ixany

It turns on hardware and software flow control.

Then I would open minicom with the jumper installed

minicom -D /dev/ttyHS2 and type things and see what happens!

If this doesn't work, use minicom settings and check flow control is turned off.

If no success, we'll shoot back later with more!

Thanks!

Hey there
below is my code to confirm it works after short pin8 and pin10 through a jumper wire.
my desktop version is 1.0.129
you can also check yours by runningcat /etc/particle/distro_versions.json

import time
import serial  as ser 

if __name__=="__main__":
    uart  = ser.Serial('/dev/ttyHS2',timeout=10)
    while True:
        uart.write('Hello world\r\n'.encode('utf-8'))
        print(uart.readline())
        '''
        rsp = uart.read_until(b'\r\n')
        if rsp:
            print(rsp)
            uart.write(rsp)
        '''

if it still cannot work, then I would suggest run ls -l /dev/ttyHS2 to see user belongs to dialout group or not
if you didnot see something like crw-rw---- 1 root dialout 234, 2 Jun 11 15:32 /dev/ttyHS2 then it may means it's a group issue.
run sudo usermod -aG dialout $USER to add user into that group
after above comand. do a reboot before run this python script again

1 Like

Thank you both for the reply. Still bad news though.
I ran the stty -F command and then opened minicom.
Typing showed nothing (I turned on echo to verify the keyboard was at least sending commands and no double lettering.)
Checked minicom's settings and noticed Hardware Flow Control was ON. Just for kicks I went through every combination of HW/SW on's and off's. Never saw any text I typed.

Then checked my particle version (also 1.0.129). Created a test.py script with the code from ericyuan...ten seconds or so later a slow stream of empty byte strings: b' ' .

Just to make sure it isn't me and that I haven't done something obviously dumb, we are talking jumpers on the 4th and 5th pins on the right hand side correct? (I've made dumber mistakes than miscounting)

Yes, TX/RX are the 4th and 5th pins on the outside edge of the board.

1 Like

Lol thank you for the photo! I was looking at the board with the text bring right side up, therefore having the wrong pins (going to go correct my mistake and report back.). That's why I ask the "dumb" questions.

2 Likes