ARM embedded system serial port expansion

Publisher:GoldenHarmonyLatest update time:2016-03-31 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
ARM embedded systems often encounter the need for multiple serial ports, but the number of native UARTs in ARM chip systems is limited, so it is necessary to expand more interfaces through other high-speed buses. This article uses Toradex 's Apalis i.MX6D/Q ARM computer module based on NXP i.MX6D/6Q processor to expand 8 serial ports through the EXAR solution under the Linux system.

The Apalis i. MX6D/Q module can support up to 5 UART serial port outputs. Compatible with high-speed TIA/EIA-232F (up to 5Mbit/s). Supports 7, 8 or 9 (for RS485) bits of data, 1 or 2 stop bits. UART1 is a full-featured serial port, and the rest of the serial ports can also support RTS and CTS signals.

In Linux systems, a serial port is usually reserved for application debugging and development and system upgrades. Although functions such as SSH can also be used for remote network access and system debugging, for embedded products, the information when the system starts, especially the Uboot startup information, can help with function debugging and problem location. However, this information can only be output from the serial port. When updating the Linux BSP of the Toradex module, it is also necessary to do so in Uboot.

The remaining 4 serial ports of the Apalis i.MX6Q/D module can not only use TTL level to directly control the corresponding peripherals, but also be expanded to RS232/RS485/RS422 commonly used industrial control ports. For the demand for more serial ports, there are currently multiple solutions to achieve serial port expansion, such as through USB, SPI, Memory Bus, I2C and PCIe buses. Memory Bus and PCIe have higher real-time performance than other buses, and more serial ports can be expanded on the same interface. For applications with high serial port quantity and data real-time performance, these two expansion solutions can be preferred. At the same time, Memory Bus and PCIe are high-speed signal buses, which require some special considerations in PCB wiring. Toradex also provides free PCB design guidance for this purpose. Next, we will introduce how to use EXAR's XR17V358 solution based on the PCIe bus to expand 8 serial ports.

1). XR17V358 solution introduction and driver download

The 8 extended serial ports of XR17V358 all support RTS/CTS or DTR/DSR flow control functions. Each serial port has a 256-byte FIFO, independent clock output, supports half-duplex RS485, and has a maximum transmission speed of 25 Mbps. XR17V358 uses PCIe 2.0 Gen 1 to connect to Apalis i.MX6Q/D to ensure high-speed real-time data transmission. EXAR currently provides Windows and Linux drivers for XR17V358. Here we use its latest Linux driver and port it to the Apalis i.MX6 platform. Driver source code download address http://www.exar.com/common/content/document.ashx?id=20121

2). Configure the compilation environment

Before compiling, you also need to download the Linux kernel and cross-compilation tools for Apalis i.MX6.

a). Download the Linux kernel for Apalis i.MX6

$ git clone -b toradex_imx_3.14.28_1.0.0_ga-next git://git.toradex.com/linux-toradex.git

 

b). Download cross-compilation tools

$ wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz

$ tar xvf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz

$ ln -s gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf gcc-linaro

$ export ARCH=arm

$ export PATH=~/gcc-linaro/bin/:$PATH

$ export CROSS_COMPILE=arm-linux-gnueabihf-

Note: The above path needs to correspond to the directory where the cross-compilation tool is actually unpacked.

 

c). Compile the Linux kernel and provide the necessary configuration files for XR17V358.

$ make apalis_imx6_defconfig

$ make -j4 uImage LOADADDR=10008000

 

d). Compile XR17V358 driver

// Edit the Makefile file and point KERNEL_SRC to the directory where the Linux kernel is located

KERNEL_SRC = /home/ban/Toradex/oe-core-tegra/LinuxKernel/v2.5/mx6/toradex_imx_3.14.28_1.0.0_ga-next/linux-toradex

// Save and run the make command to compile, making sure the ARCH, PATH, and CROSS_COMPILE parameters mentioned above are still valid.

$ make

// After successful compilation, the kernel module file xr17v35x.ko for the ARM processor will be generated

$ file xr17v35x.ko

xr17v35x.ko: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), BuildID[sha1]=399121b7862105b185e24b45 ba3522f14158295e, not stripped

 

e). Install the driver

Copy xr17v35x.ko to the Apalis i.MX6 module and install

root@apalis-imx6:~# insmod xr17v35x.ko

[ 151.156648] Exar PCIe (XR17V35x) serial driver Revision: 2.0

 

root@apalis-imx6:~# lspci

00:00.0 PCI bridge: Device 16c3:abcd (rev 01)

01:00.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev aa)

02:01.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev aa)

02:02.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev aa)

02:03.0 PCI bridge: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch (rev aa)

03:00.0 Serial controller: Exar Corp. Device 0358 (rev 03)

 

The corresponding serial port device files ttyXR0 to ttyXR7 appear in the /dev directory.

root@apalis-imx6:/dev# ls

autofs network_latency tty18 tty60

block network_throughput tty19 tty61

bus null tty2 tty62

char port tty20 tty63

console ppp tty21 tty7

cpu_dma_latency ptmx tty22 tty8

cuse ptp0 tty23 tty9

disk pts tty24 ttyXR0

dri ram0 tty25 ttyXR1

fb ram1 tty26 ttyXR2

fb0 ram10 tty27 ttyXR3

fb1 ram11 tty28 ttyXR4

fb2 ram12 tty29 ttyXR5

fb3 ram13 tty3 ttyXR6

fd ram14 tty30 ttyXR7

 

f). Set the baud rate

root@apalis-imx6:~# stty -F /dev/ttyXR0 115200

After the driver is loaded, it can be used normally in Linux like other serial ports.

Keywords:ARM Reference address:ARM embedded system serial port expansion

Previous article:ARM Embedded Linux Device Tree Introduction and Application Examples
Next article:Limitations of ARM processor instruction immediate addressing

Recommended ReadingLatest update time:2024-11-16 08:47

ARM microcontroller core structure
The core of the ARM chip, the CPU core (ARM720T), consists of an ARMTTDMI 32-bit RISC processor, a single 8KB cache, and a memory space management unit (MMU). The 8KB cache has a four-way connected register and is organized into 52-line quad words (4×52×4 bytes). The cache is directly connected to the ARMTTDMI, so the
[Microcontroller]
ARM architecture, which has swept the smartphone field, begins to enter the automotive industry
Nvidia's acquisition of ARM has already set off a bloody storm in the technology and automotive industries before the deal was finalized. The EU competition enforcement agency has begun to review it, and companies such as Tesla have expressed concerns about monopoly. However, the acquisition does not seem to have much
[Automotive Electronics]
ARM architecture, which has swept the smartphone field, begins to enter the automotive industry
Application and optimization research of Gnuboy virtual machine technology in ARM Linux
Gnuboy has implemented some optimization work on i386 assembly code and can run well on Pentium machines. In addition, so far, the platforms it can run on are still very limited. With the development of embedded system design technology, the functions of embedded products such as PDA and Smartphone are constantly expa
[Microcontroller]
Application and optimization research of Gnuboy virtual machine technology in ARM Linux
Foreign media: Arm licensing model may undergo important changes
The Qualcomm-Arm lawsuit is epic, and the case has a massive new update. This update contains evidence that Arm is changing its entire business model and moving towards requiring OEM licenses. It also contains some suggestive evidence of anti-competitive licensing behavior by GPUs, NPUs, and ISPs. As we previously r
[Semiconductor design/manufacturing]
(ARM11 S3C6410) ARM11 bare metal first experience, GPIO register
When you get an unfamiliar MCU, you usually want to run the bare metal first. ... Usually the first thing you do is to look at the GPIO registers. OK6410 development board circuit diagram. 6410 IO port resources... The register address you want to close GPMCON: IO po
[Microcontroller]
(ARM11 S3C6410) ARM11 bare metal first experience, GPIO register
A Brief Analysis of Three Widely Used Embedded Operating Systems on ARM CPU
Embedded operating system is the software foundation of ARMCPU. From 8-bit/16-bit single-chip microcomputer to 32-bit embedded processor represented by ARMCPU core, embedded operating system will replace the traditional manually compiled monitoring program or scheduler and become an important basic component. More imp
[Microcontroller]
A Brief Analysis of Three Widely Used Embedded Operating Systems on ARM CPU
The hardware platform based on ARM and FPGA realizes an embedded CNC system with high openness characteristics.
introduction In the existing CNC system, the computer CNC system solution of industrial computer plus motion control card is mostly used to design the motion controller. As the overall functions of industrial computers become increasingly complex, the requirements for motion control systems in terms of volume, cost, a
[Microcontroller]
The hardware platform based on ARM and FPGA realizes an embedded CNC system with high openness characteristics.
Design of remote wireless water supply measurement and control system based on ARM
At present, the production operation of industrial water supply points is mainly completed manually. In order to ensure the normal operation of each well at the industrial water supply point, the water well dispatching station needs to be manned 24 hours a day, and the dispatching personnel are divided into shifts to
[Microcontroller]
Design of remote wireless water supply measurement and control system based on ARM
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号