Setting up Minicom in Ubuntu

Minicom in Ubuntu

This explains how to configure Minicom, as an alternative to Minicom you may want to consider installing the 'Serial Port Terminal' program instead for a more GUI based terminal application.

  • First you should ensure that minicom is installed (it is not by default), open a terminal window and run minicom, if you get a message about it not existing than you need to install it. To install minicom run sudo apt-get install minicom or select it via System -> Administration -> Synaptic Package Manager.
host $ sudo apt-get install minicom
  • Once minicom is installed it will not be setup to talk properly to a board through the UART port, to change the configuration open up a terminal window and run sudo minicom -s at which point you will have to provide your root password and then you will see the minicom configuration utility.
host $ sudo minicom -s

having -s will prevent minicom from exiting abruptly if it encounter error upon invocation

  • Select serial port setup from the menu and press enter which will give you some options to change, type A to change the serial device, you likely want to set it to /dev/ttyS0 so it accesses your physical UART port though this may vary from PC to PC. You will also want to change any other settings appropriate for your board such as disabling hardware flow control, a typical setup for a Davinci/OMAP EVM should look like the following.
   +-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/ttyS0                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 115200 8N1                                |
   | F - Hardware Flow Control : No                                        |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+


In the configuration screen, there are two items that likely must be configured. The first one is the ‘Serial port setup’ and the second one is the ‘Modem and dialing’.

  • In the serial port setup, choose the right setting for the serial device. Press ‘A’ to navigate to the Serial Device setup, then edit the /dev/ttyXXX to reflect your current system setup. If you are using a USB-to-serial converter, your serial device probably /dev/ttyUSB0. Do a ‘lsusb’ and ‘dmesg | grep usb’ to find out.
  • Next, press ‘E’ to navigate to Bps/Par/Bits. This is the bit rate, parity and stop-bit setting, set it to 115200 8 N 1
  • Then, press ‘F’ and set the Hardware Flow Control to No and then press ‘G’ and set the Software Flow Control to No
  • The next thing to configure is the ‘Modem and dialing’ options. Basically, we don’t want Minicom to regard our serial device as ordinary modem device

Therefore, we have to clear all modem specific settings. To do so, from the serial port setup, press ‘Esc’ to go back to main Minicom setup screen and then choose ‘Modem and dialing’

  • In the Modem and Dialing setting, set everything to nothing, starting from option A (Init string) until I (connect string). This will remove unnecessary initialization code that will be sent to the modem when minicom starts.
  • Hit escape to exit from the serial port setup menu and you will be back at the base minicom setup menu, select save setup as dfl and hit enter to save the minicom settings as the defaults, than select exit and hit enter to start up minicom with the new settings
  • Now you should see anything that is coming in on the UART interface from your board. You should also be able to simply run minicom from a terminal window whenever you want to open the terminal with your board
host $ minicom

Q&A for Minicom

There are some situations you may met in using minicom:

  • Q: Why is error message "Device /dev/ttyUSB0 is locked." shown when executed 'minicom'?

A: It usually occurred by last abnormal colse of minicom. You can fix it by:

#rm /var/lock/LOCK..ttyUSB0
  • Q: Why still show mess message by the above recommended settings totally?

A: Maybe you need to restart mincom program, even reboot the system to avoid those strange situations.

  • Q: Is there another serial terminal utility easier than minicom?

A: Yes, picocom is the alternative tool.

# apt-get install picocom
# picocom /dev/ttyUSB0 -b 115200 -l
(Exit picocom: Ctrl+a, then Ctrl+x)

你可能感兴趣的:(Setting up Minicom in Ubuntu)