Download Image to EVB Board and Flash Programming Nov, 2008 www.andestech.com
Download Image via SD card Program NOR Flash via AICE (automatic Mode) Outline Introduction Download Image via SD card Program NOR Flash via AICE (automatic Mode) Program NOR Flash via AICE (manual Mode) Download Image via Kermit Download Image via networking Confidential
Introduction This document describes how to download image and program/replace Andes’ Leopard NOR Flash code Confidential
Diagram and Download Path Ethernet/TCPIP UART EVB Board SD Card ICE Confidential
Download Image via SD Card www.andestech.com
Brief Download Procedure –via SD card Copy correct image into SD card Inserts SD card into EVB board Type 97 to enter CopyImageFromCard mode Type c, type correct image name Type sdram address which will be the address is copy from image Either execute image or burn into flash Confidential
Copy correct image into SD card Inserts SD card into EVB board Step 1~3 Copy correct image into SD card Inserts SD card into EVB board Turn on DC-IN switch Push power on button down Push reset button down Push sw5 buton down Led should display “67” $97 Confidential
Step 1~3 con’t Confidential
Step 4 Confidential
Step 5 Confidential
Step 6-1 execute image on sdram Confidential
Step 6-2 burn image into Flash Confidential
Program NOR Flash via AICE (Automatic Mode) www.andestech.com
Brief Programming Procedure –via gdb script $ iceman –p 1234 $ nds32-elf-gdb –x run_loader.txt $ nds32-elf-gdb –x no_loader.txt (Note 1: Step 2 suits running on EVB board with boot code) (Note 2: Step 3 suits running on EVB board without boot code) (Note 3: The figure on Leopard LED shows 08 after flash programming done) Confidential
Files Functionality flash.bin init-board-leopard.gdb rominit.bin A program that reads SDRAM data according to the specified address and length and writes the data to NOR flash specified address init-board-leopard.gdb A script that can initialize SDRAM controller and change NOR flash to R/W mode rominit.bin An andes diagnostic boot code no_loader.txt A gdb command script suits running on EVB board without bootcode run_loader.txt A gdb command script suits running on EVB board with bootcode Confidential
Push power on button down Push reset button down Step 1 Turn on DC-IN switch Push power on button down Push reset button down Plug AICE USB cable into PC’s USB port Click ICEMan icon on the desktop Type following command in ICEMan console iceman –p 1234 Confidential
Step 1 Con’t Confidential
Step 2 Select a toolchain to invoke gdb [開始] -> [程式集] -> [AndesTech] -> [AndeSight] -> [ToolChains] -> [nds32-elf-903-s-32gpr] Copy following 5 files to workspace folder init-board-leopard.gdb flash.bin rominit.bin run_loader.txt no_loader.txt Invoke an Andes toolchain console and go to workspace folder Type following command in toolchain console to invoke gdb nds32-elf-gdb –x run_loader.txt Confidential
Invoke Andes toolchain console Step2 Con’t Invoke Andes toolchain console Confidential
Step2 Con’t Confidential
Step 2 con’t program has done Confidential
Step 3 Confidential
Program NOR Flash via AICE (Manual Mode) www.andestech.com
Brief Programming Procedure $ iceman –p 1234 $ nds32-elf-gdb (gdb) set endian little (gdb) target remote :1234 (gdb) source init-board-leopard.gdb (gdb) restore flash.bin binary 0x500000 (gdb) restore rominit.bin binary 0x2000000 (gdb) set $r0=0x2000000 (gdb) set $r1=0x80400000 (gdb) set $r2=0x80000 (gdb) set $pc=0x500000 (gdb) continue (Note 1: If there is bootcode on target board, skip step 5) (Note 2: The figure on Leopard LED shows 08 after flash programming done) Confidential
Files introduction flash.bin init-board-leopard.gdb rominit.bin A program that reads SDRAM data according to the specified address and length and writes the data to NOR flash specified address init-board-leopard.gdb A script that can initialize SDRAM controller and change NOR flash to R/W mode rominit.bin An andes diagnostic boot code Confidential
Push power on button down Wait for LED’s figure shows 99 Step 1 Turn on DC-IN switch Push power on button down Wait for LED’s figure shows 99 Plug AICE USB cable into PC’s USB port Click ICEMan icon on the desktop Type following command in ICEMan console iceman –p 1234 Confidential
Step 1 Con’t Confidential
Select a toolchain to invoke gdb Step 2 Select a toolchain to invoke gdb [開始] -> [程式集] -> [AndesTech] -> [AndeSight] -> [ToolChains] -> [nds32-elf-903-s-32gpr] Copy following 3 files to workspace folder init-board-leopard.gdb flash.bin rominit.bin Type following command in toolchain console to invoke gdb nds32-elf-gdb Confidential
Invoke Andes toolchain console Step2 Con’t Invoke Andes toolchain console Confidential
Step2 Con’t Confidential
Set target endian as little Step 3 Set target endian as little Confidential
Step 4 Connect with iceman Confidential
Step 5 Execute init-board-leopard.gdb script to Init SDRAM & NOR Flash Confidential
Copy flash-writer program to SDRAM address 0x500000 Step 6 Copy flash-writer program to SDRAM address 0x500000 Confidential
Copy boot code to SDRAM address 0x2000000 Step 7 Copy boot code to SDRAM address 0x2000000 Confidential
Step 8 set source address Confidential
Set destination address Step 9 Set destination address Confidential
Set the length which it will be programmed into flash Step 10 Set the length which it will be programmed into flash Confidential
Modify the program counter register to 0x500000 Step 11 Modify the program counter register to 0x500000 Confidential
Start to execute flash.bin program Step 12 Start to execute flash.bin program Confidential
Program NOR Flash via Diagnostic program www.andestech.com
Brief Programming Procedure Turn on DC-IN swtich, push PWR ON button down, push GPIO 1 button down, and then terminal will enter diagnostic program. Insert SD card, assume it contains rominit.bin file, to leopard. And then type “97” in command line Type “c” Type file name “rominit.bin” Type “0x500000” to specify the program to be loaded address Type “55” to enter CLI mode Type “burn 0x500000 0x80400000 0x100000” to start to program flash Confidential
Step 1 Confidential
Select “97” to copy file to SDRAM Step 2 Select “97” to copy file to SDRAM Confidential
Type “c” to select the drive Step 3 Type “c” to select the drive Confidential
Type the file name which will be copied to SDRAM Step 4 Type the file name which will be copied to SDRAM Confidential
Specify the destination address Step 5 Specify the destination address Confidential
Type “55” to go into CLI mode Step 6 Type “55” to go into CLI mode Confidential
Type burn command to write file to flash Step 7 Type burn command to write file to flash 0x500000 => Source address 0x80400000 => Destination address 0x100000 => Length Confidential
Download Image via Kermit www.andestech.com
Brief Download Procedure Open Windows “Hyper terminal” program Setup Baud rate: 38400,8,n,1,n Turn on EVB board, Leopard, and enter “ANDES diagnostic program” Type “55” to enter CLI mode Type “loadb 0x0050000” to specify the location where image to be loaded Push “transfer” and load correct image through kermit protocol in “super terminal” program Select transfer protocol and in Window Hyper terminal [Transfer] -> [Transfer file] Select “Kermit” as transfer protocol Select the file to be trensfered Push “transfer” button to start transfer file (Note 1: The function just works on Windows “Hyper terminal”) Confidential
Step 1,2 Confidential
Step 4,5,6 Confidential
Step 7 Confidential
Step 7 Con’t Confidential
Download Image via Networking www.andestech.com
Brief Download Procedure Setup correct tftp server and relating IP address setting TeraTerm setting-Baud rate: 38400,8,n,1,n Turn on EVB board, Leopard, and enter “ANDES diagnostic program” Type “96” to enter NDS boot EVB board Setup corresponding IP address and relating EVB board retrieve image from tftp server Either execute image or burn into flash Confidential
Step 1 tftp server enable and work Confidential
Step 1 con’t IP address and relating setting Confidential
Step 1~4 Confidential
Step 1~4 con’t Andesboot Memory Layout Andesboot will be copied to 0x03200000 in memory The bootpImage will be downloaded to 0x02000000 0x04000000 0x00000000 0x03200000 AndesBoot 0x04000000 0x00000000 0x03200000 AndesBoot BootpImage 0x02000000 Confidential
Step 5,6,7-1 Confidential *** Using default environment NDS32>printenv printenvbootdelay=3 baudrate=38400 ethaddr=00:41:71:99:00:00 ipaddr=10.0.1.185 serverip=10.0.1.153 netmask=255.255.255.0 NDS32>setenv ipaddr 10.0.1.185 NDS32>setenv serverip 10.0.1.200 setenv serverip 10.0.1.200 NDS32>tftpboot 0x2000000 leopard.img tftpboot 0x2000000 leopard.imgADDR: 00:41:71:99:00:00 ADDR: 00:41:71:99:00:00 ARP broadcast 1 eth addr: 00:15:58:b9:8d:67 TFTP from server 10.0.1.153; our IP address is 10.0.1.185 Filename ‘leopard.img'. Load address: 0x2000000 Loading: ### done Bytes transferred = 9002272 (895d20 hex) NDS32>go 0x2000000 go 0x2000000## Starting application at 0x02000000 ... Uncompressing Linux............................................ done, booting the kernel. Linux version 2.4.35.1-andes (nobuhiro@atcpcw01) (gcc version 3.4.4) #4 Wed Nov 7 16:54:46 CST 2007 CPU: Andes N12id(wb) revision 12 ICache:32kb enabled, DCache:32kb enabled Machine: Andes AG101 Confidential
Step 5,6,7-1 con’t Confidential Ignoring unrecognised tag 0x00000000 On node 0 totalpages: 16384 zone(0): 16384 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: mem=64M@0x0 initrd=0x800000,8M root=/dev/ram0 rw console=ttyS0,38400n8 rootfstype=ext2 init=/sbin/init -s IRQ timer at interrupt number 0x13 clock 10000000 Calibrating delay loop... 39.73 BogoMIPS Memory: 64MB = 64MB total Memory: 55072KB available (1130K code, 263K data, 48K init) Dentry cache hash table entries: 8192 (order: 4, 65536 bytes) Inode cache hash table entries: 4096 (order: 3, 32768 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 4096 (order: 2, 16384 bytes) Page-cache hash table entries: 16384 (order: 4, 65536 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd Journalled Block Device driver loaded devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x0 pty: 256 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with no serial options enabled ttyS00 at 0xf9960000 (irq = 7) is a UART ttyS01 at 0xf9830000 (irq = 11) is a UART ttyS02 at 0xf9820000 (irq = 10) is a UART Faraday FTMAC100 Driver,(Linux Kernel 2.4) 10/18/02 - by Faraday eth0: device at 0xf9090000 IRQ:25 NOWAIT:0 RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize loop: loaded (max 8 devices) Faraday CPE SD controller Driver (DMA mode) make node with 'mknod cpesda b 6 0' NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 4096 bind 8192) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. RAMDISK: ext2 filesystem found at block 0 RAMDISK: Loading 6144 blocks [1 disk] into ram disk... done. Freeing initrd memory: 8192K VFS: Mounted root (ext2 filesystem). Freeing init memory: 48K Thu Nov 1 14:00:00 UTC 2007 0x7 / $ Confidential
Thank You Confidential