Linux Mint: Serial port name bug on fitlet2 with Atom CPU

From fit-PC wiki
Jump to: navigation, search
  • This document is applicable to fitlet2 configured with Intel(R) Atom(TM) E3XXX CPU running Linux.
  • It provides an explanation to workaround a bug related to the serial port's name change in certain Kernels.

Serial port name bug

  • There was a bug with serial port name in Linux on Intel(R) Atom(TM) E3XXX platforms
  • On Linux Mint it appears in kernels 4.15 to 5.4 and fixed starting from kernel 5.8
  • For example, on Linux Mint 19 with kernel 4.15 serial port initially detected as /dev/ttyS6, but then device node is absent in the /dev/ directory

https://bugs.launchpad.net/ubuntu/+source/linux-oem/+bug/1769610

  • Depending on Linux distribution and kernel version serial port name can be: /dev/ttyS6 or /dev/ttyHS1 or something similar or just unavailable


Temporary solution

  • Ensure latest BIOS is installed: Fitlet2:_BIOS_Files
  • Install development Ubuntu kernel provided by Canonical Kernel Team
$ sudo add-apt-repository ppa:canonical-kernel-team/ppa
$ sudo apt update
$ sudo apt install linux-oem
$ sudo reboot
  • Missing device node /dev/ttyS6 will appear now as /dev/ttyHS1
# Test with serial loopback cable:
$ sudo -i
$ echo "12345678" > /dev/ttyHS1
$ cat /proc/tty/driver/serial | grep -v unknown
serinfo:1.0 driver revision:
4: uart:16550A mmio:0x7FFFF10000 irq:4 tx:0 rx:0
5: uart:16550A mmio:0x7FFFF0E000 irq:5 tx:0 rx:0 RTS|CTS|DTR
6: uart:16550A mmio:0x281011000 irq:6 tx:10 rx:10 RTS|DTR
7: uart:16550A mmio:0x7FFFF0C000 irq:7 tx:0 rx:0 CTS

Compile custom kernel

  • The above temporary solution works for Ubuntu based distributions like Linux Mint, for other distributions, see below.
  • Another way is to get serial port working is to recompile your kernel manually and unset CONFIG_SERIAL_DEV_BUS in menuconfig
  • The configuration path: Device Drivers > Character devices > Serial device bus
 > Device Drivers > Character devices ─────────────────────────────────────────────────────────────────
  ┌─────────────────────────────────────── Character devices ───────────────────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty submenus ----).         │  
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, <M> modularizes         │  
  │  features.  Press <Esc><Esc> to exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]  │  
  │  excluded  <M> module  < > module capable                                                       │  
  │ ┌───────────^(-)──────────────────────────────────────────────────────────────────────────────┐ │  
  │ │           <M>   GSM MUX line discipline support (EXPERIMENTAL)                              │ │  
  │ │           < >   Trace data sink for MIPI P1149.7 cJTAG standard                             │ │  
  │ │           [*]   Automatically load TTY Line Disciplines                                     │ │  
  │ │           [*] /dev/mem virtual device support                                               │ │  
  │ │           [ ] /dev/kmem virtual device support                                              │ │
  │ │               Serial drivers  --->                                                          │ │  
  │ │           < > Serial device bus  ----                                                       │ │  
  │ │           <M> TTY driver to output user messages via printk                                 │ │  
  │ │           <M> Parallel printer support                                                      │ │  
  │ │           [ ]   Support for console on line printer                                         │ │  
  │ └───────────┴(+)──────────────────────────────────────────────────────────────────────────────┘ │  
  ├─────────────────────────────────────────────────────────────────────────────────────────────────┤  
  │                    <Select>    < Exit >    < Help >    < Save >    < Load >                     │  
  └─────────────────────────────────────────────────────────────────────────────────────────────────┘  
  • We've build example .deb kernel packages for Debian 10, missing device node will appear as /dev/ttyS2:
# Download and install the kernel packages:
$ wget https://fit-iot.com/files/download/fitlet2/sw/images/Linux/Kernel-packages/linux-headers-4.19.67-compulab.2019.09.11_4.19.67-compulab.2019.09.11-1_amd64.deb
$ wget https://fit-iot.com/files/download/fitlet2/sw/images/Linux/Kernel-packages/linux-image-4.19.67-compulab.2019.09.11_4.19.67-compulab.2019.09.11-1_amd64.deb
$ sudo dpkg -i linux-headers-* linux-image-*
$ sudo reboot

# Test CONFIG_SERIAL_DEV_BUS variable:
$ cat /boot/config-4.19.67-compulab.2019.09.11 | grep CONFIG_SERIAL_DEV_BUS
# CONFIG_SERIAL_DEV_BUS is not set

# Test with serial loopback cable:
$ sudo -i
$ echo "12345678" > /dev/ttyS2
$ cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A mmio:0x7FFFF10000 irq:4 tx:0 rx:0
1: uart:16550A mmio:0x7FFFF0E000 irq:5 tx:0 rx:0 CTS
2: uart:16550A mmio:0x180000000 irq:6 tx:10 rx:10
3: uart:16550A mmio:0x7FFFF0C000 irq:7 tx:0 rx:0 CTS