Hyesco H9200E User Guide

恒颐高科
H9200E
© All Rights Reserved 2006
北京恒颐高科技术有限公司 www.hyesco.com - 0 -
恒颐高科
重 要 声 明
北京恒颐高科技术有限公司及其子公司保留在未通知用户的情况下,对其产品、服务及文档进行更正、 修改、增减等其他一切变更的权利。在定购前,用户应获取相关信息的最新版本,并确认这些信息是完全 和最新的。
在不用于商业目的的情况下,北京恒颐高科技术有限公司允许用户对其文档、产品进行复制。
版权所有 © 2006~,北京恒颐高科技术有限公司
公司名称: 北京恒颐高科技术有限公司
公司地址: 中国北京海淀区中关村南大街 48 号九龙商务中心 B 座 402 室
邮政编码: 100081
固定电话: 86-10-62121051/62121053/62125220/62129203
传真: 86-10-62121053
电子邮箱:
marketing@hyesco.com
北京恒颐高科技术有限公司 www.hyesco.com - 1 -
版 本 修 订
修订日期 版本号 修 订 描 述
2004 01 01 2004 05 20 2005 07 18 2005 07 26 2006 03 22 2006 06 06
001 002 003 004 005 006
原始版本。 添加 Linux 设备驱动程序的编写说明。 添加常见问题 Q4~Q7。 修正了附录 A 中 Minicom 波特率的设置,由 19200 改为 115200。 修正了 Uboot 的编译方法描述。 添加 Nand Flash 文件系统支持。
恒颐高科
北京恒颐高科技术有限公司 www.hyesco.com - 2 -
恒颐高科
目 录
一、H9200E简介 ··················································································································································- 5 -
1.1 板级支持包········································································································································- 5 -
1.2 硬件特性············································································································································- 5 -
1.3 软件特性············································································································································- 6 -
二、H9200E硬件描述 ··········································································································································- 7 -
2.1 ATMELAT91RM9200 微处理器 ···································································································- 7 -
2.2 Flash存储器·······································································································································- 9 -
2.3 SDRAM存储器··································································································································- 9 -
2.4 NAND Flash存储器···························································································································- 9 -
2.5 异步串行通讯口······························································································································- 10 -
2.6 RS485 接口·····································································································································- 10 -
2.7 10M/100M以太网MAC ···················································································································- 10 -
2.8 USB接口··········································································································································- 11 -
2.9 IIC存储器 ········································································································································· - 11 -
2.10 系统总线驱动··································································································································- 11 -
2.11 跳线及LED显示器··························································································································- 11 -
2.12 JTAG接口 ········································································································································- 12 -
2.13 复位电路··········································································································································- 12 -
2.14 电源电路··········································································································································- 12 -
三、快速上手······················································································································································ - 14 -
3.1 设置超级终端··································································································································- 14 -
3.2 硬件连接··········································································································································- 16 -
3.3 操作Uboot·······································································································································- 16 -
3.4 Uboot是个什么东东啊? ················································································································- 17 -
四、使用ADS开发H9200E ······························································································································· - 20 -
4.1 开发环境的硬件连接······················································································································- 20 -
4.2 使用ADS进行程序开发··················································································································- 20 -
4.3 SDRAM中运行程序····················································································································- 22 -
五、深入开发H9200E········································································································································- 24 -
5.1 如何对裸系统进行操作··················································································································- 24 -
5.2 如何将你的程序写入系统并运行···································································································- 26 -
六、嵌入式Linux开发环境································································································································- 27 -
6.1 嵌入式Linux开发环境的基本结构·································································································- 27 -
6.2 Linux服务器上安装交叉编译工具·····························································································- 28 -
6.3 嵌入式Linux内核的配置与编译·····································································································- 28 -
6.4 通过UBoot下载内核到H9200E运行·····························································································- 30 -
北京恒颐高科技术有限公司 www.hyesco.com - 3 -
恒颐高科
七、如何在H9200E上开发Linux应用程序····································································································· - 33 -
7.1 Linux应用程序的开发流程··············································································································- 33 -
7.2 一个简单的应用程序······················································································································- 35 -
7.3 固化应用程序并自动运行··············································································································- 37 -
八、如何在H9200E上开发Linux设备驱动程序····························································································· - 38 -
8.1 编写设备驱动程序··························································································································- 38 -
8.2 编写应用程序访问设备··················································································································- 44 -
8.3 测试设备··········································································································································- 46 -
8.4 其他的设备文件例程······················································································································- 46 -
附录A Minicom的设置·································································································································- 48 -
附录B Uboot的编译方法······························································································································ - 51 -
附录C NFS(网络文件系统)建立与配置方法························································································· - 52 -
附录D Busybox及编译与使用方法 ············································································································- 54 -
附录E 系统常见问题 ···································································································································· - 56 -
北京恒颐高科技术有限公司 www.hyesco.com - 4 -
恒颐高科

一、H9200E 简介

H9200E 是一款高性能、低价位、基于嵌入式工业控制系统的开发工具套件,可用于嵌入式工业控制 系统开发人员进行 ARM 技术评估或进行嵌入式 Linux 系统设计。
H9200E 采用开放式架构设计,便于用户根据自身需求,进行各种扩展,系统的核心是 32 ARM920T 核的高速 ARM 处理器 AT91RM9200,AT91RM9200 是一款高性能、低功耗、低成本的嵌入式 ARM 微处 理器,作为一款高性价比的 ARM 处理器,AT91RM9200 已被广泛应用于各种工业控制系统中。
H9200E 适用于嵌入式工业控制、移动计算和普适计算等场合。

1.1 板级支持包

H9200E 板级支持包是一个完整的 ARM 嵌入式系统开发平台,包含开发嵌入式工业控制系统需要的所 有部件:
H9200E 系统主板;
H9200E 系统主板相关软件及 CD-ROM 文档;
9RS-232C 串行电缆线;
— 输出+5V(或+5V、+12V、-12V)的稳压直流电源;

1.2 硬件特性

H9200E 系统主板包含以下部件:
ATMEL的 AT91RM9200 微处理器,180MHz 工作频率下运行在200MIPS,内嵌 16KB 数据Cache
16KB 指令 Cache,以及 MMU
4MB Flash(2M×16 位),可完全固化 Linux 内核;
32MB SDRAM2×8M×16 位),可扩展为 64MB
64MB NAND Flash,可存储大量数据;
128×8 IIC 存储器接口;
— 实时时钟(RTC),带后备电源接口;
2 9 D RS-232C 串行接口,对应于 Debug UART UART0
1 RS485 接口;
北京恒颐高科技术有限公司 www.hyesco.com - 5 -
1 RJ-45 10/100M 以太网接口;
2 GPIO 接口,可由用户编程为输入或输出,带 LED 电平指示,对应于 PC14PC15 口;
20 JTAG 接口;
1 USB 主口、1 USB 从口;
— +5V、+12V、-12V 电源输入接口,方便用户的系统扩展;
— 完全的系统总线驱动,方便用户系统扩展;
— 完全的系统总线扩展接口,采用 PC104 连接器,便于用户进行系统扩展;

1.3 软件特性

恒颐高科
GNU工具链;
— 完全移植到 H9200E Linux 内核源码,Nand Flash/Nor Flash 文件系统支持;
— 基于 Linux 的设备驱动例程;
— 完全移植到 H9200E uC/OS II 源码,适合于硬实时(Hard Real-Time)工业控制应用;
— 完整的例程,使用户快速上手,并方便组建自己的应用;
— 完全移植到 H9200E Uboot 源码,方便用户定制及系统开发;
— 已编译完毕的二进制代码:LinuxuC/OS IIUboot 等;
— 全部 Protel 格式的硬件原理图、所用器件库、PCB 封装库等;
北京恒颐高科技术有限公司 www.hyesco.com - 6 -

二、H9200E 硬件描述

H9200E 是一款基于 ARM 的完整工业控制应用开发平台,包含常用的核心功能,是一款功能强大、配 置灵活的嵌入式工业控制应用技术的评估与开发工具,系统主板外观如下图所示:
恒颐高科
2.1 系统主板外观及功能说明
其主要功能模块描述如下:

2.1 ATMEL AT91RM9200 微处理器

AT91RM9200 微处理器是一款由 ATMEL 设计生产的嵌入式 ARM 微处理器,采用 208 PQFP 封装, 内含一个 ARM920T 核和以下片内外围,其主要特性如下:
ARM920T ARM-Thumb 微处理器核:
¾ 180MHz的工作频率下运行速度为200MIPS ¾ 内嵌16KB的数据Cache16KB指令Cache,写缓冲区; ¾ 全功能的MMUMemory Management Unit); ¾ 内嵌Debug通信通道的Emulator
¾ 嵌入式Trace Macrocell (仅限于256-ball BGA 封装模式);
北京恒颐高科技术有限公司 www.hyesco.com - 7 -
片内存储器:
¾ 内嵌16KB SRAM128KB ROM,方便用户调试;
外部总线 EBI 接口:
¾ 支持SDRAMStatic MemoryBurst FlashGlueless Connection to CompactFlash®
SmartMedia™ NAND Flash
功能强大的片内外围电路:
¾ 增强型的时钟产生器和电源管理控制器; ¾ 带有两个PLL的片内振荡器; ¾ 慢速的时钟操作模式和软件电源优化能力; ¾ 四个可编程的外部时钟信号; ¾ 包括周期性中断、看门狗和第二计数器的系统定时器; ¾ 带有报警中断的实时时钟(RTC); ¾ 调试单元,支持两线UARTDebug调试通道; ¾ 带有8个优先级、可单个屏蔽中断源、Spurious中断保护的先进中断控制器; ¾ 7个外部中断源和一个快速中断源; ¾ 四个32位的PIO控制器,可达122个可编程I/O引脚(每个都有输入控制、可中断及开路的输
出能力);
¾ 20通道的外部数据控制器(DMA);
恒颐高科
10M/100M 网卡:
¾ 传输媒体独立接口(MII)或精简传输媒体独立接口(RMII); ¾ 集成28字节的FIFOs和直接用于收发DMA通道;
USB 2.0 主口(12 M-bits/)
¾ 两个在片的收发器(208脚的PQFP封装只有一个); ¾ 集成的FIFOsDMA通道;
一个 USB 2.0 从口(12 M-bits/)
¾ 一个在片的收发器;2KB可配置的集成FIFOs
多媒体卡接口(Multimedia Card InterfaceMCI):
¾ 支持自动协议控制和快速自动数据传输器; ¾ 兼容MMC卡和SD存储卡,最多可支持两个SD存储卡;
三个异步的串行控制器(Synchronous Serial ControllersSSC):
¾ 每个收发器均有的独立的时钟和帧同步信号;
¾ 支持I2S模拟接口,支持时分多路复用;
¾ 支持32位高速连续数据流发送;
四个同步/异步收发器 (USART)
¾ 支持ISO7816 T0/T1标准智能卡; ¾ 支持软、硬件握手功能;
北京恒颐高科技术有限公司 www.hyesco.com - 8 -
¾ 支持RS485传输、速度可达115 Kbps的红外传输; ¾ USART1带有全功能Modem控制线;
/从串行外围接口(SPI):
¾ 8/16位可编程数据长度, 4个外围芯片选择;
两个 3 通道,16 位的定时器/计数器(TC):
¾ 3个外部时钟输入, 每个I/O通道有两个可以复用的I/O口; ¾ PWM生成,捕获/波形模式,向上和向下计数兼容;
两线接口(Tw o-wire InterfaceTWI):
¾ 以主模式支持所有两线的Atmel EEPROMs设备;
IEEE 1149.1 JTAG 边界扫描接口;
供电电源:
¾ 1.65V 1.95V for VDDCORE, VDDOSC and VDDPLL ¾ 1.65V 3.6V for VDDIOP (外设I/Os) and for VDDIOM (内存I/Os)
恒颐高科
可选择 208 PQFP 256 BGA
封装;

2.2 Flash 存储器

H9200E 系统主板包含 4MB(可替换为 2MBFlash 存储器,内部存放启动代码、Linux 内核、用户 程序等。Flash 存储器的数据宽度为 16 位,可通过跳线(J201)选择映射到 AT91RM9200 的 Chip Select 0 Chip Select 7

2.3 SDRAM 存储器

H9200E 包含 32MB SDRAM,作为程序的运行空间。由两片 16 位数据宽度的 SDRAM 存储器并联为 32 位数据宽度的 SDRAM 存储系统,并映射到 AT91RM9200 Chip Select 1
AT91RM9200 微处理器内部的 16KB 的 SRAM,通常被配置为堆栈区以提高系统性能。

2.4 NAND Flash 存储器

H9200E 包含 64MB(可替换为 32MB)的 NAND Flash 存储器,作为系统的数据存储器。NAND Flash 存储器的数据宽度为 16 位,映射到 AT91RM9200 的 Chip Select 3。
北京恒颐高科技术有限公司 www.hyesco.com - 9 -
恒颐高科

2.5 异步串行通讯口

H9200E 外接两个 UART(Universal Asynchronous Receiver/Transmitter),Debug UART 和 UART0, Debug UART 用于软件调试与系统开发,UART0 可完成与 PC 及 Modem 的通信。
RS-232C 接口定义见下表:
引脚 名称 功能描述
1 DCD
2 RXD
3 TXD
4 DTR
5 GND
6 DSR
7 RTS
8 CTS
9 RI

2.6 RS485 接口

数据载波检测
数据接收
数据发送
数据终端准备好
数据设备准备好
请求发送
清除发送
振铃指示
AT91RM9200 USART 均支持 RS485 通讯模式,H9200E UART1 外接了一片 RS485 总线收发 器,用于支持 RS485 通讯。

2.7 10M/100M 以太网 MAC

以太网 MAC 是 OSI 参考模型中界于物理层(PHY)与逻辑链路层(LLC)之间的 MAC 子层的硬件实 现,以太网 MAC 支持 MII(Media Independent Interface)和 RMII(Reduced Media Independent Interface) 模式的数据传输。
H9200E 外接了一块物理层芯片 DM9161,用于支持以太网通讯。
北京恒颐高科技术有限公司 www.hyesco.com - 10 -
恒颐高科
欲详细了解 AT91RM9200 的以太网 MAC,可参考 ATM E L 关于 AT91RM9200 的用户手册。

2.8 USB 接口

利用 AT91RM9200 片内集成的 USB 通讯控制器,H9200E 外扩了一个 USB 主口和一个 USB 从口, 用于支持 USB 设备的读写;

2.9 IIC 存储器

H9200E 外接了一个 128 字节的 IIC 存储器 AT24C01,用于存储 IP 地址、MAC 地址及系统加密等。
鉴于系统已经很好的支持了 Flash 文件系统,用户也可以以文件的方式将系统信息存储在 Flash 中, 而不需要使用 IIC 存储器。

2.10 系统总线驱动

为方便系统的扩展,增加系统总线的驱动能力,H9200E 对所有的数据总线、地址总线和部分控制总 线进行了驱动,经过驱动的总线可以方便的外接大量外设,便于用户组建复杂的嵌入式工业控制系统。

2.11 跳线及 LED 显示器

1、跳线
H9200E 系统主板使用了几组跳线进行功能选择:
J100 为启动模式选择(BMS):当跳线 J100 短接在 1-2 时,系统复位后从 Flash 启动,当短接在 2
3 时,系统复位后从 AR91RM9200 内部的 ROM 启动。更详细的连接方法可参考系统主板原理图。
找到 J100 H9200E 上的位置(在靠近串口的地方),在以后的操作中我们经常会用到的。
J201 Flash 芯片的片选信号:当跳线短接在 1-2 时(系统默认),Flash 映射到 AT91RM9200 的 Chip Select 0,短接在 2-3 时,Flash 映射到 AT91RM9200 的 Chip Select 7。更详细的连接方法可参考
系统主板原理图。
注意:为方便用户使用,有的版本已将该跳线取消,而直接将 Flash 映射到 AT91RM9200 Chip Select
0
J500 JTAG 选择:当跳线短接在 1-2 时(系统默认),系统选择 JTAG 调试模式,短接在 2-3 时, 系统选择嵌入式 ICE 模式。更详细的连接方法可参考系统主板原理图。
北京恒颐高科技术有限公司 www.hyesco.com - 11 -
恒颐高科
注意:为方便用户使用,有的版本已将该跳线取消,而直接将系统选择 JTAG 调试模式。
J1200 NAND Flash 的片选信号:当跳线短接在 2-3 时(系统默认),将 NAND Flash 映射到 AT91RM9200 Chip Select 3。更详细的连接方法可参考系统主板原理图。
注意:为方便用户使用,有的版本已将该跳线取消,而直接将 Nand Flash 映射到 AT91RM9200 Chip Select 3
2LED 显示器
H9200E 系统主板带有多个 LED 显示器,用于指示系统的工作状态:
位于系统主板电源电路部分的 4 LED 为电源指示,分别指示 12V5V3.3V 和-12V 电源电压, 当系统接通电源时,相应的 LED 亮。
标识为 PC14 PC15 2 LED GPIO PC14 PC15 的电平指示,分别指示其输入/输出电平 状态。
标识为 D_RXDD_TXD、RXD0、TXD0 的 4 个 LED 为 Debug UART 和 UART0 的工作指示,当 UART 进行数据通讯时,LED
标识为 FXDSPEED LINK 3 LED 为以太网工作状态指示。
更详细的连接方法可参考系统主板原理图。
闪烁。

2.12 JTAG 接口

为方便用户的调试,H9200E 设计有 20 针标准 JTAG 接口。20 针接口与 ARM Multi-ICE 接口兼容。

2.13 复位电路

H9200E 的复位电路可以完成上电复位和系统运行时按键复位的功能。在系统正常运行时,当用户按 下复位按钮 RESET 时,AT91RM9200 进入复位状态,松开按钮,AT91RM9200 进入正常工作状态。

2.14 电源电路

H9200E 的电源电路可以提供系统工作所需的 3.3V 1.8V 的稳压直流电源。
系统主板有两个电源输入接口,标识为 CON401 的接口输入为 5V 稳压直流电源,标识为 CN400 的接 口输入为 5V12V 和-12V 稳压直流电源,用于系统的扩展。
北京恒颐高科技术有限公司 www.hyesco.com - 12 -
注意:过高的输入电压会造成系统的永久损坏!
恒颐高科
北京恒颐高科技术有限公司 www.hyesco.com - 13 -
恒颐高科

三、快速上手

通过前面的内容,你可能已经初步了解了H9200E的概况,接下来的问题是:我如何尽快将H9200E玩 转,并进行我自己的特定应用系统开发?
以下的内容将回答这个问题!
当你拿到H9200E系统时,摆在你面前的是一大堆开发资料,如果你已经开发过类似的系统,这部分内 容你可以略过,去文档CD中找你关注的内容,如果你对ARM系统开发还不太熟悉,你会不知所措,不要紧, 这也是正常现象,这一章会让你消除你的恐惧心理,逐步对你的产品开发发生兴趣。
这部分我们不讲关于H9200E原理性的内容,只是去熟悉它,初步了解它:
OKLet’s go…

3.1 设置超级终端

Windows自带的应用程序中有一个超级终端,其打开方法为:开始程序附件通讯超级终端, 如下图所示:
打开后将出现如下界面:
北京恒颐高科技术有限公司 www.hyesco.com - 14 -
你可以输入一个自己喜欢的名字,然后点击确定按钮,就会出现如下界面:
恒颐高科
设置连接时使用为串口1(COM1)(也可使用COM2,依实际接法为准),点击确定按钮进入下一步:
请按上图中的设定值进行设定:设置串口每秒位数115200,数据位:8,奇偶校验:无,停止位:1, 数据流控制:无。点击确定按钮,即可进入下图所示的超级终端:
北京恒颐高科技术有限公司 www.hyesco.com - 15 -

3.2 硬件连接

恒颐高科
H9200E系统主板连接好电源和通讯线路:首先,把随系统附带的标准串口线的一端连接到PC机的 串口上(COM1COM2的选择要和超级终端的设置相一致),串口线的另一端接到H9200E的串口 UART_DEBUG上(靠角上的那一个)。接下来为H9200E接好电源,当系统上电时,电源插座旁的LED 示灯会发光。
注意:上电之前一定要看好,你使用的电源是不是符合系统的电压要求,否则就要冒烟的哦!

3.3 操作 Uboot

H9200E的跳线J100(用于启动模式选择)的12短接,在接通系统电源后,超级终端中就会看到 系统主板固化代码的启动信息,如下图所示:
北京恒颐高科技术有限公司 www.hyesco.com - 16 -
当程序运行到此处时,系统有一小段等待时间,按下任意健,系统会出现提示符,否则系统会自动运 行固化的Linux操作系统。
键入“help”或“?”,出现Uboot所支持的全部命令:
恒颐高科
OK!你可使用 Uboot 的命令来进行操作了,恭喜你!

3.4 Uboot 是个什么东东啊?

Uboot 是一个非常复杂的东东!
Uboot是一段非常复杂的代码!
Uboot是一个通用的BootLoader程序,非常适合于使用在嵌入式系统中,目前已广泛应用于X86、ARM MIPSPowerPC等架构的系统中。
1、Uboot 能干啥呢?
Uboot和其他任何BootLoader都是一样的,主要是对系统进行初始化、系统引导、Flash操作等功能。
北京恒颐高科技术有限公司 www.hyesco.com - 17 -
Loading...
+ 40 hidden pages