download - special computing

34
EMBEDDED AND NETWORK COMPUTING TECHNOLOGIES GETTING STARTED WITH THE QIL-A9260 Calao Systems 334 rue des Vingt Toises Le MagistèreII 38950 Saint Martin Le Vinoux France Phone = +33 (0)4 76 56 38 05 Fax = +33 (0)4 76 56 38 06 E-mail = [email protected] = [email protected] Datasheet GSG-00006-A01 1/34

Upload: others

Post on 09-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: download - Special Computing

EMBEDDED AND NETWORK COMPUTING TECHNOLOGIES

GETTING STARTED

WITH THE QIL-A9260

Calao Systems334 rue des Vingt ToisesLe MagistèreII38950 Saint Martin Le VinouxFrancePhone = +33 (0)4 76 56 38 05Fax = +33 (0)4 76 56 38 06

E-mail = [email protected] = [email protected]

Datasheet GSG-00006-A01 1/34

Page 2: download - Special Computing

TABLE OF CONTENTS

Section 1...............................................................................................................................................31.Introduction...................................................................................................................................3

Section 2 ..............................................................................................................................................41.QIL-A9260 from scratch..............................................................................................................4

1.1.AT91Bootstrap......................................................................................................................41.2.U-Boot...................................................................................................................................51.3.Linux Kernel.........................................................................................................................6

Section 3...............................................................................................................................................81.Buildroot ......................................................................................................................................8

1.1.Buildroot installation.............................................................................................................81.2.How to install the Root FS on the QIL-A9260.....................................................................8

Section 4.............................................................................................................................................111.1.The uClibc toolchain...........................................................................................................111.2.«Hello world» application...................................................................................................121.3.Debugging an application...................................................................................................13

Section 5.............................................................................................................................................151.SAM-BA.....................................................................................................................................15

1.1.Introduction.........................................................................................................................151.1.How to use SAM-BA .........................................................................................................16

Section 6.............................................................................................................................................211.Errata...........................................................................................................................................21

Section 7.............................................................................................................................................221.Revision History.........................................................................................................................22

1.1.Revision History.................................................................................................................22Section 8.............................................................................................................................................23

1.COPYRIGHT..............................................................................................................................23Annexe................................................................................................................................................24

UBOOT list commands.................................................................................................................24

Datasheet GSG-00006-A01 2/34

Page 3: download - Special Computing

SECTION 1

1. Introduction

This getting started guide is aimed at helping the reader become familiar with the QIL-A9260. First, we'll describe how to build the AT91Bootstrap loader, Uboot, and the linux kernel from the source code. We will see how to generate the root file system from buildroot. Then we will present you how to make and debug a software application with the uClibc toolchain. Eventually we will show you how to use the SAM-BA utility which allow to program the nand flash memory embedded on the QIL-A9260 module.

Datasheet GSG-00006-A01 3/34

Page 4: download - Special Computing

SECTION 2

1. QIL-A9260 from scratch1.1. AT91Bootstrap

The AT91Bootstrap loader is used to download the second level bootloader that is to say UBOOT from the NAND Flash memory. When the AT91SAM9260 boots, the AT91 Bootstrap loader is copied into the 4Kbytes internal SRAM and executed by branching at address 0x0000_0000 after remap.

Here are the steps needed to compile the AT91bootstrap loader.

● Download the source code from the calao ftp site● cd AT91BOOTLOADER/board/qil-a9260/nandflash/● Edit the make file to set the name of the cross compiler you are using.

set CROSS_COMPILE=arm-elf- for example

● then issue the make command

Datasheet GSG-00006-A01 4/34

The file generated by your cross-compiler should be less than 4096 bytes.

For more information about the AT91 Bootstrap loader see the following link:

http://www.atmel.com/dyn/resources/prod_documents/doc6277.pdf

Page 5: download - Special Computing

Once the compilation ended, you should have the file named nandflash_qil-a9260.bin

1.2. U-Boot

U-Boot is downloaded from the nand flash to the last megabyte of the SDRAM by the AT91 bootstrap loader. The first level bootloader is configured to download 196Kbytesfrom the nand flash (offset: 0x20000) in the SDRAM memory (offset: 0x23F00000).

Here are the steps needed to compile U-Boot.

● Download the source code from the calao ftp site.● cd UBOOT● make qil-a9260_config● Edit the makefile to set the name of the cross compiler you are using.

ifeq ($(ARCH),arm)CROSS_COMPILE = arm-linux-endif

● issue the make command

● Once the compilation ended, you should have a binary file named u-boot.bin

Datasheet GSG-00006-A01 5/34

Page 6: download - Special Computing

Note: We used the DENX toolchain to built u-boot.You can download this cross-compilation toolchain from the following adress: ftp://mirror.switch.ch/mirror/eldk/eldk/3.1.1/arm-linux-x86/iso/arm-2005-03-06.iso

1.3. Linux Kernel

The linux kernel will be setup and built in the usual way.First we 'll configure the kernel with the default configuration files.There are 2 configuration files for the kernel:

● qil-a9260_jffs2_defconfig● qil-a9260_cpio_defconfig

The first configuration file allows to built a kernel which mount the root file system from the first nand flash partition (/dev/mtd1). The second one allows to built a kernel bound to a root file system (cpio archive).

Here are the steps needed to compile the linux kernel.

● cd LINUX_KERNEL_V2.6.21/● make qil-a9260_jffs2_defconfig or qil-a9260_cpio_defconfig

If you want to change the linux kernel configuration issue the following command:

● make menuconfig

Once configured and saved, edit the makefile and specify the name of your cross-compiler.Then issue the make command to built the kernel

● make uImage

Datasheet GSG-00006-A01 6/34

Page 7: download - Special Computing

● Once the compilation ended, you should have a binary file named uImage in the /ARCH/ARM/BOOT/ directory

Datasheet GSG-00006-A01 7/34

Page 8: download - Special Computing

SECTION 3

1. Buildroot

Buildroot allows to generate both a cross-compilation toolchain and a jffs2 root file system for the QIL-A9260 module.

1.1. Buildroot installation

Here are the steps needed to install a cross compiler & generate a root file system:

● Download the source code from the calao ftp site

The configuration step is very similar to the linux kernel. Indeed, if you want to custumize buildroot issue the following command:

● make menuconfig

Once everything is configured, issue the make command

Note: You could also custumize busybox by issuing the following command: make busybox-menuconfig

● make

Once finished, we should obtain a rootfs.arm.jffs2 which could be program in one of the available nand flash partition.

1.2. How to install the Root FS on the QIL-A9260

The QIL-A9260 boots a linux kernel pre-installed in the nand flash memory. Here is a brief description of the nand flash memory mapping.On the first partition, we reserved the first 16Mbytes for the linux kernels. Indeed at the 0x000A0000 offset we put a rescue linux kernel bound to a compressed cpio rfs image and at the 0x400000 offset we put a second linux kernel which mounts the RFS from the 2nd partition. Then we find two 120 Mbytes partitions. We put on the first one the default jffs2 root file system and let the second one available for the user.

Here is the list of the default partitions:

➢ 0x00000000-0x01000000 : "Uboot & Kernel" ➢ 0x01000000-0x08800000 : "Root FS" ➢ 0x08800000-0x10000000 : "FS"

Note: You can customize the nand flash memory mapping by editing the board-qil-a9260.c located in the /arch/arm/mach-at91/ directory of the linux kernel source tree.

Datasheet GSG-00006-A01 8/34

Page 9: download - Special Computing

/* * NAND flash */

static struct mtd_partition __initdata ek_nand_partition[] = {{

.name = "Uboot & Kernel",

.offset = 0x00000000,

.size = 16 * 1024 * 1024,},{

.name = "Root FS",

.offset = 0x01000000,

.size = 120 * 1024 * 1024,},{

.name = "FS",

.offset = 0x08800000,

.size = 120 * 1024 * 1024,},

};

If you want to install your customized root file system quickly without destroying the default one, you can put it on the second partition and modify the u-boot bootargs variable.

Now, let's see how we can do that !!!

First, we need to transfer the jffs2 root file system to the target. Several possibilities are available:By pluging a usb memory key containing the RFS on the MB-QIL-A9260 USB port or by downloading it via tftp from a host.

Here is an example using a usb memory key

We can copy your root filesystem on a USB memory key and then mount it as it describes below:

# mount -t vfat /dev/sda1 /mnt#cp mnt/rootfs.arm.jffs2 /root#umount /mnt# ls -al drwxr-xr-x 2 root root 0 Jan 1 00:02 .drwxr-xr-x 16 rootroot 0 Jan 1 00:00 ..-rw-r—r-- 1 root root 720 Jan 1 00:03 .ash_history-rw-r—r-- 1 root root 0 Apr 6 2007 .bash_history-rw-r—r-- 1 root root 175 Apr 6 2007 .bash_logout-rw-r—r-- 1 root root 161 Apr 6 2007 .bash_profile-rw-r—r-- 1 root root 1711 Apr 6 2007 .bashrc-rw-r—r-- 1 root root 2228224 Jan 1 00:02 rootfs.arm.jffs2

Datasheet GSG-00006-A01 9/34

Page 10: download - Special Computing

Let's erase the second partition with the following command:

# flash_eraseall -j /dev/mtd2Erasing 128 Kibyte @ 77e0000 -- 99 % complete. Cleanmarker written at 77e0000.

Let's copy the new root file system on the second partition# flashcp rootfs.arm.jffs2 /dev/mtd2 Now reboot the QIL-A9260 by issuing the following command# reboot

During the reboot, press a key when you will see the uboot countdown: Hit any key to stop autoboot: 0

Now you can modify the u-boot bootargs variable

QIL-A9260> printenvbootdelay=3baudrate=115200ethaddr=00:0D:00:0D:00:ABnetmask=255.255.255.0autostart=yesserverip=192.168.1.15ipaddr=192.168.1.100bootargs=rootfstype=jffs2 root=/dev/mtdblock1bootcmd=nboot 21000000 0 500000stdin=serialstdout=serialstderr=serial

Environment size: 252/4092 bytesQIL-A9260> setenv bootargs rootfstype=jffs2 root=/dev/mtdblock2QIL-A9260> saveenvSaving Environment to dataflash...QIL-A9260>

Now you can reset the QIL-A9260 and see if the new RFS is ok !!!!!

Datasheet GSG-00006-A01 10/34

Page 11: download - Special Computing

SECTION 4

1.1. The uClibc toolchain

Buildroot provides a cross compilation toolchain for the QIL-A9260. It is located in the following directory /QIL-A9260_build_arm/staging_dir/bin.If you want to use the µClibc toochain set your PATH environnement variable with the directory below.

Note: Usually, software development is done on a host computer using a cross-compilation toolchain. However you can choose to install the cross-compilation toolchain in the target root file system via the buildroot configuration menu.

Datasheet GSG-00006-A01 11/34

Page 12: download - Special Computing

1.2. «Hello world» application

Once you have setup your environment, you can compile the hello_world.c example by issuing the following command.

arm-linux-gcc -o hello_world hello_world.c

#include <stdio.h>int main(void) {

printf("hello world\n");return 0;

}

Note: --static option can be added to the LDFLAGS in order to link the application statically.

Now you can download the hello_world program on the QIL-A9260 target.

From your target, you can use for example tftp as it is available in the default busysbox configuration.

● tftp -g -r hello_world « ip_address » (ip_address: host ip)● chmod +x hello_world

Now, you can start the hello_world program by issuing

# ./hello_worldhello world #

Datasheet GSG-00006-A01 12/34

Page 13: download - Special Computing

1.3. Debugging an application

In order to debug your appplication you need first to enable the building of both GDB server for the target and GDB client for the host from the buildroot menu (Toolchain options).

Once your target root file systems is built, you can install it on the target and start the gdbserver.

# gdbserver localhost:2000 hello Process hello created; pid = 723 Listening on port 2000

On your host issue the following command:

gh@gh-desktop:~/hello_world$ arm-linux-gdb hello

GNU gdb 6.5Copyright (C) 2006 Free Software Foundation, Inc.

Datasheet GSG-00006-A01 13/34

Page 14: download - Special Computing

GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.Type "show copying" to see the conditions.There is absolutely no warranty for GDB. Type "show warranty" for details.This GDB was configured as "--host=i386-pc-linux-gnu –target=arm-linux-uclibc"...(gdb)

Now issue a target remote 192.168.1.100:2000 from gdbRemote debugging using 192.168.1.100:2000warning: Remote failure reply: E010x400009f0 in ?? ()warning: Unable to find dynamic linker breakpoint function.GDB will be unable to debug shared library initializersand track explicitly loaded dynamic code.(gdb)

Now you are ready to debug your application !!!!

Datasheet GSG-00006-A01 14/34

Page 15: download - Special Computing

SECTION 5

1. SAM-BAThis part describes how to update the QIL-A9260 with the SAM-BA utility.

1.1. Introduction

Here is the default configuration of the nand flash memory:

Offset File Size Remark0x00000000 nandflash_qil-a9260.bin =< 4Kb0x00020000 u-boot.bin =<196Kb0x000A0000 uImage_cpio ~3Mb Rescue linux kernel bound with a cpio RFS0x00400000 uImage_jffs2 ~1.2Mb Linux kernel (mount the RFS from /dev/mtd1)0x01000000 «Root FS» 120Mb The default root filesystem is located here.0x08800000 «FS» 120Mb

When you want to update the QIL-A9260 module, you need to erase the first block of the nandflash. Indeed if you want to be able to upgrade the QIL-A9260 with SAM-BA, the ROM boot program don't have to find a valid ARM vector sequence (see the paragraph 13. AT91SAM9260 Boot program in the AT91SAM9260 datasheet). In order to erase the first block of the nand flash memory, you should hold the SW1 user push button while resetting the board.

Now, let's see how to upgrade the QIL-A9260.

Datasheet GSG-00006-A01 15/34

If you put your own first level bootloader, don't forget to put a recovery function in order to be able to erase the first block of the nandflash memory. Otherwise in order to use SAM-BA, you should open JP2, start SAM-BA and then re-solder JP2. Only after this step, you could upgrade the QIL-A9260 module.

Page 16: download - Special Computing

1.2. How to use SAM-BA

● First install the SAM-BA utility

● First, connect either a USB cable (UDP port) or a RS232 cable (DBG port) between your host and the QIL-Motherboard.

● Start SAM-BA application by clicking on the icon below.

● Choose the usb or the Serial communication interface & the AT91SAM9260-EK board.● Click on the « Connect » button.

Remark: The QIL-A9260 is very similar to the AT91SAM9260-EK as far as the memory configuration is concerned, that's the reason why you can use the AT91SAM9260-EK configuration.

Once started, you can see on the screen three different areas:

● Memory display area● Memory download area● TCL shell

Datasheet GSG-00006-A01 16/34

Use the lastest version of the SAM-BA utility (V2.6). Indeed, the old versions contains a bug on the nand flash bad block management.

Page 17: download - Special Computing

In order to program the NAND Flash memory follow the stages below:

● In the memory download area, click on the appropriate tab in order to choose the NAND memory.

● Select the « NandFlash Init » script.● Click on the « Execute » button.

Once the Nand Flash interface is initialized, you can erase the nand flash memory.

Choose the « NandFlash Erase All » script. Click on the « Execute » Button.

Datasheet GSG-00006-A01 17/34

Page 18: download - Special Computing

Once the nand flash erased, you can put the first level bootstrap loader at address 0x00000000.

In the memory download area:

● Choose the « NandFlash send boot file » script.● Click on the « Execute » button.

Datasheet GSG-00006-A01 18/34

Page 19: download - Special Computing

A pop-up window opens.

● Select the nandflash_qil-a9260.bin binary file● Click on the « Open » button to start the uploading.

In order to program u-boot in the nand flash memory:

● Enter 0x00020000 in the address field,● Click on the « open folder » button.● Select the u-boot binary file.● Click on the « Send File » button to start the uploading.

Datasheet GSG-00006-A01 19/34

Page 20: download - Special Computing

You can repeat the previous step in order to program the linux kernel uImage in the nand flash.Once upgraded, you should see in the hyperterminal:

Datasheet GSG-00006-A01 20/34

Page 21: download - Special Computing

SECTION 6

1. Errata

Datasheet GSG-00006-A01 21/34

Page 22: download - Special Computing

SECTION 7

1. Revision History1.1. Revision History

Date Version Remarks2007-09-21 A01 first version

Datasheet GSG-00006-A01 22/34

Page 23: download - Special Computing

SECTION 8

1. COPYRIGHT

Notice: The products specifications provided in this datasheet are subject to change without notice.©2007 CALAO SYSTEMS-All Rights Reserved.The CALAO SYSTEMS logo is a registered trademark of CALAO SYSTEMS.All other names are the property of their respective owners.

Datasheet GSG-00006-A01 23/34

Page 24: download - Special Computing

ANNEXE

UBOOT list commands

Here is the list of the u-boot commands

? - alias for 'help'

autoscr - run script from memory

The autoscr command allows “shell” scripts to run under U-Boot. To create a U-Boot script image, commands are written to a text file. Then the mkimage tool [of a suitable compiler] is used to convert this text file into a U-Boot image using the image type script. This image can be loaded like any other image file. Autoscr runs the commands in this image.

base - print or set address offset

base - print address offset for memory commands base off - set address offset for memory commands to 'off'

Use the base command (short: ba) to print or set a "base address" used as an address offset for all memory commands; the default value of the base address is 0, so all addresses you enter are used unmodified. However, when you repeatedly have to access a certain memory region it can be very convenient to set the base address to the start of this area and then use only the offsets.

boot - boot default, i.e., run 'bootcmd'

bootd - boot default, i.e., run 'bootcmd'

The bootd (short: boot) executes the default boot command, i.e. what happens when you don't interrupt the initial countdown. This is a synonym for the run bootcmd command.

bootm - boot application image from memory

bootm [addr [arg ...]]

- boot application image stored in memory passing arguments 'arg...'; when booting a Linuxkernel,‘arg' can be the address of an initrd image. The bootm command is used to start operating system images. From the image header it gets information about the type of the operating system, the file compression method used (if any), the load and entry point addresses, etc. The command will then load the image to the required memory address, uncompressing it on the fly if necessary. Depending on the OS it will pass the required boot arguments and start the OS at it's entry point. The first argument to bootm is the memory address (in RAM, ROM or flash memory) where the image is stored, followed by optional arguments that depend on the OS. For Linux, exactly one optional argument can be passed. If it is present, it is interpreted as the start address of a initrd ramdisk image (in RAM, ROM or flash memory). In this case the bootm command consists of three steps:

Datasheet GSG-00006-A01 24/34

Page 25: download - Special Computing

first the Linux kernel image is uncompressed and copied into RAM, then the ramdisk image is loaded to RAM, and finally control is passed to the Linux kernel, passing information about the location and size of the ramdisk image.

To boot a Linux kernel image without a initrd ramdisk image, the following command can be used:

=> bootm $(kernel_addr)

If a ramdisk image is used, type:

=> bootm $(kernel_addr) $(ramdisk_addr)

Both examples imply that the variables used are set to correct addresses for a kernel and an initrd ramdisk image.When booting images that have been loaded to RAM (for instance using TFTP download) you have to be careful that the locations where the (compressed) images were stored do not overlap with the memory needed to load the uncompressed kernel. For instance, if you load a ramdisk image at a location in low memory, it may be overwritten when the Linux kernel gets loaded. This will cause undefined system crashes.

bootp - boot image via network using BootP/TFTP protocolbootp [loadAddress] [bootfilename]

cmp - memory comparecmp [.b, .w, .l] addr1 addr2 (count)

The cmp command tests of the contents of two memory areas and determines whether or not the contents of the two memory areas are identical or not. The command will either test the whole area as specified by the 3rd (count) argument or stop at the first difference if the count argument is not specified.

coninfo - print console devices and informationThe coninfo command (short: conin) displays information about the available console I/O devices.

QIL-A9260> coninfoList of available devices: serial 80000003 SIO stdin stdout stderr

The output contains the device name, flags, and the current usage. For example, the output “serial 80000003 SIO stdin stdout stderr” means that the serial device is a system device (flag'S') which provides input (flag 'I') and output (flag 'O') functionality and is currently assigned to the 3 standard I/O streams stdin, stdout, and stderr.

Datasheet GSG-00006-A01 25/34

Page 26: download - Special Computing

cp - memory copycp [.b, .w, .l] source target count

The memory copy command copies data in memory, starting at the “source” address to the “target”address. The “count” field specifies the number of bytes, words or long words to be copied depending upon the extension field of the cp command. If a “.b” extension is used, the count field specifies the number of bytes. Likewise, if a “.w” or “.l” extension is used, the count field respectively specifies the number of words or long words.The cp command is used as a FLASH programming command. The cp command can copy data from one memory element to another memory element. The source can be RAM/ROM/FLASH/EPROM or any other type of memory. The destination or target memory is usually RAM; however the target memory can also be FLASH or other type of programmable, non-volatile memory. If the destination for the data is FLASH or other type of programmable, non-volatile memory, the U-Boot monitor program will determine the type of memory used as the destination and choose the appropriate programming algorithm.

crc32 - checksum calculation

crc32 address count [addr] - compute CRC32 checksum [save at addr]

The crc32 command (short: crc) can be used to calculate a CRC32 checksum over a range of memory:

QIL-A9260> crc 22000000 10CRC32 for 22000000 ... 2200000f ==> 14a0f96b=> crc 100004 3FC

When used with 3 arguments, the command stores the calculated checksum at the given address:

QIL-A9260> crc 22000000 10 23000000CRC32 for 22000000 ... 2200000f ==> 14a0f96bQIL-A9260> md 23000000 423000000: 14a0f96b fffb37ff efafeeee fffff7fe k....7..........

date - set the date & time

date MMDDhhmmCCYY

will set the date to day "DD" of month "MM" in year "CCYY" with a time of "hh" hours and "mm" minutes.

Example: date 100612252004 to set the date to 06th Oct 2004 at 12:25

echo - echo args to console

echo [args..] - echo args to console; \c suppresses newline

Datasheet GSG-00006-A01 26/34

Page 27: download - Special Computing

erase - erase FLASH memory

reset - No help available. erase start end - erase FLASH from addr 'start' to addr 'end' erase N:SF[-SL] - erase sectors SF-SL in FLASH bank # N erase bank N - erase FLASH bank # N erase all - erase all FLASH banks

fatinfo - print information about filesystem

fatinfo <interface> <dev[:part]>- print information about filesystem from 'dev' on 'interface'

fatload - load binary file from a dos filesystem

fatload <interface> <dev[:part]> <addr> <filename> [bytes] - load binary file 'filename' from 'dev' on 'interface'to address 'addr' from dos filesystem

fatls - list files in a directory (default /)

fatls <interface> <dev[:part]> [directory]

flinfo - print FLASH memory information

flinfo - print information for all FLASH memory banks

flinfo N - print information for FLASH memory bank # N

go - start application at address 'addr'

go addr [arg ...] - start application at address 'addr' passing 'arg' as arguments

U-Boot has support for so-called standalone applications. These are programs that do not require the complex environment of an operating system to run. Instead they can be loaded and executed by U-Boot directly, utilizing U-Boot's service functions like console I/O or malloc() and free(). This can be used to dynamically load and run special extensions to U-Boot like special hardware test routines or bootstrap code to load an OS image from some filesystem. The go command is used to start such standalone applications.The optional arguments are passed to the application without modification.

Datasheet GSG-00006-A01 27/34

Page 28: download - Special Computing

help - print online help

help [command ...] - show help information (for 'command')

'help' prints online help for the monitor commands.Without arguments, it prints a short usage message for all commands.To get detailed help information for specific commands you can type

'help' with one or more command names as arguments.

The help command (short: h or ?) prints online help. Without any arguments, the help command prints a list of all U-Boot commands that are available in your configuration of U-Boot. You can get detailed information for a specific command by typing its name as argument to the help command:

itest - return true/false on integer compareitest [.b, .w, .l, .s] [*]value1 <op> [*]value2

loadb - load binary file over serial line (kermit mode)loadb [ off ] [ baud ]

- load binary file over serial line with offset 'off' and baudrate 'baud'

loady - load binary file over serial line (ymodem mode)loads [ off ]

-load S-Record file over serial line with offset 'off'

loop - infinite loop on address rangeloop [.b, .w, .l] address number_of_objects

- loop on a set of addresses

The loop command reads in a tight loop from a range of memory. This is intended as a special form of a memory test, since this command tries to read the memory as fast as possible. This command will never terminate. There is no way to stop it but to reset the board!

md - memory display

md [.b, .w, .l] address [# of objects]-memory display

QIL-A9260> md 23fe0000 23fe0000: 777fffff 66acdfbd fffaffff 7edfffff ...w...f.......~ 23fe0010: 5f178fbb 5e3fdeff bbb6fff7 dfe0feff ..._..?^........ 23fe0020: 7ff27b7f dbe0dfef bf3b3fff fcdfceef .{.......?;..... 23fe0030: 7ffffb7f dfcdffef 7353db37 9f4fefff ........7.Ss..O. 23fe0040: 02ffdf7f cfd4ceff bb52ffff dadafbef ..........R..... 23fe0050: 33fbffff dc4dceff 7edafbff dfddff7f ...3..M....~.... 23fe0060: ff57ff7f dcdcfeef ba3b7bff dfceffef ..W......{;..... 23fe0070: 7f4377bb 7f545ff2 7affffff cbfeddfe .wC.._T....z....

Datasheet GSG-00006-A01 28/34

Page 29: download - Special Computing

mm - memory modify (auto-incrementing)mm [.b, .w, .l] address

- memory modify, auto increment address

The mm is a method to interactively modify memory contents. It will display the address and current contents and then prompt for user input. If you enter a legal hexadecimal number, this new value will be written to the address. Then the next address will be prompted. If you don't enter any value and just press Enter, then the contents of this address will remain unchanged. The command stops as soon as you enter any data that is not a hex number.

mtest - simple RAM test

mtest [start [end [pattern]]]- simple RAM read/write test

The mtest provides a simple memory test.This tests writes to memory, thus modifying the memory contents. It will fail when applied to ROM or flash memory. This command may crash the system when the tested memory range includes areas that are needed for the operation of the U-Boot firmware (like exception vector code, or U-Boot's internal program code, stack or heap memory areas).

mw - memory write (fill)

mw [.b, .w, .l] address value [count]- write memory

The mw is a way to initialize (fill) memory with some value. When called without a count argument, the value will be written only to the specified address. When used with a count, then a whole memory areas will be initialized with this value:

nand - NAND sub-system

Here is the commands list related to the NAND Flash memory

nand info - show available NAND devicesnand device [dev] - show or set current devicenand read[.jffs2[s]] addr off sizenand write[.jffs2] addr off size - read/write `size' bytes starting

at offset `off' to/from memory address `addr'nand erase [clean] [off size] - erase `size' bytes from

offset `off' (entire device if not specified)nand bad - show bad blocksnand read.oob addr off size - read out-of-band datanand write.oob addr off size - read out-of-band data

Datasheet GSG-00006-A01 29/34

Page 30: download - Special Computing

nboot - boot from NAND device

nboot loadAddr dev

QIL-A9260> nand device

Device 0: NAND 256MiB 3,3V 8-bit QIL-A9260> nboot 21000000 0 a0000

Loading from device 0: NAND 256MiB 3,3V 8-bit (offset 0xa0000)

Image Name: Linux-2.6.21.5 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3146364 Bytes = 3 MB Load Address: 20008000 Entry Point: 20008000

Automatic boot of image at addr 0x21000000 ... ## Booting image at 21000000 ...

Image Name: Linux-2.6.21.5 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3146364 Bytes = 3 MB Load Address: 20008000 Entry Point: 20008000 Verifying Checksum ... OK

OK

nfs - boot image via network using NFS protocol

nfs [loadAddress] [host ip addr:bootfilename]

nm - memory modify (constant address)

nm [.b, .w, .l] address- memory modify, read and keep address

The nm command (non-incrementing memory modify) can be used to interactively write different data several times to the same address.

ping - send ICMP ECHO_REQUEST to network host

ping pingAddress

QIL-A9260> ping 192.168.1.11host 192.168.1.11 is aliveQIL-A9260>

printenv- print environment variables

printenv - print values of all environment variables

Datasheet GSG-00006-A01 30/34

Page 31: download - Special Computing

printenv name ...- print value of environment variable 'name'

The printenv command prints one, several or all variables of the U-Boot environment. When arguments are given, these are interpreted as the names of environment variables which will be printed with their values:

QIL-A9260> printenv ethaddr ipaddr ethaddr=00:0D:00:0D:00:AB ipaddr=192.168.1.100

Without arguments, printenv prints all a list with all variables in the environment and their values, plus some statistics about the current usage and the total size of the memory available for the environment.

QIL-A9260> printenv bootdelay=3 baudrate=115200 ethaddr=00:0D:00:0D:00:AB netmask=255.255.255.0 autostart=yes serverip=192.168.1.15 ipaddr=192.168.1.100 bootargs=rootfstype=jffs2 root=/dev/mtdblock1 bootcmd=nboot 21000000 0 400000 stdin=serial stdout=serial stderr=serial

Environment size: 252/4092 bytes

protect - enable or disable FLASH write protection

Note: Not concerned

rarpboot- boot image via network using RARP/TFTP protocol

rarpboot [loadAddress] [bootfilename]

reset - Perform RESET of the CPU

The reset command reboots the system

Note: Not implemented

Datasheet GSG-00006-A01 31/34

Page 32: download - Special Computing

run - run commands in an environment variable

run var [...] - run the commands in the environment variable(s) 'var'

You can use U-Boot environment variables to store commands and even sequences of commands. To execute such a command, you use the run command:

QIL-A9260> setenv test echo this is an example\;printenv ipaddr\;echo DoneQIL-A9260> printenv testtest=echo this is an example;printenv ipaddr;echo DoneQIL-A9260> run testthis is an exampleipaddr=192.168.1.100Done

You can call run with several variables as arguments, in which case these commands will be executed in sequence:

QIL-A9260> setenv test2 echo this is another example\;printenv ethadrr\;echo Done QIL-A9260> printenv test test2 test=echo this is an example;printenv ipaddr;echo Done test2=echo this is another example;printenv ethaddr;echo Done QIL-A9260> run test test2 this is an example ipaddr=192.168.1.100 Done this is another example ethaddr=00:0D:00:0D:00:AB Done

If a U-Boot variable contains several commands (separated by semicolon), and one of these commands fails when you "run" this variable, the remaining commands will be executed anyway. If you execute several variables with one call to run, any failing command will cause "run" to terminate, i.e. the remaining variables are not executed.

saveenv - save environment variables to persistent storage

All changes you make to the U-Boot environment are made in RAM only. They are lost as soon as you reboot the system. If you want to make your changes permanent you have to use the saveenv command to write a copy of the environment settings to persistent storage, from where they are automatically loaded during startup:

QIL-A9260> saveenv Saving Environment to dataflash...

setenv - set environment variables

setenv name value ...- set environment variable 'name' to 'value ...'

setenv name

Datasheet GSG-00006-A01 32/34

Page 33: download - Special Computing

- delete environment variable 'name'

To modify the U-Boot environment you have to use the setenv command. When called with exactly one argument, it will delete any variable of that name from U-Boot's environment, if such a variable exists. Any storage occupied for such a variable will be automatically reclaimed:

QIL-A9260> setenv foo this is an example value QIL-A9260> printenv foo foo=this is an example value QIL-A9260> setenv foo QIL-A9260> printenv foo ## Error: "foo" not defined

When called with more arguments, the first one will again be the name of the variable, and all following arguments will (concatenated by single space characters) form the value that gets stored for this variable. New variables will be automatically created, existing ones overwritten.

QIL-A9260> printenv usba9263 ## Error: "usba9263" not defined QIL-A9260> setenv usba9263 This is a new example QIL-A9260> printenv usba9263 usba9263=This is a new example QIL-A9260>

Remember standard shell quoting rules when the value of a variable shall contain characters that have a special meaning to the command line parser (like the $ character that is used for variable substitution or the semicolon which separates commands). Use the backslash (\) character to escape such special characters.

QIL-A9260> setenv cons_opts console=tty0 console=ttyS0,\$(baudrate) QIL-A9260> printenv cons_opts cons_opts=console=tty0 console=ttyS0,$(baudrate) QIL-A9260>

There is no restriction on the characters that can be used in a variable name except the restrictions imposed by the command line parser (like using backslash for quoting, space and tab characters to separate arguments, or semicolon and newline to separate commands). Even strange input like "=-/|()+=" is a perfectly legal variable name in U-Boot.

A common mistake is to write setenv name=value instead of setenv name value

There will be no error message, which lets you believe everything went OK, but it didn't: instead of setting the variable name to the value you tried to delete a variable with the name name=value. This is probably not what you intended. Always remember that name and value have to be separated by space and/or tab characters.

sspi - SPI utility commands

tftpboot- boot image via network using TFTP protocol

Datasheet GSG-00006-A01 33/34

Page 34: download - Special Computing

tftpboot [loadAddress] [bootfilename]

QIL-A9260> tftpboot 21000000 uImage TFTP from server 192.168.1.11; our IP address is 192.168.1.100 Filename 'uImage'. Load address: 0x21000000 Loading:

################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

done Bytes transferred = 3184180 (309634 hex)QIL-A9260>

version - print monitor version

You can print the version and build date of the U-Boot image running on your system using the version command (short: vers):

QIL-A9260> vers

U-Boot 1.1.5 (Jul 31 2007 - 09:52:32) QIL-A9260>

Datasheet GSG-00006-A01 34/34