We work with a LinkIt Smart 7688 development board (based on an MT7688 SoC) powered by OpenWRT and faced issues with accessing serial ports from Linux. Debug console mapped to an UART2 (/dev/ttyS2) works fine, but other ports (/dev/ttyS0, /dev/ttyS1) do not. We tried to join Tx and Rx of both UART1 and UART2 and get an echo by using, I guess, a standard way to check a serial port on Linux (cat /dev/ttyS1 &; echo wassup > /dev/ttyS1), but nothing happened (we see no output). We used a standard image provided by labs.mediatek.com and an image we built from the latest OpenWRT sources, results are the same - serial ports don't work. Settings, checked by stty, are the same for all /dev/ttyS0,1,2 serial ports.
Documentation about a LinkIt Smart 7688 Duo development board (it's a LinkIt Smart 7688 board with an additional ATmega32U4 micro-controller) from labs.mediatek.com states that communication between MT7688 and ATmega32U4 is carried out by a serial connection (UART1 on an MT7688 side). We have no such a board to check it, but it'd be strange if a serial connection worked on a LinkIt Smart 7688 Duo board and didn't work on a LinkIt Smart 7688 one, as they have the same OpenWRT image, as we know.
As we got, the fact that /dev/ttyS0, /dev/ttyS1 files exist means that Linux's serial subsystem properly read a device tree configuration (provided by OpenWRT maintainers for this board) and configured everything related to pin multiplexing, irqs, peripherals powering. Is our assumption right?
It's kind of strange that there's nothing about this issue in the Internet, it seems that there's some problem with our development board (hardware part) or maybe we don't understand how to check/work with serial ports in Linux at all.
Did you face the same issue on LinkIt Smart 7688 boards? Can you advise some tools to check a serial connection on Linux?
Thanks in advance for any help...
I use the LinkitSmart and Duo as well as HLK-7688 (very similar modules).
The serial port hardware exists and is working, but the external pins are shared with the ethernet switch ports. The MT7688 has 5 ethernet ports.
(One of the serial ports is also connected to the Atmel CPU on the Duo, rather than the outside pins. )
To get S0 and S1 working you will need to control the pin multiplexor - however since I have never done that, I can't tell you how it's done.
Try playing around with "switch list" and "switch disbable ..." commands. But I'm not sure they control the multiplexor too.
Also, the OpenWRT image on these devices is very old (Barrier Breaker, or Chaos Calmer probably). Have you considered the security implications of that?
As we got, a LinkIt Smart 7688 board is directly supported by OpenWRT community, so we're going to use the latest OpenWRT sources :)