原创 Enabling Six Serial Ports on the EPM-32 Under Debi

2011-6-14 21:39 2087 9 7 分类: MCU/ 嵌入式
 
Categories: Single Board Computers (EBX, PC/104)
Keywords: 1550 linux howto
Product Versions: EPM-32
Platforms: Debian Linux (Etch)
Last Modified: 2/29/2008 3:14:30 PM PST

 

How To:

Configure the EPM-32 (Cheetah) and PCM-3640 serial add-on board to use six serial ports under Debian Etch.

Background:

The PCM-3640 is a PC/104-compatible four-port RS-232 serial interface module. The default serial port configuration of the PCM-3640 may conflict with the default configuration of the EPM-32. This article describes the process of enabling all four serial ports of the PCM-3640 plus the two built-in serial ports of the EPM-32 using Debian Etch.

Procedure:

Configure the PCM-3640 Serial Board

Refer to the figure below when configuring the PCM-3640 serial board.

  1. Set DIPSWI switches 1 through 6 (A3 through A8) to the On position.
  2. Set the MODE switch to the Off position.
  3. Jumper port 1 (JP1) for IRQ 4.
  4. Jumper port 2 (JP2) for IRQ 3.
  5. Jumper port 3 (JP3) for IRQ 5.
  6. Jumper port 4 (JP4) for IRQ 7.

Cheetah_jumper_settings.jpg

Configure the EPM-32 in CMOS

  1. Start the EPM-32 and press Delete to enter CMOS Setup.
  2. In CMOS Setup, select Custom Configuration.
  3. On the right side, configure COM1 and COM2 as follows:

    • COM1 (0x3f8) Enable/IRQ :IRQ9
    • COM2 (0x2f8) Enable/IRQ :IRQ10

Configure Bootloader (GRUB)
  1. Boot Linux and log in as root or as a user who can execute commands as root via sudo.
  2. Using a text editor, edit /boot/grub/menu.lst by adding 8250.nr_uarts=6 to the end of the arguments passed to the kernel at boot time. This tells the kernel there are six serial ports. The "kernel" entry should look similar to the example shown below:
  • title       Debian GNU/Linux, kernel 2.6.18-4-686
    root        (hd0,0)
    kernel      /boot/vmlinuz-2.6.18-4-686 root=/dev/hdc1 ro 8250.nr_uarts=6
    initrd      /boot/initrd.img-2.6.18-4-686
    savedefault

Note: Updating the kernel via apt-get (Debian linux) will add a new entry to the list of available kernels in /boot/grub/menu.lst which will not contain 8250.nr_uarts=6. It is necessary to manually re-enter this kernel argument in /boot/grub/menu.lst each time the kernel is updated to a new version.

Configure Serial Ports via SetSerial
  1. Install setserial:

    apt-get install setserial

  2. Delete /var/lib/setserial/auoserial.conf.
  3. To configure and activate the serial ports at boot, create /var/lib/setserial/autoserial.conf and add the following:
  • ###################################################################
    # /var/lib/setserial/autoserial.conf
    #
    ###AUTOSAVE###
    ###AUTOSAVE-ONCE###
    #KERNEL
    # Good for 6 COM Ports.
    # /dev/ttyS0-3 on PCM-3640
    # /dev/ttyS4-5 are the Cheetah's built-in COM Ports.
    # SW1 on PCM-3640 has switches 1-6 up and switch 7 is down.

    /dev/ttyS0 uart 16550A port 0x0200 irq 4 baud_base 115200 spd_normal skip_test
    /dev/ttyS1 uart 16550A port 0x0208 irq 3 baud_base 115200 spd_normal skip_test
    /dev/ttyS2 uart 16550A port 0x0210 irq 5 baud_base 115200 spd_normal skip_test
    /dev/ttyS3 uart 16550A port 0x0218 irq 7 baud_base 115200 spd_normal skip_test
    /dev/ttyS4 uart 16550A port 0x03f8 irq 9 baud_base 115200 spd_normal skip_test
    /dev/ttyS5 uart 16550A port 0x02f8 irq 10 baud_base 115200 spd_normal skip_test
    ###################################################################
  • Note: To configure the ports manually, the preceding arguments may be passed to setserial in a script to simplify the serial port initialization.
  1. Reboot to activate the changes to /boot/grub/menu.lst and var/lib/setserial/autoserial.conf.
  2. To verify the serial port settings, use /etc/init.d/setserial -a -g. This will list the I/O addresses, IRQ's and UART type(s) of the configured serial ports.

Related Articles:

VT1551 - Testing Serial Connections with Getty

文章评论0条评论)

登录后参与讨论
我要评论
0
9
关闭 站长推荐上一条 /2 下一条