I have a Respeaker Core v2.0 and I would like to use the UART interface (this board has a USB to TTL adapter connected to the Uart port) in order to make this board communicate with another one.
SETUP [ EDITED ]
I have plugged a serial to TTL converter to laptop and connected it to the TX, RX and GND pins of the RespeakerCore. I then opened a miniterm console (with the right baudrate and port settings) on my laptop and another one on the Respeaker. I powered on the Respeaker and the following appears on miniterm:
Starting kernel ... [ 0.065704] /cpus/<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9cad9dce9cf9999">[email protected]</a> missing clock-frequency property [ 0.071689] /cpus/<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cdaebdb88dabfdfc">[email protected]</a> missing clock-frequency property [ 0.077712] /cpus/<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0b3a0a590b6e0e2">[email protected]</a> missing clock-frequency property [ 0.083677] /cpus/<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e0839095a086d0d3">[email protected]</a> missing clock-frequency property [ 0.829278] rk-vcodec 20020000.vpu-service: could not find power_model node [ 0.856875] rockchip-vop 20050000.vop: invalid resource [ 0.862758] rockchip-vop 20050000.vop: invalid resource [ 0.868586] rockchip-vop 20050000.vop: missing rockchip,grf property [ 0.876380] i2c i2c-0: of_i2c: modalias failure on /<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0f676b62664f3d3f3f6e3f3f3f3f">[email protected]</a>/ports [ 2.037851] cpu cpu0: Failed to get pvtm [ 2.122396] rockchip-dmc dmc: Failed to get pvtm [ 2.128437] rockchip-dmc dmc: failed to get vop bandwidth to dmc rate [ 2.139954] rknandbase v1.2 2018-05-08 [ 2.612237] rk_gmac-dwmac 30200000.ethernet: Can not read property: tx_delay. [ 2.620241] rk_gmac-dwmac 30200000.ethernet: set tx_delay to 0x30 [ 2.627017] rk_gmac-dwmac 30200000.ethernet: Can not read property: rx_delay. [ 2.635007] rk_gmac-dwmac 30200000.ethernet: set rx_delay to 0x10 [ 2.642046] rk_gmac-dwmac 30200000.ethernet: cannot get clock clk_mac_speed [ 5.638765] get ac108 regulator name failed [ 5.749516] get ac108 regulator name failed [ 5.760861] mali-utgard 20001000.gpu: Failed to get pvtm [ 5.938710] devfreq 20001000.gpu: Couldn't update frequency transition information. [ 6.153327] ac108_write error->[REG-0x00,val-0x12] [ 6.175033] ac108_write error->[REG-0x00,val-0x12] [ 9.971169] rk_gmac-dwmac 30200000.ethernet: rk_get_eth_addr: mac address: 72:1c:0a:8e:4a:4a Debian GNU/Linux 9 glutamate ttyS2 respeaker.io Debian Image 20180801 Support/FAQ: http://respeaker.io glutamate login:
The TX and RX pins are used as serial console.
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6838593849db6919a8382979b978293">[email protected]</a>:~$ setserial -g /dev/ttyS[0123] /dev/ttyS0, UART: 16550A, Port: 0x0000, IRQ: 29 /dev/ttyS1, UART: 16550A, Port: 0x0000, IRQ: 30 /dev/ttyS2, UART: 16550A, Port: 0x0000, IRQ: 31 /dev/ttyS3, UART: unknown, Port: 0x0000, IRQ: 0
And there is one service that is using the ttyS2 device I am interested about.
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="71040214031a31161d0405101c100514">[email protected]</a>:~$ sudo systemctl status | grep tty
│ ├─system-serialx2dgetty.slice
│ │ ├─<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a8dbcddac1c9c485cfcddcdcd1e8dcdcd1fb9a86dbcddadec1cbcd">[email protected]</a>
│ │ │ └─721 /sbin/agetty --keep-baud 115200,38400,9600 ttyS2 vt220
│ │ └─<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a594f58434b46074d4f5e5e536a5e5e536d791a04594f585c43494f">[email protected]</a>
│ │ └─747 /sbin/agetty --keep-baud 115200,38400,9600 ttyGS0 vt220
│ │ └─767 brcm_patchram_plus --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmware/bcm43438a0.hcd /dev/ttyS1
│ ├─system-getty.slice
│ │ └─<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddbab8a9a9a49da9a9a4ecf3aeb8afabb4beb8">[email protected]</a>
│ │ └─720 /sbin/agetty --noclear tty1 linux
│ ├─1050 grep tty
What I have tried
I tried to stop the service with the following command:
sudo systemctl stop <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb988e99828a87c68c8e9f9f92ab9f9f92b8d9c5988e999d82888e">[email protected]</a>
but after 5 seconds it automatically restarts.
The problem
After a short period of time the system starts sending the console output again to the ttyS2 port.
Is it possible to completely remove the serial console linked to ttyS2?
Solution
Just Stop and disable the service:
sudo systemctl stop <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0c3d5c2d9d1dc9dd7d5c4c4c9f0c4c4c9e3829ec3d5c2c6d9d3d5">[email protected]</a> sudo systemctl disable <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6112041308000d4c06041515182115151832534f12041317080204">[email protected]</a>
and the communication works in both directions.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You are looking in the wrong place.
The fundamental configuration item that drives this is the console setting that one gives on the command line to the kernel via the boot loader. It’s that that tells the generator what serial console services to start. It is that that tells the kernel where to send kernel console output. It is that that tells the kernel where to send /dev/console output. If you do not want your serial device to be a console, it is that that you need to adjust.
However, notice that you do not have a [email protected] service. You have a [email protected] service and a [email protected] service. So the system thinks that ttyGS0 is your serial console device, and apparently already does not think that ttyS2 is.
You probably made [email protected] by hand at some point. It is not something that systemd makes as standard; because it is incorrect. The [email protected] template is not suitable for serial devices, and is designed for kernel virtual terminal devices. Note that the correct template, [email protected], has been instantiated against the other device that the system does think to be your console.
So disable [email protected].
Further reading
- unix.stackexchange.com/questions/447070/serial-getty-error-messages/447098#447098
- unix.stackexchange.com/questions/248287/how-can-i-stop-auto-login-console-and-getty-in-raspbian-jessie/248313#248313
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0