Digi 9360, 9750 User Manual

LxNETES™ User’s Guide ConnectCore 9P 9360/9750
Digi International Inc. 2005. All Rights Reserved.
The Digi logo is a registered trademarks of Digi International, Inc. All other trademarks mentioned in this document are the property of their respective owners. Information in this document is subject to change without notice and does not represent a commitment on the part of Digi
International. Digi provides this document “as is,” without warranty of any kind, either expressed or implied, including, but not limited to, the
implied warranties of fitness or merchantability for a particular purpose. Digi may make improvements and/or changes in this manual or in the product(s) and/or the program(s) described in this manual at any time.
This product could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes may be incorporated in new editions of the publication.
••
Contents
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Chapter 1 Introduction........................................................................9
Overview..................................................................................................................9
Cross-development environment.......................................................................9
Linux kernel sources........................................................................................10
Template project ..............................................................................................10
Example applications.................................................................................10
Features..................................................................................................................11
What’s new in LxNETES 3.2? ........................................................................11
Linux Kernel..............................................................................................11
Bootloader..................................................................................................11
Tool chain ..................................................................................................11
General features...............................................................................................11
Conventions used in this manual.....................................................................13
Acronyms and abbreviations ...........................................................................14
Chapter 2 Requirements ...................................................................15
System Requirements/Prerequisites.......................................................................15
System requirements........................................................................................15
Disk space........................................................................................................16
Applications & Services ..................................................................................17
TFTP daemon ..................................................................................................17
NFS server .......................................................................................................18
JTAG-Booster..................................................................................................19
Chapter 3 Getting Started .................................................................21
Introduction............................................................................................................21
Connecting host PC with development board..................................................21
Step 1: Connect serial port.........................................................................21
Step 2: Connect Ethernet interface ............................................................21
Step 3: Configure terminal client...............................................................21
Minicom...........................................................................................................22
Seyon ...............................................................................................................22
Step 4: Connect power...............................................................................23
Step 5: Test Ethernet configuration ...........................................................24
Installing LxNETES ..............................................................................................25
Guided Installation.................................................................................................26
 5
Manual Installation................................................................................................27
Chapter 4 Building the First Project................................................. 29
Building the Default Project..................................................................................29
Step 1: Run configure................................................................................29
Example: .............................................................................................29
Step 2: Run make.......................................................................................30
Step 3: Run make install............................................................................30
Chapter 5 Application Development................................................ 31
Writing applications...............................................................................................31
Adding your own applications.........................................................................31
Example: .............................................................................................31
Using C++........................................................................................................32
Included example applications ..................................................................32
display........................................................................................................32
Debugging applications .........................................................................................34
Included pre-built applications ........................................................................36
Shell applications: busybox.............................................................................36
Telnet daemon: utelnetd ..................................................................................36
Web server: Boa ..............................................................................................36
Debug server: gdbserver..................................................................................36
Nano-X/microwindows....................................................................................37
Embedded Qt ...................................................................................................37
Useful applications ................................................................................................38
mem .................................................................................................................38
Chapter 6 Kernel Development........................................................ 39
Writing kernel modules .........................................................................................39
What is a kernel module? ................................................................................39
Writing your own kernel modules...................................................................39
Add your source files.......................................................................................39
Add the module to the build environment......................................................40
Building and loading of kernel modules..........................................................40
Included Kernel modules.................................................................................40
minimal............................................................................................................40
Chapter 7 Advanced Topics ............................................................. 41
Modifying the default project................................................................................41
Building a custom project......................................................................................43
Boot process...........................................................................................................44
6 
LxNETES User’s Guide
Introduction......................................................................................................44
U-Boot ...................................................................................................................44
ConnectCore 9P 9360/9750.............................................................................45
Linux boot methods...............................................................................................46
TFTP/NFS........................................................................................................46
NAND-Flash....................................................................................................46
NOR Flash .......................................................................................................47
USB..................................................................................................................47
Linux boot process.................................................................................................48
Passing arguments to the kernel.......................................................................50
Automating the image download.....................................................................50
Updating the Flash memory.............................................................................50
Updating a running system (the easy way)......................................................51
Updating a running system manually ..............................................................51
Step 1: Download the new image file to RAM..........................................52
Step 2: Erase the Flash partition................................................................52
Step 3: Write the image to Flash................................................................52
ConnectCore 9P 9360/9750.............................................................................53
U-Boot .......................................................................................................53
Kernel.........................................................................................................53
Root File System........................................................................................53
Updating a corrupted system using a debugger.....................................................54
ConnectCore 9P 9360/9750.............................................................................54
Chapter 8 Root File System Types...................................................55
NFSROOT .......................................................................................................55
Step 1: Set bootargs to be passed to the kernel..........................................56
Step 2: Download the kernel to RAM via TFTP .......................................56
Step 3: Launch the kernel from RAM .......................................................56
JFFS2 ...............................................................................................................57
Step 1: Set bootargs to be passed to the kernel..........................................58
Step 2: Copy the kernel to RAM ...............................................................58
Step 3: Launch the kernel from RAM .......................................................58
Chapter 9 Interfaces & Devices........................................................61
Serial interface.................................................................................................61
USB host interface...........................................................................................62
I2C interface ....................................................................................................62
SPI interface.....................................................................................................62
 7
LCD interface ..................................................................................................62
Touch screen interface.....................................................................................62
CC9P9360/9750.........................................................................................62
Compact flash interface...................................................................................63
CC9P6360/9750.........................................................................................63
SD card interface .............................................................................................63
Real time clock (RTC).....................................................................................63
How to set the initial system date and time.....................................................63
PCI interface....................................................................................................64
Appendix A ....................................................................................... 65
Related documentation ..........................................................................................65
CD contents .....................................................................................................65
Readme.txt.......................................................................................................66
RelNotes.txt.....................................................................................................66
install.sh...........................................................................................................66
docs..................................................................................................................66
images..............................................................................................................66
ConnectCore 9P 9360 (CC9P9360).................................................................67
ConnectCore 9P 9750 (CC9P9750).................................................................67
hardware ..........................................................................................................67
LxNETES ........................................................................................................67
setup...........................................................................................................67
upstream.....................................................................................................68
U-Boot .......................................................................................................68
Memory layouts.....................................................................................................68
Flash memory layout ......................................................................................68
ConnectCore 9P 9360 / ConnectCore 9P 9750................................................68
SDRAM memory layout..................................................................................68
ConnectCore 9P 9360 / ConnectCore 9P 9750................................................69
Appendix B ........................................................................................ 71
U-Boot command reference...................................................................................71
User keys ...............................................................................................................75
8 
LxNETES User’s Guide

Overview

Introduction

Introduction
CHAPTER 1
The LxNETES package enables you to easily develop software under Linux 2.6 for Digi International and FS Forth-Systeme embedded modules supported in this release of LxNETES.
This document assumes that you have basic knowledge of Linux. In addition, it is recommended that you have experience with compiling a standard Linux kernel on your host PC. If you are new to Linux, the following books are recommended for resources:
1.) Linux Device Drivers, 3rd Edition, by J. Corbet, A. Rubini, and G. Kroah-Hartman, ISBN 0-596-00590-3
2.) Debian Reference http://www.debian.org/doc/manuals/reference/reference.en.html
The following sections explain the several parts that compose the LxNETES package.

Cross-development environment

Whenever you need to generate code for an embedded target on a development system with a different microprocessor architecture, you need a cross-development environment. That is, you need a compiler that executes in y our development system (for exampl e a x86 PC) but generates code that executes in a different processor (for example your target is NET+ARM).
LxNETES provides the GNU cross-development tool chain for NET+ARM, ARM, and X-Scale, which contains the compiler, linker, assembler, and shared libraries needed to generate software for the supported platforms.
 9
Overview

Linux kernel sources

The LxNETES package contains the complete source code of the Linux kernel. This allows you to configure, modify, and create a custom kernel to your specific embedded system’s needs. Although the kernel sources are the official distribution, some modifications have been made to adapt the sources to the supported platforms.

Template project

The philosophy of work in LxNETES environment is linked to the idea of ‘projects’. A project is actually a folder which contains the custom system for a specific target. This folder will contain:
The specific kernel configuration The root file system, directory structure, and files The applications compiled
With one simple command, the compilation process takes care of compiling the kernel, the applications, generating the target’s file system, and compressing into the final binary images. The compilation process take place within the project folder with normal user permissions.
10 
Example applications
As part of the project template, several example applications are included with complete source code. These examples can be used as templates for your future software applications. They are distributed in an environment that allows you to compile them for either of the following systems:
The target development system (default) The target development system with debug information
LxNETES User’s Guide

Features

What’s new in LxNETES 3.2?

Linux Kernel
Linux Kernel 2.6.12.5 Added touch screen driver for the ConnectCore 9P family Added RTC driver for the ConnectCore 9P family Build process based on autoconf
Bootloader
New U-Boot boot loader, based on version 1.1.3
Tool chain
gcc-3.4.4 cross compiler for NET+ARM, ARM, and XScale processors
Introduction
For existing LxNETES customers: LxNETES 3. 2 uses a different uClibc tha n previous versions of LxNETES which is not backwards compatible. Applications built with old uClibc cannot be used in the new environment; they have to be rebuilt.

General features

With LxNETES you receive a Development Kit and BSP with the following features:
Support for Linux kernel 2.6 Support for the following NET+ARM, ARM, and Intel X-Scale processors:
NetSilicon: NS9750, NS9360 – Samsung: S3C2440, S3C2410 – Intel: PXA270 – Atmel: AT91RM9200
 11
Features
Drivers for the following module components and interfaces:
SDRAM memory – Flash memory –Ethernet –USB Host –Serial –I2C –RTC –GPIO – Watchdog – LCD Framebuffer – Compact Flash Cards –SD Cards –PCI –SPI – Touch Screen
12 
User Buttons if availab le
U-Boot universal bootloader, capable of booting Linux and other operating
systems from Ethernet, Flash memory and USB.
C and C++ support for application development gcc-3.4.4 cross compiler for Net+ARM, ARM, and XScale processors uClibc 0.9.27 for user applications Pre-built Busybox and other applications Telnet daemon utelnetd Web server BOA Nano-X and QT embedded sample projects Shared library support Project-oriented workflow – kernel configuration and rootfs setup are separated
from kernel sources, tool chain sources, thus making it possible to maintai n the project in a revision control system.
LxNETES User’s Guide
Autoconf driven build process All building can be done without root access This LxNETES version can coexist with older installations of LxNETES

Conventions used in this manual

The following is a list of the typographical conventions used in this manual:
Introduction
Style
Used for file and directory names, programs and command names, command-line options, URL, and new terms.
Style
Used in examples to show the conte nts of files, the output from commands or in the text the C code.
Style
Used in examples to show the text that should be typed litera lly by the user.
#
This prompt indicates that the listed commands have to be executed as a root.
$
This prompt indicates that listed commands have to be executed as a normal user.
[1]
Used to indicate an item of the reference section.
This manual also uses these frames and symbols:
This is a warning. It helps you to solve or to avoid common mistakes or problems.
This is a tip. It contains useful information about a topic.
$ This is a host computer session
$ And this is what you must input (in bold)
 13
Features
# This is a target session # And this is what you must input (in bold)

Acronyms and abbreviations

CRAMFS Compressed ROM File system
CGI Common Gateway Interface
DHCP Dynamic Host Configuration Protocol (RFC 2131)
GDB GNU debugger
GPIO General Purpose Input/Output
INITRD Initial Ram Disk
IP Internet Protocol
14 
JFFS(2) Journaling Flash File System (version 2)
JTAG Joint Test Action Group (IEEE 1149.1) MMU Memory Management Unit
NFS Network File System
ROMFS ROM File Sy stem
ROOTFS Root File System
RTC Real Time Clock
TFTP Trivial File Transfer Protocol
USB Universal Serial Bus
LxNETES User’s Guide

Requirements

CHAPTER 2

System Requirements/Prerequisites

System requirements

Your development system should be a reasonably fast x 86-ba sed host PC wi th an E thernet interface, a serial port, and a parallel port.
Different Linux distributions such as SuSE, Debian, or RedHat can be used for the development. This documentation is based on the Debian Linux distribution; however, other distributions with minor changes in the settings can also be used. Please refer to the manuals of your Linux distribution if settings are not working as described in this document.
Requirements
The following software is required on your development system:
GNU C library glibc 2.3 GNU C compiler gcc >= 2.95.3 (3.3 or higher recommended) GNU make version >= 3.80 awk perl >= 5.6.0 autoconf >= 2.59 Terminal client software (such as Minicom or Seyon) TFTP daemon NFS daemon rsync
 15
System Requirements/Prerequisites
DOS or DO S-emulat or (such as dosemu)
Optional but recommended components:
Qt3 development tools
For using LxNETES, a recent Linux d istributio n b ased on GNU C Library gl ibc versi on
2.3 (a free implementation of the Standard C Library) is needed. To find out which glibc
version is installed on your system use the following commands:
$ ldd --version $ ls -l /lib/libc*so
Please make sure that you use GNU Make version 3.80 or later. Check yours with the following command:
$ make –v
Check the versions of required applications with these commands:

Disk space

16 
$ gcc --version $ perl -v $ autoconf --version
The LxNETES installation needs 400 MB of free disk space. Every project you create needs another 100 MB free disk space. Th e L xNETES insta llat ion an d t he p roje cts can b e located on different hard disks.
Check if there is enough space available on your drive by executing the following command:
$ df -h
The “df” command displays the amount of disk space availabl e. The option h displays the space. For detailed information read the man page of “df”.
LxNETES User’s Guide

Applications & Services

To use this software, your system has to be configured to build a standard Linux 2.6. If you can build a kernel for your development platform, you can be sure that all the necessary software is installed.
Depending on the network services used dur ing the development , additional daemons may have to be installed.

TFTP daemon

U-Boot is able to write files to the Flash memory of the mo dule. A TFTP server is required to transport these files from your host computer to the target. Debian users can execute the following command to install a TFTP server:
# apt-get install tftpd
After completing installation, create a directory using the path “/tftboot” where exported files are located. Your images can be placed in the directory automatically by the LxNETES build environment. You must be root to create this directory.
Requirements
# mkdir /tftpboot # chmod 1777 /tftpboot
To make sure that your TFTP server is using the “/tftpboot” directory, check the Internet daemons configuration file "/etc/inetd.conf". It should contain an entry similar to the following:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd -s /tftpboot
If the entry is not there, use an editor and change the file accordingly.
 17
System Requirements/Prerequisites

NFS server

Use the network file syst em (NFS) to simplify application debugging on the target. NFS allows your target to mount its root file system with read/write permissions from the host computer over Ethernet. NFS also allows you to access the file system fro m the tar get and from the host computer the same time.
The NFS server configuration details are beyond the scope of this User's Manual and are very specific to the various distributions. This manual only describes the modifications necessary on hosts running a Debian distribution. Please refer to your Linux distribution manual to setup a NFS server if you are using a different distribution.
When the NFS server package (Debian package nfs-kernel-server) is installed on Debian, there is a file "/etc/exports" that contains information on exported directories and its access rights. Add the following line to this file to provide read/write access for your target:
BOOTDIR IP_ADDRESS(rw,all_squash,async)
18 
BOOTDIR needs to be replaced with the path to the NFS root directory which is exported to the target. The IP_ADDRESS needs to be replaced with the IP address of your target.
Please refer to the Linux man pages for detailed in formation about the /etc/exports file. The build process copies the NFS root to /export/nfsroot-<platformname>; e.g. to export the rootfs for cc9p9750, write the following to /etc/exports:
/exports/nfsroot-cc9p9750dev 192.168.42.10(rw,all_squash,async)
For simplicity’s sake you can export the whole /exports dir for a complete subnet, e.g.:
/exports 192.168.42.0/24(rw,all_squash,async)
LxNETES User’s Guide
# /etc/init.d/nfs-kernel-server restart

JTAG-Booster

$_ports = "fast range 0x378 0x37a fast range 0x3f8 0x3ff range 0x778 0x77a”
Requirements
After modifying the exports file, the NFS server has to be restarted with the following command:
The JTAG-Booster software for hardware Flash updates is a DOS application. It must be installed on a native DOS / Windows host or a virtual machine like "dosemu" under Linux.
Execute "dosemu" as root to gain full hardware access. The configuration file of dosemu needs the entry:
To install the JTAG-Booster software, copy the directory "hardware" from the CD to any directory on the hard disk. This directory may also contain a file "Readme.txt" with the latest instructions. Ensure th at t he para ll el port i s accessi bl e for the ap pli cat ion. I f you are using Microsoft W indows NT, 2000, or XP , you have to install the "Kitha ra DOS Enabler" which is shipped on the LxNETES CD. A detailed manual can be found on the CD in the folder "hardware".
 19
System Requirements/Prerequisites
20 
LxNETES User’s Guide

Getting Started

CHAPTER 3

Introduction

This chapter describes how to configure and test your host PC and development board (target) and how to start up the device for the very first time.

Connecting host PC with development board

Step 1: Connect serial port
Getting Started
Connect the host PC to the development board (target) using a serial null-modem cable. The serial connection is used to interact with the target device.
Step 2: Connect Ethernet interface
The Ethernet connection can be establ ished by connect ing a crossover cable d irectly to the development board’s Ethernet port and your host PC. Alternatively, if you already have a running network configuration, you can connect the development board to your hub or switch.
Step 3: Configure terminal client
Configure a terminal client to view the serial console output the target prints on the serial interface. Minicom or Seyon are the most usual applications. Configure the serial parameters for 38400 baud, no parity, 8 data bits, and 1 stop bit.
 21
Introduction
Unless otherwise stated, it is assumed your target is connected to the first serial port (COM 1, ttyS0) of your host.
to the appropriate number .

Minicom

# minicom –s
To use a terminal client as non-root user, either you need read/write access to
/dev/ttyS<n> or the client has to be setuid root.
If you use anoth er po rt , ch ange t he “t tyS <n>”
To configure minicom, start it as root by entering:
Go to “Serial port setup” and change the values to your environment.

Seyon

22 
Figure 3-4: Minicom settings
Next time start minicom as a standard user with:
$ minicom
Start Seyon as a standard user by entering:
$ seyon -modems /dev/ttyS0
Go to “Seyon Command” window and press “Set”. In the “Settings” window you can adjust the settings.
LxNETES User’s Guide
Getting Started
Figure 3-2: Seyon Settings
Step 4: Connect power
Connect the included power supply to the development board. After power-on, the LEDs on the board will light up and 2-4 seconds later the system will print boot messages on the console. After 20-25 seconds, the boot load er has unpacked and launc hed the pre-i nstalled Linux kernel from the built-in Flash memory.
You will see output on the terminal client similar to the output below.
 23
Loading...
+ 52 hidden pages