Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
How to enable serial console?
How to enable serial console?
Hi,
I am new to Debian, but I have been using some other distros in the past (Arch, Ubuntu, Raspberry Pi), long time ago.
I want to enable serial console in Debian 10 (it's running on SBC - ASUS TinkerBoard).
My understanding is that I need to find the boot config file, which is in /boot/config-*
However, I only saw one file: /boot/config.txt
I enabled the uart interface, and also added console=tty1,115200n8 - still doesn't work.
Could someone give me some pointers?
Thanks in advance.
I am new to Debian, but I have been using some other distros in the past (Arch, Ubuntu, Raspberry Pi), long time ago.
I want to enable serial console in Debian 10 (it's running on SBC - ASUS TinkerBoard).
My understanding is that I need to find the boot config file, which is in /boot/config-*
However, I only saw one file: /boot/config.txt
I enabled the uart interface, and also added console=tty1,115200n8 - still doesn't work.
Could someone give me some pointers?
Thanks in advance.
-
- Posts: 1406
- Joined: 2009-09-10 20:15
- Location: Saint-Petersburg, Russian Federation
- Been thanked: 11 times
Re: How to enable serial console?
Far example, man stty, man cu. stty is for tweaking, cu for input/output.
Peter.
Peter.
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
@sereneguy:
Is this [1] your board ?
According to what is reported at [2]:
Have you configured the kernel boot parameter "console=ttyS3,115200n8" ?
[1] https://www.asus.com/networking-iot-ser ... ker-board/
[2] https://tinkerboarding.co.uk/wiki/index.php/Hardware
Is this [1] your board ?
According to what is reported at [2]:
Have you tried to connect to the appropriate GPIO pins using a four pin serial-to-usb adapter ?UART
Connecting a serial adapter to UART3 of the Asus Tinker-Board
The default serial console is UART3, 115200 baud, 8N1 (8bit, no parity, 1 stop bit), no software flow control (Xon/Xoff), no hardware flow control.
A "Prolific Technology, Inc. PL2303 Serial Port (067b:2303)" USB adapter can be used.
The relevant kernel parameter is console=ttyS3,115200n8
Have you configured the kernel boot parameter "console=ttyS3,115200n8" ?
[1] https://www.asus.com/networking-iot-ser ... ker-board/
[2] https://tinkerboarding.co.uk/wiki/index.php/Hardware
Re: How to enable serial console?
Hi Aki,Aki wrote: ↑2021-08-19 08:31 @sereneguy:
Is this [1] your board ?
According to what is reported at [2]:Have you tried to connect to the appropriate GPIO pins using a four pin serial-to-usb adapter ?UART
Connecting a serial adapter to UART3 of the Asus Tinker-Board
The default serial console is UART3, 115200 baud, 8N1 (8bit, no parity, 1 stop bit), no software flow control (Xon/Xoff), no hardware flow control.
A "Prolific Technology, Inc. PL2303 Serial Port (067b:2303)" USB adapter can be used.
The relevant kernel parameter is console=ttyS3,115200n8
Have you configured the kernel boot parameter "console=ttyS3,115200n8" ?
[1] https://www.asus.com/networking-iot-ser ... ker-board/
[2] https://tinkerboarding.co.uk/wiki/index.php/Hardware
Yes, it's my board. It's the 2S model, which is fairly new, and many information I saw aren't applicable to this model.
Yes, I use FTDI, and Putty on the PC side. I tested my setup with my Pi (to ensure it works).
My question is, how to modify kernel boot parameter. I modified /boot/config.txt, and added "console=tty1,115200n8".
I am not sure if config.txt is the right place, that's why I posted this.
Re: How to enable serial console?
Hi Peter, I tried to modify the kernel boot param.peter_irich wrote: ↑2021-08-19 04:17 Far example, man stty, man cu. stty is for tweaking, cu for input/output.
Peter.
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
@sereneguy:
Hope that it helps.
[1] https://tinkerboarding.co.uk/wiki/index.php/Hardware
[2] https://tinkerboarding.co.uk/wiki/index ... _log_setup
According to the documentation in "Thinker board wiki" [1], the section "console log setup" (see [2]) explains how to do it and it reports:
In both cases (Debian image before V2.0.4 and Debian image after V2.0.5), it is documented to modify the extlinux.conf file (in extlinux directory on the SD card where the Debian operating system is stored) to configure the kernel console parameter.console log setup
For the Debian image before V2.0.4 and Android image before android_20171115_v13.12.0.43
Please reference https://tinkerboarding.co.uk/wiki/image ... _1.0.3.pdf
For the Debian image after V2.0.5 and Android image after android_20180206_v13.13.0.74
Please reference https://tinkerboarding.co.uk/wiki/image ... _1.0.6.pdf
Hope that it helps.
[1] https://tinkerboarding.co.uk/wiki/index.php/Hardware
[2] https://tinkerboarding.co.uk/wiki/index ... _log_setup
Re: How to enable serial console?
Hi Aki,Aki wrote: ↑2021-08-20 08:17 @sereneguy:According to the documentation in "Thinker board wiki" [1], the section "console log setup" (see [2]) explains how to do it and it reports:In both cases (Debian image before V2.0.4 and Debian image after V2.0.5), it is documented to modify the extlinux.conf file (in extlinux directory on the SD card where the Debian operating system is stored) to configure the kernel console parameter.console log setup
For the Debian image before V2.0.4 and Android image before android_20171115_v13.12.0.43
Please reference https://tinkerboarding.co.uk/wiki/image ... _1.0.3.pdf
For the Debian image after V2.0.5 and Android image after android_20180206_v13.13.0.74
Please reference https://tinkerboarding.co.uk/wiki/image ... _1.0.6.pdf
Hope that it helps.
[1] https://tinkerboarding.co.uk/wiki/index.php/Hardware
[2] https://tinkerboarding.co.uk/wiki/index ... _log_setup
Yes, I saw/reviewed those references before. The problem is, none of them applies to TinkerBoard 2S that I have right now.
The only Debian image available for my board are only Debian 9 (V1.0.7) and Debian 10 (V2.0.0):
- None of them has extlinux.conf like what the instruction said
- None of them has USB storage when I connected the board to Windows - no accessible partition visible from Windows (I used terminal to access /boot and only saw config.txt)
It's like for this new board, TinkerBoard 2S, they changed the Debian image radically, and there is no documentation or discussion for this particular board yet.
Any other idea?
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hello,
To better understand, I downloaded the SD disk image from ASUS thinker site, called Tinker_Board_2-Debian-Buster-v2.0.0-20210413.zip: is the image that are you using ?
This zip file contains the following image file:
This Tinker_Board_2-Debian-Buster-v2.0.0-20210413.img image file contains the following partitions:
After transferring the image to the SD, Debian recognize two partitions (named "userdata" and "rootfs") in it.
These are the contents of "roofs":
These are the contents of "userdata":
The config.txt probably should be updated to enable the specific used UART.
The cmdline.txt perhaps contains the boot kernel parameters.
To better understand, I downloaded the SD disk image from ASUS thinker site, called Tinker_Board_2-Debian-Buster-v2.0.0-20210413.zip: is the image that are you using ?
This zip file contains the following image file:
Code: Select all
Tinker_Board_2-Debian-Buster-v2.0.0-20210413.img
Code: Select all
$ mmls Tinker_Board_2-Debian-Buster-v2.0.0-20210413.img
GUID Partition Table (EFI)
Offset Sector: 0
Units are in 512-byte sectors
Slot Start End Length Description
000: Meta 0000000000 0000000000 0000000001 Safety Table
001: ------- 0000000000 0000016383 0000016384 Unallocated
002: Meta 0000000001 0000000001 0000000001 GPT Header
003: Meta 0000000002 0000000033 0000000032 Partition Table
004: 000 0000016384 0000024575 0000008192 uboot
005: 001 0000024576 0000032767 0000008192 trust
006: 002 0000032768 0000040959 0000008192 misc
007: 003 0000040960 0000106495 0000065536 boot
008: 004 0000106496 0000172031 0000065536 recovery
009: 005 0000172032 0000237567 0000065536 backup
010: 006 0000237568 0000368639 0000131072 userdata
011: 007 0000368640 0008056567 0007687928 rootfs
After transferring the image to the SD, Debian recognize two partitions (named "userdata" and "rootfs") in it.
These are the contents of "roofs":
Code: Select all
$ ls -l 9d8e2803-1083-4cb6-993f-1e1c3f83b6ac
total 23660
drwxr-xr-x 2 root root 4096 13 apr 05.30 bin
drwxr-xr-x 2 root root 4096 22 nov 2020 boot
drwxr-xr-x 4 root root 4096 19 gen 2021 dev
drwxr-xr-x 110 root root 4096 13 apr 05.50 etc
drwxr-xr-x 3 root root 4096 19 gen 2021 home
drwxr-xr-x 16 root root 4096 13 apr 05.50 lib
drwx------ 2 root root 16384 13 apr 05.50 lost+found
-rw-r--r-- 1 root root 4547234 19 gen 2021 md5sum.txt
drwxr-xr-x 2 root root 4096 19 gen 2021 media
drwxr-xr-x 2 root root 4096 19 gen 2021 mnt
drwxr-xr-x 2 root root 4096 19 gen 2021 opt
drwxr-xr-x 15 root root 4096 13 apr 05.28 packages
drwxr-xr-x 2 root root 4096 22 nov 2020 proc
-rw-r--r-- 1 root root 9789440 19 gen 2021 qemu_gdk-pixbuf-query-loaders_20210119-145338_2682.core
-rw-r--r-- 1 root root 9789440 19 gen 2021 qemu_gdk-pixbuf-query-loaders_20210119-145653_7472.core
drwx------ 2 root root 4096 19 gen 2021 root
drwxr-xr-x 7 root root 4096 19 gen 2021 run
drwxr-xr-x 2 root root 4096 19 gen 2021 sbin
drwxr-xr-x 2 root root 4096 19 gen 2021 srv
drwxr-xr-x 2 root root 4096 22 nov 2020 sys
drwxr-xr-x 4 root root 4096 13 apr 05.29 system
drwxrwxrwt 2 root root 4096 13 apr 05.50 tmp
drwxr-xr-x 10 root root 4096 19 gen 2021 usr
drwxr-xr-x 11 root root 4096 19 gen 2021 var
Code: Select all
$ ls -l c42c86b8-2a11-423a-bb32-17b59d0fe66a
total 286
-rwxrwxr-x 1 root root 87402 8 mar 03.28 200frames_count.h264
-rwxrwxr-x 1 root root 81582 8 mar 03.28 belle-nuit-testchart-1080p.png
-rw-rw-r-- 1 root root 58 8 mar 03.28 cmdline.txt
-rw-rw-r-- 1 root root 1550 8 mar 03.28 config.txt
drwx------ 2 root root 12288 13 apr 06.09 lost+found
drwxrwxr-x 2 root root 2048 13 apr 06.09 overlays
-rwxrwxr-x 1 root root 101760 8 mar 03.28 piano2-CoolEdit.mp3
The cmdline.txt perhaps contains the boot kernel parameters.
Re: How to enable serial console?
Hi Aki,
Yes, I already modified config.txt as I mentioned in my first post.
I just added "console=ttyS1,115200n8" to cmdline.txt too, still not working.
Btw, the cmdline.txt was empty, it has that line I added.
Did I miss something?
Yes, I already modified config.txt as I mentioned in my first post.
I just added "console=ttyS1,115200n8" to cmdline.txt too, still not working.
Btw, the cmdline.txt was empty, it has that line I added.
Did I miss something?
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hello,
The config.txt should be configured according to [1] as shown in page 11 to activate the UART. Therefore, the configuration "console=ttyS1,115200n8" does not apply to config.txt.
Configure config.txt to activate the UART and reboot the board. After the boot, the board UART should be active,
[1] https://tinker-board.asus.com/images/do ... tarted.pdf
The config.txt should be configured according to [1] as shown in page 11 to activate the UART. Therefore, the configuration "console=ttyS1,115200n8" does not apply to config.txt.
Configure config.txt to activate the UART and reboot the board. After the boot, the board UART should be active,
[1] https://tinker-board.asus.com/images/do ... tarted.pdf
Re: How to enable serial console?
Thank you so much. I never thought they would put information in other board (Edge R).Aki wrote: ↑2021-08-21 09:49 Hello,
The config.txt should be configured according to [1] as shown in page 11 to activate the UART. Therefore, the configuration "console=ttyS1,115200n8" does not apply to config.txt.
Configure config.txt to activate the UART and reboot the board. After the boot, the board UART should be active,
[1] https://tinker-board.asus.com/images/do ... tarted.pdf
So, yes, I have UART1 works now.
Even though the UART1 works (I can write application to send and receive data via UART - by initializing it via periphery), but the console still doesn't work on UART1.
Do you know where "console=ttyS1, 115200n8" should go? I dug the source code, /boot/cmdline.txt is for Android only.
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hello sereneguy,
I’m happy the situation is improved.
The UART for terminal console should be tty3 (UART 3, I suppose, counting from zero) according to the available documentation. Therefore, you should activate also UART 3 from configuration file config.txt (see my previous message) before trying to connect to it.
The only specification found so far about kernel parameters is here [1], but this require accessing the console boot loader before booting the operating system. Further specifications are here [2]:
Have you checked if the serial ports are detected by Linux after booting on the SBC at the software/hardware level ?
[1] https://wiki.debian.org/U-boot/
[2] https://github.com/TinkerBoard/debian_u-boot
[3] https://u-boot.readthedocs.io/en/latest/
I’m happy the situation is improved.
The UART for terminal console should be tty3 (UART 3, I suppose, counting from zero) according to the available documentation. Therefore, you should activate also UART 3 from configuration file config.txt (see my previous message) before trying to connect to it.
The only specification found so far about kernel parameters is here [1], but this require accessing the console boot loader before booting the operating system. Further specifications are here [2]:
More info about "The U-Boot Documentation" is here [3].Boot Linux:
-----------
The "bootm" command is used to boot an application that is stored in
memory (RAM or Flash). In case of a Linux kernel image, the contents
of the "bootargs" environment variable is passed to the kernel as
parameters. You can check and modify this variable using the
"printenv" and "setenv" commands:
=> printenv bootargs
bootargs=root=/dev/ram
=> setenv bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
=> printenv bootargs
bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
=> bootm 40020000
## Booting Linux kernel at 40020000 ...
Image Name: 2.2.13 for NFS on TQM850L
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 381681 Bytes = 372 kB = 0 MB
Load Address: 00000000
Entry Point: 0000000c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:35:17 MEST 2000
Boot arguments: root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
time_init: decrementer frequency = 187500000/60
Calibrating delay loop... 49.77 BogoMIPS
Memory: 15208k available (700k kernel code, 444k data, 32k init) [c0000000,c1000000]
...
If you want to boot a Linux kernel with initial RAM disk, you pass
the memory addresses of both the kernel and the initrd image
Have you checked if the serial ports are detected by Linux after booting on the SBC at the software/hardware level ?
[1] https://wiki.debian.org/U-boot/
[2] https://github.com/TinkerBoard/debian_u-boot
[3] https://u-boot.readthedocs.io/en/latest/
Re: How to enable serial console?
Hi,
The board I have, the 2S, doesn't have uart3. The document you referred in the previous post was for different board, Edge R.
Please see attached.
The board I have, the 2S, doesn't have uart3. The document you referred in the previous post was for different board, Edge R.
Please see attached.
- Attachments
-
- Tinker2S.png (309.34 KiB) Viewed 9290 times
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hello Sereneguy,
I'm sorry that I misunderstood the UART number you are interested in.
I try to recap the documentation supplied by the manufacturer for your board with Debian OS from [0]:
- Quick Start Guide [1]
- User Manual [2]
- Drawing and Schematics [3]
- Qualified vendor list [4]
- Download Software [5]
- Source Code for uboot and Linux Kernel [6[[8][9].
Some questions.
What are the contents of your config.txt ?
Have you modified the file config.txt in the userdata partiotion in the SD to activate UART4 as shown in [7] (even if for the different Model Tinker_Edge_R) ? The current switchable functions are listed below and I suppose should defined as shown below:
Code: Select all
##### Hardware Interface Config #####
## Note: uart4 and spi1 are the same pins. Set the latter one while both on.
##
## Note: fiq_debugger and uart0 use the same pin. Set fiq_debugger first while both on.
#
intf:fiq_debugger=on
intf:uart0=on
intf:uart4=on
# intf:i2c6=off
# intf:i2c7=off
# intf:i2s0=off
# intf:spi1=off
# intf:spi5=off
# intf:pwm0=off
# intf:pwm1=off
# intf:pwm3a=off
Then, as you can see in the user manual [2], there is also a "Debug UART header" for which is reported:
Therefore, have you tried to connect to this header ?This Debug UART header provides a separate UART port, allowing developers to use and develop with the
serial console without occupying the 40-pin GPIO’s UART ports.
Thus, have you tried to verify which are the UARTS detected by Debian after booting ? You can check it, for example, with some commands as user root typed from the Tinker Board console, for example:
Code: Select all
script log.txt
apt install setserial
dmesg | grep tty
systemctl | grep tty
setserial -gv
exit
The setup/configuration of console should also be done after kernel loading (from Debian) using, for example, the setserial command.
[0] https://tinker-board.asus.com/documentation.html
[1] https://tinker-board.asus.com/doc_tb2.html#qsg
[2] https://tinker-board.asus.com/doc_tb2.html#user
[3] https://tinker-board.asus.com/doc_tb2.html#schematics
[4] https://tinker-board.asus.com/doc_tb2.html#qvl
[5] https://tinker-board.asus.com/download- ... r-board-2s
[6] https://github.com/TinkerBoard2
[7] https://tinker-board.asus.com/images/do ... tarted.pdf
[8] https://github.com/TinkerBoard/debian_u-boot
[9] https://github.com/TinkerBoard/debian_kernel
Re: How to enable serial console?
Hello Aki,
This is what I modified on my config.txt:
I disabled fiq_debugger simply because on different model (I think Edge R), it says that uart0 is shared with fiq_debugger.
Yes, I have been using that GPIO header.
Debug UART works, and uart0 works (but I initialized it with Periphery).
My bottom line question is, where the "setup/configuration of console after kernel loading" took place? Which file I should modify to setup console after kernel loading?
This is what I modified on my config.txt:
Code: Select all
intf:fiq_debugger=off
intf:uart0=on
Yes, I have been using that GPIO header.
Debug UART works, and uart0 works (but I initialized it with Periphery).
uart0 has been working, the only problem I have right now is that I don't have console on uart0.The setup/configuration of console should also be done after kernel loading (from Debian) using, for example, the setserial command.
My bottom line question is, where the "setup/configuration of console after kernel loading" took place? Which file I should modify to setup console after kernel loading?
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hi sereneguy,
I suppose there is a misunderstanding. You are talking about /boot/config.txt in the partition named rootfs on the memory card, while I was taking about cmdline.txt in the partition named userdata on the same memory card (where the operationg system is stored). As shown in one of my previous message, the disk image contains several partitions:
Code: Select all
$ mmls Tinker_Board_2-Debian-Buster-v2.0.0-20210413.img
GUID Partition Table (EFI)
Offset Sector: 0
Units are in 512-byte sectors
Slot Start End Length Description
000: Meta 0000000000 0000000000 0000000001 Safety Table
001: ------- 0000000000 0000016383 0000016384 Unallocated
002: Meta 0000000001 0000000001 0000000001 GPT Header
003: Meta 0000000002 0000000033 0000000032 Partition Table
004: 000 0000016384 0000024575 0000008192 uboot
005: 001 0000024576 0000032767 0000008192 trust
006: 002 0000032768 0000040959 0000008192 misc
007: 003 0000040960 0000106495 0000065536 boot
008: 004 0000106496 0000172031 0000065536 recovery
009: 005 0000172032 0000237567 0000065536 backup
010: 006 0000237568 0000368639 0000131072 userdata <=====
011: 007 0000368640 0008056567 0007687928 rootfs
Code: Select all
root@debian:# mkdir mnt
root@debian:# mount -t ext2 -o loop,offset=121634816 Tinker_Board_2-Debian-Buster-v2.0.0-20210413.img mnt/
root@debian:# cd mnt/
root@debian:# ls -l
total 286
-rwxrwxr-x 1 root root 87402 8 mar 03.28 200frames_count.h264
-rwxrwxr-x 1 root root 81582 8 mar 03.28 belle-nuit-testchart-1080p.png
-rw-rw-r-- 1 root root 58 8 mar 03.28 cmdline.txt <=====
-rw-rw-r-- 1 root root 1550 8 mar 03.28 config.txt
drwx------ 2 root root 12288 13 apr 06.09 lost+found
drwxrwxr-x 2 root root 2048 13 apr 06.09 overlays
-rwxrwxr-x 1 root root 101760 8 mar 03.28 piano2-CoolEdit.mp3
The serial device must be activated at hardware and firmware level before booting the kernel (probably by uboot). Then, the serial device is detected and eventually configured at kernel level (at boot using the console parameter or after boot at user level with specific commands, as showed in a my previous message). After serial device configuration, the console is configured at operating system (OS) level by system services. Your Debian installation uses systemd, so you can see here [1]. Therefore the serial device must recognized by OS before the serial console configuration by the OS itself.
Have you analyzed Debian system logs as suggested in my previous message ? Is the serial device corresponding to UART4 is detected by kernel ?
Have you available a Debian/Linux installation on you “primary” (desktop/notebook) computer ?
HTH
[1] http://0pointer.de/blog/projects/serial-console.html
-
- Global Moderator
- Posts: 3060
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 415 times
Re: How to enable serial console?
Hi Aki,
Thank you for your answers and for checking on me. I have been focusing on other distros for this board as I needed to enable a feature in the kernel and it lacked of documentation in rebuilding the kernel.
Actually both of the config.txt and cmdline.txt that I was talking about are in the same directory (/boot).
But anyway, I don't need the console anymore as I switched the approach to achieve what I need.
A side note, I got the answer from Tinkerboard engineer. in how to enable UART at startup.
It's by adding it to the "overlay" in config.txt
I need to replace
Code: Select all
overlay=
Code: Select all
overlay=console-uart0-overlay