2

I have a fitlet2 (https://fit-iot.com/web/products/fitlet2/) which has a serial port. I can connect to the serial port of the fitlet2 with screen from my computer (screen /dev/ttyUSB0 115200) and access the BIOS, after I have enabled the "Serial Port Console Redirection" in the BIOS.

I am also able to access the GRUB Bootloader over serial. Access over serial works in various GRUB bootloaders (debian/ubuntu installer, debian installed). But whenever the system is loaded, I can no more access the serial port which I was using.

I tried to activate console redirection in GRUB for the system by editing the boot parameters according to this post https://www.cyberciti.biz/faq/howto-setup-serial-console-on-debian-linux/. Soon I realized that my ttyS0 is somehow not working correctly. Starting to debug my physical serial interfaces I just couldn't find a way to get this to work.

Setserial tells me the following:

/dev/ttyS0, UART: 16550A,  Port: 0x0000, IRQ: 4
/dev/ttyS1, UART: 16550A,  Port: 0x0000, IRQ: 5
/dev/ttyS2, UART: 16550A,  Port: 0x0000, IRQ: 7
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

dmesg | grep tty this:

[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.9.0-8-amd64 root=/dev/mapper/pen--01--vg-root ro console=ttyS0,115200n8 console=tty0,115200n8
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.9.0-8-amd64 root=/dev/mapper/pen--01--vg-root ro console=ttyS0,115200n8 console=tty0,115200n8
[    0.000000] console [tty0] enabled
[    0.000000] console [ttyS0] enabled
[   49.308213] console [ttyS0] disabled
[   49.312635] dw-apb-uart.0: ttyS0 at MMIO 0x81424000 (irq = 4, base_baud = 115200) is a 16550A
[   49.407713] usb 1-8.2: Qualcomm USB modem converter now attached to ttyUSB0
[   49.410489] usb 1-8.2: Qualcomm USB modem converter now attached to ttyUSB1
[   49.411349] usb 1-8.2: Qualcomm USB modem converter now attached to ttyUSB2
[   53.577143] console [ttyS0] enabled
[   54.744793] dw-apb-uart.1: ttyS1 at MMIO 0x81422000 (irq = 5, base_baud = 115200) is a 16550A
[   54.755771] dw-apb-uart.2: ttyS2 at MMIO 0x81420000 (irq = 7, base_baud = 115200) is a 16550A
[  115.902885] ttyS2 - failed to request DMA

Why is ttyS0 disabled and again reenabled? How can I enable it/use it properly?

How can I get my login shell on serial? What am I missing?

1
  • To clarify: This is about booting GRUB on the fitlet2, and serial works while GRUB is active, but stops working as soon as GRUB hands over to the kernel, did I understand that correctly? First step would be to read up on the dw-apb-uart module, and see if you can verify its state. Normally 16550A's are port mapped, not memory mapped, and it's possible setserial doesn't work for memory mapped devices (but better verify this). So you may need some other way to set parameters.
    – dirkt
    Oct 27, 2018 at 8:22

1 Answer 1

0

Soon I realized that my ttyS0 is somehow not working correctly. Starting to debug my physical serial interfaces I just couldn't find a way to get this to work.

In my case, on a fitlet2 with Atom E3950 cpu, ttyS2 is the device node that corresponds with the serial port on the back of the machine. I've been able to use it as a console with the usual console=ttyS2,115200 kernel command line option. I've tested with the current Debian stable kernel (4.19.152-1) and unstable (5.9.11-1).

When using stable, I also see the ttyS2 - failed to request DMA message but it works nevertheless.

On my machine I have:

# cat /proc/tty/driver/serial                                         
serinfo:1.0 driver revision:                                                    
0: uart:16550A mmio:0x7FFFF0E000 irq:4 tx:0 rx:0                                
1: uart:16550A mmio:0x7FFFF0C000 irq:5 tx:0 rx:0 CTS                            
2: uart:16550A mmio:0x480000000 irq:6 tx:1067 rx:38 RTS|CTS|DTR                 
3: uart:16550A mmio:0x7FFFF0A000 irq:7 tx:0 rx:0 CTS

Try as I may, I was not able to get grub to natively use the serial port. As you say, the grub interface is accessible over the serial port when you enable serial console redirection in the firmware but I believe that's through the agency of the firmware driving the serial port. In that mode, configuring grub with terminal console is sufficient to have output on the serial port. Regardless, it works well enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.