EM2416 Linux User Manual

download EM2416 Linux User Manual

of 46

Transcript of EM2416 Linux User Manual

  • 8/4/2019 EM2416 Linux User Manual

    1/46

    www.armdesigner.com

    KIT2416 Linux User Manual

    EM2416 Linux User Manual

    Ver 1.1

    Date: 05

    www.armdesigner.com

  • 8/4/2019 EM2416 Linux User Manual

    2/46

    www.armdesigner.com

    EM2416 Linux User Manual 1

    Rev Date Description

    V1.0 2010-3-20 The initial released Version

    V1.1 2010-01-05 The Second released Version

  • 8/4/2019 EM2416 Linux User Manual

    3/46

    www.armdesigner.com

    EM2416 Linux User Manual 2

    CatalogueEM2416 LINUX USER MANUAL ............................................................... ........................................ 0

    1 HARDWARE ENVIRONMENT.........................................................................................................4

    1.1HARDWARE PREPARATION ...............................................................................................................4

    1.2HARDWARE CONNECTION ................................................................................................................4

    1.2.1Serial port ........................................................... ...................................................................... 4

    1.2.2 IROM Mode Download .................................................... ........................................................ 5

    1.2.3 Network communication ............................................................ .............................................. 5

    2 SOFTWARE ENVIRONMENT..........................................................................................................5

    2.1BUILD LINUX WORKING ENVIRONMENT .........................................................................................5

    3 BURN LINUX INTO EM2416............................................................................................................5

    3.1U-BOOT PREPARATION .....................................................................................................................6

    3.1.1 configure files in SD Card ....................................................... ................................................. 6

    3.1.2 Set U-boot Environment Variables...........................................................................................9

    3.3TRANSFER AND WRITE IMAGE BY SD CARD ..................................................................................13

    3.3.1 Download and Update system...............................................................................................13

    4 INSTALL CROSS COMPILER ....................................................................................................14

    5 COMPILE UBOOT SOURCE PACKAGE ....................................................................................17

    5.1UNZIP THE UBOOTSOURCE PACKAGE .........................................................................................17

    5.3COMPILE U-BOOT.BIN ....................................................................................................................17

    6 COMPILE LINUX KERNEL SOURCE PACKAGE .....................................................................18

    6.1UNZIP THE LINUX KERNEL SOURCE PACKAGE...............................................................................18

    6.2CONFIGURATION STEPS .................................................................................................................18

    6.3COMPILE THE ZIMAGE ...................................................................................................................20

    7. GENERATE THE ROOT FILE SYSTEM IMAGE (YAFFS) ......................................................21

    7.1FILE SYSTEM DIRECTORY ..............................................................................................................21 7.2GENERATE THE IMAGE FILE YAFFS ................................................................................................21

    8. DEVICE DRIVERS AND TEST .....................................................................................................22

    8.1ETHERNET DEVICE DRIVERS TEST(PING) ............................................................ ..........................22

    8.1.1 Test Steps................................................... ........................................................... ................22

    8.2MMCCARD DEVICE DRIVERS TEST .............................................................................................23

    8.2.1 Configure the Kernel on MMC Card.......................................................................................23

    8.2.2 Test Steps................................................... ........................................................... ................25

    8.3USBHOST INTERFACE DEVICE DRIVERS TEST..............................................................................25

    8.3.1 Configure the Kernel on USB Host ................................................... ..................................... 25

    8.3.2 Insert USB Mouse/Keyboard ........................................................... ...................................... 29

  • 8/4/2019 EM2416 Linux User Manual

    4/46

    www.armdesigner.com

    EM2416 Linux User Manual 3

    8.3.3 Insert USB mass Storage Device...........................................................................................29

    8.4EM2416TOUCH SCREEN DRIVERS TEST.......................................................................................32

    8.4.1 Configure the kernel on Touch Screen...................................................................................32

    8.4.2 Test Steps................................................... ........................................................... ................34

    9. DEVELOP APPLICATION IN THE HOST...................................................................................34

    9.1WRITE HELLO CODE .....................................................................................................................34

    9.2COMPILE HELLO ............................................................................................................................35

    10. DOWNLOAD THE APPLICATION TO THE EM2416 BOARD..............................................35

    10.1COPY BY UDISK .........................................................................................................................35

    APPENDIX A :NETWORK SERVICE ..............................................................................................36

    APPENDIX B: DEVELOPMENT IN QT ...........................................................................................39

  • 8/4/2019 EM2416 Linux User Manual

    5/46

    www.armdesigner.com

    EM2416 Linux User Manual 4

    1. Hardware Environment

    1.1 Hardware preparation

    Hardware preparation :

    z +5V/2a external power supply

    z DB9 cross serial cable, to connect PC and COM1 of EM2416

    z Ethernet cable

    z PC to run Ubuntu9.10 or Windows

    z EM2416 development board

    Optional items: LCD, earphone/MIC, mouse/U disk, MMC card, SD card

    1.2 Hardware connection

    Power on the development board.

    1.2.1Serial port

    Serial port is use to display information of the development board, but also to send

    command to the board. Connect PC and COM1 of the development board with serial

    cable that provided by Boardcon. In the host, the HyperTerminal in Windows can

    communicate with EM2416 serial port.

    Chapter 4 will describe how to update Linux file by serial port.

  • 8/4/2019 EM2416 Linux User Manual

    6/46

    www.armdesigner.com

    EM2416 Linux User Manual 5

    1.2.2 IROM Mode Download

    EM2416 is able to boot from IROM, and cure bootloader by SD card. User can recure

    bootloader by U-boot(see section4.1). However, if there is no available bootloader in

    Nandflash, please burn bootloader by IROM.

    1.2.3 Network communication

    User can connect PC and the development board directly with cross Ethernet cable, or

    connect Hub and the development board with parallel Ethernet cable for communication.

    Network communication is use to download U-boot and test all kinds of network

    applications. You can get knowledge of it from Section 4 and Section 9.

    The Host default IP address is 192.168.0.12. The destination address of the development

    board is 192.168.0.19. They can be set by users.

    2. Software Environment

    2.1 Build Linux Working Environment

    Before the development, user needs to install the software Ubuntu to build Linux working

    environment. Please refer to the corresponding information for the installation.

    3. Burn Linux into EM2416

    Image files for installation:

    z Sdloader: u-boot-movi.bin ( for booting from SD Card)

    z Bootloader : u-boot-nand.bin ( for booting from Nand Flash)

    z Linux Kernel: zImage (kernel image file)

    z Root file system: rootfs.yaffs2 (file system image file)

    These files are in LINUX/image of the CD-ROM. User can install Linux system with the

    image files.

    Note: command prompt in HOST terminal is ' $ ', and it's '#' in DNW.

  • 8/4/2019 EM2416 Linux User Manual

    7/46

    www.armdesigner.com

    EM2416 Linux User Manual 6

    3.1 U-boot Preparation

    Bootloader plays an important role in embedded system. Its main tasks are as follows:

    z Copy the kernel from flash memory to RAM, and execute the kernel.

    z Initialize the hardware

    z Provide function to write into flash (curing program)

    z Provide the interface for sending commands to the target board and informing the

    target board status to the user.

    Currently u-boot is as the Bootloader of EM2416.

    3.1.1 Configure files in SD Card

    This chapter describe how to burn u-boot.bin , zImage and root_EM2416.yaffs into the

    development board by SD card. The steps are as follows:

    1) Put the CD-ROM into the driver, open CD/Tools/uboot_writer.exe in Windows operating

    system. Put the SD card into a reader and connect it to the computer. Open the disk

    corresponds to SD card in uboot_writer.exe( please use the SD card provided by

    boardcon), as shown:

  • 8/4/2019 EM2416 Linux User Manual

    8/46

    www.armdesigner.com

    EM2416 Linux User Manual 7

    Figure 3.1

    2) Click Browse on the right of the Bootloader, select u-boot-movi.binin CD-ROM

    3) Click Browse on the right of the Kernel, select zImagein CD-ROM4) Click Browse on the right of the Specific Sector , select rootfs.yaffs2in CD-ROM, and

    type 3600000 into the Sector , as shown in figure 3.2

  • 8/4/2019 EM2416 Linux User Manual

    9/46

    www.armdesigner.com

    EM2416 Linux User Manual 8

    Figure 3.2

    5) Click START . Below is the picture shows the burning is successful.

    Figure 3.3

  • 8/4/2019 EM2416 Linux User Manual

    10/46

    www.armdesigner.com

    EM2416 Linux User Manual 9

    6) Reopen the uboot_writer, click Browse on the right of the Specific Sector , select

    u-boot-nand.bin in CD-ROM, and type 3800000 into the Sector. Click START , you can

    get the information as follows:

    Figure 3.4

    7) It means the system has already burned into SD successfully.

    3.1.2 Set U-boot Environment Variables

    Configure EM2416 U-boot including the following items. User must configure it correctly

    for the first time or it will don't work.

    z The development board IP

    z TFTP server IP

    z The kernel booting parameters

    z Bootcmd booting command

    Go to Start ->Programs ->Accessories ->Communications, and select Hyperterminal, type

    a name for the connection into the Name (e.g. " EM2416"). Use the default icon. Click OK.

    As shown in figure 3.6

  • 8/4/2019 EM2416 Linux User Manual

    11/46

    www.armdesigner.com

    EM2416 Linux User Manual 10

    Figure 3.6

    Select COM1 and click OK.

    Figure 3.7

    Select 115200 for the Bits per second. Leave Data bits, Parity and Stop bits on the default

    settings (shown). Select None for the Flow Control. Click OK.

  • 8/4/2019 EM2416 Linux User Manual

    12/46

    www.armdesigner.com

    EM2416 Linux User Manual 11

    Figure 3.8

    Go to File ->save (shown). You can double click EM2416 to open the Hyperterminal next

    time, shown in figure 3.10

    Figure 3.9

  • 8/4/2019 EM2416 Linux User Manual

    13/46

    www.armdesigner.com

    EM2416 Linux User Manual 12

    Figure 3.10

    Open the Hyperterminal, insert the SD card(has burned Sdbootloader) into the SD

    connector, set the board boot from SD card mode.

    SD card mode: (Boot Mode Switch: Push the Boot mode switch at Nor Flash Side)

    Then power on the development board. If Bootloader has been launched successfully, it

    will appear the UBOOT booting information as shown in figure 3.11, press any keys to

    enter the Uboot command mode within 3 seconds.

  • 8/4/2019 EM2416 Linux User Manual

    14/46

    www.armdesigner.com

    EM2416 Linux User Manual 13

    Figure 3.11

    3.3 Transfer and Write image by SD card

    3.3.1 Download and Update system

    Turn on the power and press any keys within 3 seconds to enter the U-boot command

    mode. Input the following commands to download uboot.bin.

    Erase the flash

    # nand scrub

    # nand erase

    Update the bootloader Image.

    #movi read 3800000# 40000 c0000000

    #nand write c0000000 0 40000

    Update the Kernel Image.

    # movi read kernel c0000000

    # nand write c0000000 40000 200000

    Update the Rootfs Image.

    # movi read 3600000# 3C65040 c4000000

    # nand write.yaffs c4000000 400000 3C65040

    Then set board boot from the Nand flash(Boot Mode Switch: Push the Boot mode

    switch at Nand Flash Side),

    and then reboot the board, and then press space to enter the uboot command mode, run

    the follow command to set the U-BOOT environment variables. Please input the following

    commands:

    # setenv bootcmd nand read.jffs2 C0008000 40000 400000;bootm C0008000

    # set bootargs "noinitrd console=ttySAC0,115200 root=/dev/mtdblock2 rootfstype=yaffs2 init=/linuxrc"

    # saveenv

  • 8/4/2019 EM2416 Linux User Manual

    15/46

    www.armdesigner.com

    EM2416 Linux User Manual 14

    4. Install cross Compiler1) Install cross compiler arm-linux-gcc before compiling Linux. The installation package

    is in CD-ROM\TOOLS\cross-4.2.2-eabi.tar.bz2

    cross-4.2.2-eabi is for compiling U-BOOTthe Linux kernel and the file system.

    Enter the UBUNTU system, create an armdirectoryin /usr/local . Enter the new directory

    and decompress the compiler.

    $ sudo mkdir /usr/local/arm

    $ cd /usr/local/arm

    $ sudo tar xjvf /media/cdrom/TOOLS/cross-4.2.2-eabi.tar.bz2

    2edit ./bashrc

    $ sudo gedit ~/.bashrc

    In the last line, add the following command after ' fi '. As shown in figure 4.1

    export PATH=$PATH:/usr/local/arm/4.2.2-eabi/usr/bin

  • 8/4/2019 EM2416 Linux User Manual

    16/46

    www.armdesigner.com

    EM2416 Linux User Manual 15

    Figure 4.1

    Save it and exit.

    And execute the command: $source ~/.bashrc

    Input the following command, we can get the version information on the compiler.

    $ arm-linux-gcc -v

  • 8/4/2019 EM2416 Linux User Manual

    17/46

    www.armdesigner.com

    EM2416 Linux User Manual 16

    Figure 4.2

    By these steps, the cross compiler will be installed.

  • 8/4/2019 EM2416 Linux User Manual

    18/46

    www.armdesigner.com

    EM2416 Linux User Manual 17

    5. Compile UBOOT

    5.1 Unzip the UBOOT Source Package

    Create a directory EM2416 in Ubuntu and modify its rights to make user can modify the

    file in the directory directly.

    $ sudo mkdir /EM2416

    $ sudo chown book:book /EM2416 R

    Note: book is the user name in UBUNTU defined when installed the system. User can

    modify it according to the host user name.

    Create a new folder tftpboot in root file for the storage of uboot.binzImage and so on.

    $ sudo mkdir /tftpboot

    $ sudo chown book:book /tftpboot -R

    Move into the EM2416 directory, unzip the Uboot source package. Please execute the

    following command:

    $ cd /EM2416

    $ tar xjvf /media/cdrom/linux/u-boot-1.3.4.tar.bz2

    5.3 Compile u-boot.bin

    Move into the uboot folder

    $ cd /EM2416/u-boot-1.3.4-samsung

    Clean the generated files in source file,

    $ make distclean

    Configure uboot

    $ make smdk2416_config

    Compile

    $ make all

    After compiled, it generates uboot.bin both in u-boot-1.3.4 direcotry. And it generates

    some tools in u-boot-1.3.4/tools directory as well, e.g.: mkimage.

  • 8/4/2019 EM2416 Linux User Manual

    19/46

    www.armdesigner.com

    EM2416 Linux User Manual 18

    Figure 5.2

    6. Compile Linux kernel source package

    6.1 Unzip the Linux Kernel Source Package

    Move into the EM2416 directory to unzip the linux kernel source package:

    $ cd EM2416

    $ tar xjvf /media/cdrom/LINUX/kernel2416.tar.bz2

    After unzipping, the kernel2416directory is the linux kernel source package.

    6.2 Configuration Steps

    Execute the following command:

    $ cd /EM2416/kernel2416

    $ make menuconfig

    Note: if haven't installed ncurse, it mayappear make menuconfig error. Below is the

    correct information in the terminal.

  • 8/4/2019 EM2416 Linux User Manual

    20/46

    www.armdesigner.com

    EM2416 Linux User Manual 19

    (1) Select Load an Alternate Configuration File with Up and Down key, then press Enter

    (2) Input SAM2416EDK, click OK

  • 8/4/2019 EM2416 Linux User Manual

    21/46

    www.armdesigner.com

    EM2416 Linux User Manual 20

    Click "exit" to move back to the terminal input interface and save it.

    6.3 Compile the zImage

    Execute the following command:

    $ cd /sam2440edk/kernel2416

    Clean the generated files:

    $ make clean

    Compile zImage

    $ make zImage

    After compilation, it generates the Linux kernel compression file zImage both in

    kernel2416/arch /arm/boot directory and in /tftpboot directory.

  • 8/4/2019 EM2416 Linux User Manual

    22/46

    www.armdesigner.com

    EM2416 Linux User Manual 21

    7. Generate the Root File System Image

    (yaffs)

    7.1 File System directory

    Currently EM2416 supports the file system yaffs, and it is placed in CD/LINUX/ROOT/

    root_qtopia.tar.bz2

    7.2 Generate the Image File yaffs

    With the tool mkyaffs2image, it generates the root file system image from the file system

    directory. The tool is placed in CD-ROM/TOOLS/. Copy it to /usr/local/bin directory by the

    following command:

    $ sudo cp /media/cdrom/TOOLS/mkyaffs2image /usr/local/bin

    $ sudo chmod +x /usr/local/bin/mkyaffs2image

    Unzip root_qtopia.tar.bz2 into the folder EM2416.

    $ cd /EM2416

  • 8/4/2019 EM2416 Linux User Manual

    23/46

    www.armdesigner.com

    EM2416 Linux User Manual 22

    $ sudo tar jxvf /media/cdrom/LINUX/root_qtopia.tar.bz2

    $ sudo chown book:book root_qtopia R

    It generates the file system yaffs by the command:

    $ mkyaffs2image 0 root_qtopia root_EM2416.yaffs

    Note: don't forget to type the argument 0. If not, it will appear the information as follows:

    After that, please follow the steps in 3.3.3 to burn the file system image.

    8. Device Drivers and Test

    8.1 Ethernet Device Drivers Test(ping)

    8.1.1 Test Steps

    Run the ping host, enter the IP of the development board in the ubuntu terminal:

    $ ping c 3 192.168.0.19

    If the Ethernet cable is connected correctly, it will print the information:

  • 8/4/2019 EM2416 Linux User Manual

    24/46

    www.armdesigner.com

    EM2416 Linux User Manual 23

    8.2 MMC Card Device Drivers Test

    8.2.1 Configure the Kernel on MMC Card

    1select Device Drivers and press Enter:

    2Select MMC/SD card support, then press Enter

  • 8/4/2019 EM2416 Linux User Manual

    25/46

    www.armdesigner.com

    EM2416 Linux User Manual 24

    3Select the following 4 options:MMC support, MMC debugging, Sansung S3C High

    Speed MMC Interface support and Support Scatter and Gather in HS-MMC.

  • 8/4/2019 EM2416 Linux User Manual

    26/46

    www.armdesigner.com

    EM2416 Linux User Manual 25

    8.2.2 Test Steps

    Insert the MMC card into the SD card connectro , DNW console will display the detected

    information:

    mmcblk0: mmc0:cdde SD02G 1921024KiB

    mmcblk0:mmc0: starting CMD18 arg 00000000 flags 00000035

    p1

    Press Enter in DNW to bring up the console, it will display:

    [root@Industech /]#

    To mount the SD card, please input the following command:

    # mount t vfat /dev/mmcblk0p1 /sdcard

    Then you can read and write on the MMC card, and view the contents in it by the file

    browser in the QT file sytstem.

    #ls /sdcard

    Input the command to unmount the MMC card.

    # umount /sdcard

    8.3 USB Host Interface Device Drivers Test

    8.3.1 Configure the Kernel on USB Host

    1Select Device Drivers -> USB support in the terminal:

  • 8/4/2019 EM2416 Linux User Manual

    27/46

    www.armdesigner.com

    EM2416 Linux User Manual 26

    2Select the following options: Support for Host-side USB, USB device filesystem and

    OHCI HCD support.

    3Select USB Mass Storage support with Up and Down key

  • 8/4/2019 EM2416 Linux User Manual

    28/46

    www.armdesigner.com

    EM2416 Linux User Manual 27

    4After that, select the following options: USB Human Interface Device (full HID) support

    and /dev/hiddev raw HID device support.

  • 8/4/2019 EM2416 Linux User Manual

    29/46

    www.armdesigner.com

    EM2416 Linux User Manual 28

    5) Exit to Device Drivers, and then select SCIS device support

    6select the following options:SCSI device support, legacy /proc/scsi/ support and SCSI

    disk support.

  • 8/4/2019 EM2416 Linux User Manual

    30/46

    www.armdesigner.com

    EM2416 Linux User Manual 29

    8.3.2 Insert USB Mouse/Keyboard

    As have already configured on the USB mouse/keyboard in the kernel, insert USB mouse

    or USB keyboard to the interface USB1-down, it will display the enumeration and driver

    information on the console. Below is the information on insertion and removal of the USB

    mouse.

    8.3.3 Insert USB mass Storage Device

    1) select Device Drivers -> File systems and press Enter

  • 8/4/2019 EM2416 Linux User Manual

    31/46

    www.armdesigner.com

    EM2416 Linux User Manual 30

    2) select DOS/FAT/NT Filesystems

    3) Select VFAT (Windows-95) fs support and select 936 character set.

  • 8/4/2019 EM2416 Linux User Manual

    32/46

    www.armdesigner.com

    EM2416 Linux User Manual 31

    As we have already added the support for USB mouse/keyboard in the kernel, then insert

    USB mass storage device( e.g. U disk) to USB interface, it will display the enumeration

    and driver information on the console. The following figure shows the information when

    inserted a 2G U disk.

    Please press Enter, input the command to mount the U disk

  • 8/4/2019 EM2416 Linux User Manual

    33/46

    www.armdesigner.com

    EM2416 Linux User Manual 32

    # mount -t vfat /dev/sda1 /usbdisk

    List the contents of the U disk, we can view it by the file browser in QT.

    # ls /usbdisk

    Input the command to unmount the U disk.

    $ umount /usbdisk

    8.4 EM2416 Touch Screen Drivers Test

    8.4.1 Configure the kernel on Touch Screen

    1) Select Device Drivers -> Input device support and press Enter:

  • 8/4/2019 EM2416 Linux User Manual

    34/46

    www.armdesigner.com

    EM2416 Linux User Manual 33

    2Select Touchscreen interface

    3) press the Down key to select Touchscreens.

  • 8/4/2019 EM2416 Linux User Manual

    35/46

    www.armdesigner.com

    EM2416 Linux User Manual 34

    4) Select Samsung S3C2410 touchscreen driver to make it support touch screen. As

    follows:

    8.4.2 Test Steps

    Execute the touchscreen calibration file in QT, and click the "+" for the touch screen

    calibration

    9. Develop Application in the Host

    This chapter will provide a simple example, to describe how to develop applications based

    on EM2416:

    9.1 Write Hello Code

    Create a new directory hello on /EM2416/

    $ cd /EM2416

    $ mkdir hello

    Please write the following code and save it as hello/hello.c

  • 8/4/2019 EM2416 Linux User Manual

    36/46

    www.armdesigner.com

    EM2416 Linux User Manual 35

    #include

    int main(void)

    {

    printf("Hello, EM2416.\n");

    return 0;

    }

    9.2 Compile hello

    Input the command to do cross-compilation

    arm-linux-gcc o hello hello.c

    It will generate an executable file hello in hello directory.

    10. Download the Application to the

    EM2416 Board

    10.1 Copy by U Disk

    Insert a U disk to the PC and execute the following command to copy the application hello

    in the terminal. Then insert the U disk to the USB HOST of the development board. It will

    display the information on the U disk in DNW. If don't recognize the U disk, please reinsert

    it .

    Input the command in DNW:

    $ mount -t vfat /dev/sda1 /usbdisk

    $ cd /usbdisk

    ./hello ( execute hello)

  • 8/4/2019 EM2416 Linux User Manual

    37/46

    www.armdesigner.com

    EM2416 Linux User Manual 36

    Appendix A :Network Service

    A.1 ifconfig

    The "Ifconfig" command allows the operating system to setup network interfaces and

    allows the user to view information about the configured network interfaces. Execute it

    without any parameters in EM2416 , it will display the information about the network card

    and the local loop( louploopback). Besides, user can configure the network settings:

    #ifconfig eth0 192.168.0.19 netmask 255.255.255.0

    Assign eth0 with the above values for IPand netmask . If not netmask parameter, its

    netmask is 255.255.255.0 by default. The default network IP of EM2416 is 192.168.0.19,

    which is defined in boot script /etc/eth0-setting. The file also defined the gateway and

    DNS, user can modify them by your configuration.

    The command will take the network card down causing it cannot send or receive any

    information.

    #ifconfig eth0 down

    rout is the common tool for gateway configuration in Linux console. The command shows

    the IP routing table:

    #route

    Set 192.168.0.1 as the default route:

    #route add default gw 192.168.0.1

    Delete the default route.

    #route del default

  • 8/4/2019 EM2416 Linux User Manual

    38/46

    www.armdesigner.com

    EM2416 Linux User Manual 37

    # echo nameserver 218.108.248.248 >>/etc/resolv.conf

    The command above Add DNS service in the development board.

    A.2 ping

    The ping command helps determine if the network is able to communicate with another

    network.

    Input the command:

    ping c 3 192.168.0.1

    The command will send test packages three times continuous to verify if the network can

    communicate normal. It will display the information If connected.

    Configure DNS, user can PING the address of the network domain directly. As shown:

    A.3 Remote Login telnet

    telnet is a common remote login tool. For more function and usage, Please refer to the

    network-related information.

  • 8/4/2019 EM2416 Linux User Manual

    39/46

    www.armdesigner.com

    EM2416 Linux User Manual 38

    If EM2416 is connected to LAN and one computer provides the telnet service, you can

    login this computer by telnet in EM2416. But first of all, you must have the user name and

    password.

    Supposing the IP of the computer with telnet service is 192.168.0.7, user can login the

    computer by the command:

    telnet 192.168.0.7

    Input the user name and password to connect to the remote computer.

    Login BBS by telent

    If EM2416 can connect to the Internet, user can login BBS by the development board.

    Configure the gateway with the command route.

    route add default gw 192.168.0.1

    A.4 Telnet Server inetdStart inetd service

    /etc/rc.d/init.d/netd start

    The development board can be as a telnet server when it has configured an IP address.

    The default IP of the board is 192.168.0.19. Input the command in the terminal of the host:

    telnet 192.168.0.19

    The user name is root,press Enter to login EM2416.

  • 8/4/2019 EM2416 Linux User Manual

    40/46

    www.armdesigner.com

    EM2416 Linux User Manual 39

    A.5 Remote file transfer ftp

    The ftp application method is the same as the standard Linux. Assuming the ftp server IP

    is 192.168.0.19, user can create a new site by the software FFFTP:

    The development board IP: 192.168.0.19, FTP user name:plg, password: plg

    If connect successfully, user can send the file to the development by the software FFFTP.

    A.6 Hypertext Transfer Protocol http

    Input the command in the development board to start http.

    #/etc/rc.d/init.d/httpd start

    User can browse the pages in EM2416 by the IE or other browser. The default IP of the

    board is 192.168.0.19. Input the address in the address bar of the browser:

    http://192.168.0.19

    It will pop up a page if the browser has connected to EM2416.

    Input the command in the shell to stop web sever:

    #/etc/rc.d/init.d/httpd stop

    Restart the page:

    #/etc/rc.d/init.d/httpd start

    Appendix B: Development in QT

    boardcon provides the QTOPIA resource in the

    CD-ROM/LINUX/ROOT/qtopia-free-src-2.2.0 .tar.bz2.

    1. Set environment variables: we have installed g++ in the chapter 3.

    2. Install X11 library files and development kit

    Execute the command to install X11 development kit:

    $ sudo apt-get install x-dev libx11-dev x11proto-xext-dev libxext-dev

    libqt3-mt-dev

  • 8/4/2019 EM2416 Linux User Manual

    41/46

    www.armdesigner.com

    EM2416 Linux User Manual 40

    $ sudo mkdir -p /usr/X11R6/include

    Copy the X11directory

    $ sudo cp -rf /usr/include/X11 /usr/X11R6/include

    3. Compile and install the library that Qtopia depends on

    1) Compile and install the library jpeg

    The source code is /TOOLS/linux/jpegsrc.v6b.tar.gz, unzip it and it generates a

    jpeg-6b directory.

    Configure it by the command:

    $ ./configure --enable-shared --enable-static \

    --prefix=/usr/local/arm/4.2.2-eabi/usr/arm-linux \

    --build=i386 --host=arm

    Modify the generated Makefile, as follows:

    CC= gcc toCC= arm-linux-gcc

    AR= ar rc toAR= arm-linux-ar rc

    AR2= ranlib to AR2= arm-linux-ranlib

    Execute the command for compilation and installation:

    $ make

    $ sudo make install-lib

    It will generate some head file in /usr/local/arm/4.2.2-eabi/usr/arm-linux/include

    directory, also some jpeg library file in lib directory.

    2) Compile and install uuid library

    The source code is e2fsprogs-1.40.2.tar.gz in /TOOLS/linux. Unzip and compile it refer

    to the INSTALL file. For the cross compilation, please specify the cross compiler tool

  • 8/4/2019 EM2416 Linux User Manual

    42/46

    www.armdesigner.com

    EM2416 Linux User Manual 41

    chain and the target board when execute "./configure ". Execute the following

    command:

    $ tar xzf e2fsprogs-1.40.2.tar.gz

    $ cd e2fsprogs-1.40.2/

    $ mkdir build; cd build

    $ ../configure --with-cc=arm-linux-gcc --with-linker=arm-linux-ld --enable-elf-shlibs

    --host=arm -prefix=/usr/local/arm/4.2.2-eabi/usr/arm-linux

    $ make

    $ sudo make install-libs

    The last command install some head file and libraries in include and lib directory , such as

    uuid/uuid.hlibuuid.alibuuid.so and so on.

    3) Compile and install zlib library

    Its source code is zlib-1.2.3.tar.gz in /TOOLS/linux. Unzip and configure it:

    ./configure --shared --prefix=/usr/local/arm/4.2.2-eabi/usr/arm-linux

    Then modify the generated Makefile. Below are the results added the prefix arm-linux-

    CC=arm-linux-gcc

    LDSHARED=arm-linux-gcc -shared -Wl,-soname,libz.so.1

    CPP=arm-linux-gcc -E

    AR=arm-linux-ar rc

    RANLIB=arm-linux-ranlib

    Finally compile and install the library.

    $ make

    $ sudo make install

  • 8/4/2019 EM2416 Linux User Manual

    43/46

    www.armdesigner.com

    EM2416 Linux User Manual 42

    4) Compile and install png library

    Its source code is libpng-1.2.23.tar.bz2 in /TOOLS/linux/. Unzip it and copy makefilein

    its directory. As follows:

    $ cp scripts/makefile.linux ./Makefile

    Then modify the generated Makefile. Below are the results added the prefix arm-linux-

    AR_RC=arm-linux-ar rc

    CC=arm-linux-gcc

    RANLIB=arm-linux-ranlib

    prefix=/usr/local/arm/4.2.2-eabi/usr/arm-linux

    Finally compile and install the library.

    $ make

    $ sudo make install

    5) Compile and install touch screen ts library.

    The source code is tslib-1.3.tar.bz2 in /TOOLS/linux. Unzip it and enter its directory,

    execute the following command:

    $ ./autogen.sh

    $ echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache

    $ ./configure --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=no

    --prefix=/usr/local/arm/4.2.2-eabi/usr/arm-linux

    Modify the following code before Make:

    char *defaulttseventtype="UCB1x00";

    to

    char *defaulttseventtype="H3600";

  • 8/4/2019 EM2416 Linux User Manual

    44/46

    www.armdesigner.com

    EM2416 Linux User Manual 43

    In order to avoid the error libtool:link: only absolute run-paths are allowed, please

    add the absolute path for rpathin plugins/Makefile, as follows:

    #LDFLAGS :=$(LDFLAGS) -rpath $(PLUGIN_DIR)

    LDFLAGS :=$(LDFLAGS) -rpath `cd $(PLUGIN_DIR) && pwd`

    Finally compile and install the library.

    $ make

    $ sudo make install

    4. Modify and compile QT with patch

    $cd /EM2416

    $tar xjvf /media/cdrom/LINUX/ROOT/qtopia-free-src-2.2.0.tar.bz2

    $ cd qtopia-free-2.2.0

    Input the command

    $ patch p1 < qtopia-EM2416.patch

    $ echo'yes'|./configure -qte '-embedded -xplatform linux-arm-g++ -qconfig qpe

    -depths 16,24 -no-qvfb -system-jpeg -system-libpng -system-zlib -tslib gif

    -thread -lts' -qpe ' -xplatform linux-arm-g++ -edition pda -displaysize

    320x240 ' -qt2 ' -no-xft' -dqt '-no-xft'

    After the configuration, it will display some instructions, as shown:

  • 8/4/2019 EM2416 Linux User Manual

    45/46

    www.armdesigner.com

    EM2416 Linux User Manual 44

    Execute "make" for compilation, it will generate the executable file and the library file in

    the following directories.

    Qtopia/bin

    Qtopia/lib

    Qtopia/plugins

    Execute "make install " for installation. The command wil copy all the necessary

    directories and files to the qtopia/image/opt/Qtopia directory.

    $ make

    $ make install

    5. Install and start QT in the development board

    The root file system of the board is stored in CD-ROM/LINUX/ROOT/root_qtopia.tar.bz2.

    And the QT source code is in /LINUX/ROOT/qtopia-free-src-2.2.0.tar.bz2. Unzip them and

    input the command:

    $ cd /EM2416

    $ tar xjvf /media/cdrom/LINUX/ROOT/root_qtopia.tar.bz2

    $ sudo chown book:book root_qtopia -R

  • 8/4/2019 EM2416 Linux User Manual

    46/46

    www.armdesigner.com

    root_qtopia is the file system, which can be changed to yaffs format and burned into the

    development board. If user download the compiled QT system into the root_qtopia, please

    do the following step to support the new Qtopia in root_qtopia directory:

    1 copy the recompiled qtopia/image/opt/ to the root directory.

    $ cd /EM2416/qtopia-free-2.2.0

    $ cp rf qtopia/image/opt /EM2416/root_qtopia

    2 modify the file property of the root_qtopia

    $ cd /EM2416/root_qtopia

    $ chmod +x etc/init.d/rcS

    $ cd dev

    $ sudo mknod console c 5 1

    $ sudo mknod null c 1 3

    After generates the new root file system, please update the file system referring to the

    chapter 8.