Dragon Board 410C - UART

HI Akira,

UART0 is working with TTYHS4 , @9600 Baudrate.

Hi @asokfair,

Thank you for the information of the baudrate of the /dev/ttyHS4.

It is greatly appreciated.

Hi @asokfair,

I am not completely sure what you have been mentioning about UART1 (/dev/ttyHSL0), but I might have some ideas.

For using the UART1 for serial console, I found that the both hardware flow and software flow should be off.
When the hardware flow is on, then you will not able to send any data from typing from the beginning of booting.
When the software flow is on, it still show the screen but it seems to stop responding after a while some where around few minutes for sending data from serial console.

Another cause it could be happening is that the Android goes into sleep mode after booting about 1 minutes.
This is normal behavior like regular Android phones or tablets.
When it is in sleep mode UART1 do not respond.
Easiest way to awake the Android is to insert the keyboard to USB Type-A connector and type any key.

Hi. I am also having difficulty with the UART on the 410c. This is on Debian however.

I have the latest “83” image installed (http://builds.96boards.org/releases/dragonboard410c/linaro/debian/latest/).

It seems that /dev/ttyMSM0 is the console on this image; and that /dev/ttyMSM1 should be available for use as a UART port. I am able to receive data on another device, and I am using a TTL level converter to shift my signal down to 1.8v and have confirmed that with a scope.

Can anyone confirm that this port works for them on Debian (build 83)? It appears to me that the driver is available in the kernel and my /var/log/messages shows ttyMSM0 as the console and the ttyMSM1 driver loading.

I am using Pins 11 and 13 of the low speed connector for TX/RX and pin 1 for GND.

Thank you in advance for any help.

Hi @John,
I am too new to this Dragon board, currently i worked only with android, did not have idea on Debian but sure i wil try. may be @Akira can help on this Debian.

Thanks,
Ashok R

Yes, I was hoping he would be able to.

Do you know of any other resources for support for this board?

Regards,
John V. Busch

Note: the MSM numbers are swapped compared to the UART numbers in the datasheet.

UART0 is ttyMSM1, which also has a symlink to tty96B0 - this is the one that’s available, and it’s on pins 5/7 on the LS header
UART1 is ttyMSM0, which also has a symlink to tty96B1 - this is the console port on pins 11/13 on the LS header

I can confirm that both of them work fine for me on the 1604 Debian developer (console-only) build, other than the 0-3 byte corruption every 4096 bytes on UART0 described here:
https://bugs.96boards.org/show_bug.cgi?id=374

I see. I will try pins 5/7. Thank you.

That was precisely the problem! Thank you!

I am now a but concerned about the corruption; have you heard anything more about the v2 he mentions in the ticket, or perhaps the patch he mentions but “didn’t like”?

Hi @jbusch, @suicidaleggroll, @asokfair,

I am happy to see the collaboration happening on this thread. :slight_smile:

Recap.

Debian:
/dev/tty96B0 → ttyMSM1 → UART0 (pins 5,7 on LS connector)
/dev/tty96B1 → ttyMSM0 → UART1 (pins 11,13 on LS connector) also used as the serial console

I also see the periodic data corruption when using the serial console.
https://bugs.96boards.org/show_bug.cgi?id=374

It is usual that the patches to fix not always applied right away by the maintainer of the kernel.
It takes time the patches to be merged even the patches solves the situation.
The maintainer will review the patches and often time ask the author to revise the patches to be accepted.

Lets wait for the fix being applied.

2 Likes

The patch has been posted on the bugs.96boards.org link. My test system is at the office so I’ll try it out when I get in on Monday.

It looks like the patch works, no more corruption on 4kB boundaries!

You simply change:
pio_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE);
to:
pio_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);

near line 730 in drivers/tty/serial/msm_serial.c, and then rebuild and flash the kernel.

that’s great! thank you for posting. I will likely be applying this myself soon.

Hi anyone on this thread.
I started a similar thread last year believing the problem was the mezzanine board interface. I think we are looking for the same problem.
Here is the thread: http://www.96boards.org/forums/topic/uart0-android-sensors-mezzanine/#post-19408&gsc.tab=0

I am working with Android and it seems this above thread ended with Debian.
I am interested to understand if someone use actually UART0 and if it is available. FOR ANDROID OS.

Thank you for any answer(ANDROID)

Hi jean-marc,

I tested UART0 on Android a long time ago. I connected Rx to Tx and checked that everything that I sent was received back. It worked.

Great! Thank you Andries for the answer…
So if it worked it must work for me. Two possibilities 1) The new Android version does not work anymore or 2) I am doing something wrong.

How did you proceed exactly to test it, just doing a loop-back RX-TX?
What command or procedure did you used to test it?
In the dev directory was the tty named ttyHS0 or ttyHS4 or else?
What Android image did you use?

If you remember some, maybe you will finally help me to resolve my problem.

jm

Before accessing the UART you first need to give the ttyHS0 file read and write access using the chmod command. (chmod 0777 /dev/ttyHS0).

I tested it two ways:

  1. What I did is to use the NDK to add support to an app using JNI. So I’m using c code in my java application to send and receive using the UART.

I found this video very helpful:
https://www.youtube.com/watch?v=6DGdhwKY94Q

  1. Use ADB to send and receive:
    Android Send-> echo hallo > /dev/ttyHS0
    Android Receive-> cat /dev/ttyHS0

I cannot remember which image I used. But I do remember that it was using Android 5.1.1. I used ttyHS0 for the UART.

1 Like

Andries thank you for your answer:
first point is clear (chmod 777)

Point 1. I do it using SDK in java and this works in sending data but the problem is in receiving.

Point 2. I do the same with ADB and this works in sending but not receiving.

For the video: I am doing something similar and even simulate different transmissions.

  • Using my PC and a terminal, can receive data from the DragonBoard but receive failed-
  • Using Arduino sending an ASCII string regularly, once every seconde and the receive failed.

I do the reception by “cat” or also by my App using the Filestream and get the same result.

What failed: The data is received sporadically and always corrupted, if I send “hello” I receive non ASCII characters followed by “llo” or “lo” like “{[}.ello”.
I used to see such problem when you program a uController and you cannot divide the right frequency for the baud rate.
I made so much other trials using microcom from Busybox but always the same result. Can send data but cannot receive properly.

Thanks for helping

I am using the UART Port available on Linker Sprite Mezzanine (level shifter already implemented) BUT as early mentioned, this UART Port on Linker Sprite Mezzanine points to /dev/tty96B1 (which is the UART serial console), so during RX it presents conflicts but curiously it works fine for TX :astonished: (verified on wireless UART receiver HC-12 on Arduino)

Is it possible to disable serial console and keep the implementation ?
Or is it a better solution to move to UART0 (/dev/tty96B0) and implement the level shifter for that ? :sweat:

I am using Debian 9.1 (4.9.3-linaro-lt-qcom)

Any Android image failed on UART0.
Depending on Android image it could be ttyHS0 or ttyHS4.
Testing either by loopback or using Android app same thing. UART0 does work on TX but not RX.