Linux Serial Console Setup
This action displays the GRUB pane. If the GRUB pane isn't displayed, ensure that the value of the GRUBTERMINAL line contains serial console (that is, GRUBTERMINAL='serial console'). Rebuild GRUB with grub2-mkconfig -o /boot/grub/grub.cfg. Single-user mode in Oracle Linux.
How to use the APF's serial ports on Linux.
Using a serial console on Linux is much like using a modem; the technology is virtually identical, but instead of using a modem to dial into a remote system, a special serial cable, called a null. Optional: Configure serial port as THE system console. You can use options in /etc/grub.conf to redirect console output to one of your serial ports. This can be handy if you do not have a keyboard or monitor available for the Linux host in question. Configure access to a system using a serial connection, e.g. In order to manually trigger a kernel crash dump. Another Linux system is to be configured to act as the serial console for a server, rather than, say, a data terminal or a Microsoft Windows system. On both systems, the null modem cable is.
- 4Sending/Receiving data
Generalities
On Linux, all serial ports are driven the same way. Only their device nodes are changing to reflect the port type:
- i.MX processor internal ports:
- on APF9328, APF27, APF51 & OPOS6UL: /dev/ttySMXN (with kernels <= 2.6.29) or /dev/ttymxcN (with kernels > 2.6.29)
- on APF28: /dev/ttySP[0-4] (general purpose serial ports) or /dev/ttyAMxx (debug serial ports)
- /dev/ttyUSBN for USB <-> serial converters
- /dev/ttySnN for 16550 compatible FPGA's IP
Console port
- Console port is the default serial port on which you can interact with the board (U-Boot and Linux):
- it is serial port 0 (-> /dev/ttySMX0 or /dev/ttymxc0) on APF9328, APF27 & OPOS6UL
- it is serial port 2 (-> /dev/ttymxc2) on APF51
- it is debug serial port 0 (-> /dev/ttyAM0 (2.6.35 kernel) or /dev/ttyAMA0 (3.x kernels)) on APF28
- So, without software modifications, this port is not available to connect a MODEM or any other RS-232 device. If you want to use it as a normal serial port on Linux then:
- be sure that your device won't send data back in response of U-Boot boot's sequence
- change U-Boot consoledev envt variable, to tell Linux to display console on the LCD (for example):
Changing serial ports configuration
- To get current configuration (adapt serial port device name depending on your board, here ttymxc0):
- To only get actual speed:
- By default serial ports are configured as terminal emulator (canonical mode). If you want to use them as 'raw' serial port you will have to do first (example for port 1):
- To change baudrate of port 2 to 115200 :
Sending/Receiving data
In Linux console
- It is as simple as opening the device as a file and writing data to it:
- To receive data (ASCII in that case):
With terminal (miniterm.py)
By default, a simple terminal named «miniterm.py» is installed in the BSP. To use it on OPOS6UL, launch it with /dev port name and speed :
On OPOS6UL_DEV if Rx/Tx are not in loop, nothing will be prompted on key input. To see something prompted the Rx/Tx must be plugged together with a jumper on RaspberryPi connector (pin 8 and 10).
Linux Serial Console Setup Free
Statistics
- To have some statistics on serial port usage: