Restore the Netus dataflash content

This article illustrates how to restore the contents of dataflash memory chip mounted on the Netus G20 cpu module with the following firmware:

  • AT91Bootstrap This is a first step bootloader providing a set of algorithms to manage hardware initialization (GPIO, Clock, SDRAM, etc).
  • U-Boot This is the second stage bootloader. It is responsible of configuring main interfaces, reading the Linux kernel from the microSD (or dataflash, or an FTP server) and running it.

Installing SAM-BA

SAM-BA is an In-System Programming utility available from Atmel for Linux and Windows. We need to use this utility to write binary images on the dataflash memory.

Download the binary images

Download the following files in a folder named foxg20 located into the SAM-BA working directory:

Running SAM-BA

Launch SAM-BA and select Script file –> Execute Script File from the menu to execute the script foxg20/foxg20.tcl.

You can launch SAM-BA directly with a double click on the executable icon or from the command line typing in the SAM-BA directory:

./sam-ba /dev/ttyUSB0 at91sam9g20-ek foxg20/foxg20.tcl

The console section of the SAM-BA window will show:

(sam-ba_cdc_2.9.linux_cdc_linux) 22 % Execute Script File ...
Initialize the DataFlash access
-I- DATAFLASH::Init 1 (trace level : 4)
-I- Loading applet isp-dataflash-at91sam9g20.bin at address 0x20000000
-I- Memory Size : 0x840000 bytes
-I- Buffer address : 0x20002A70
-I- Buffer size: 0x80E80 bytes
-I- Applet initialization done
-I- === Erase all the DataFlash blocs and test the erasing ===
-I- 	Erasing: 0x80E80 bytes at address 0x0
-I- 	Erasing: 0x80E80 bytes at address 0x80E80
-I- 	Erasing: 0x80E80 bytes at address 0x101D00
-I- 	Erasing: 0x80E80 bytes at address 0x182B80
-I- 	Erasing: 0x80E80 bytes at address 0x203A00
-I- 	Erasing: 0x80E80 bytes at address 0x284880
-I- 	Erasing: 0x80E80 bytes at address 0x305700
-I- 	Erasing: 0x80E80 bytes at address 0x386580
-I- 	Erasing: 0x80E80 bytes at address 0x407400
-I- 	Erasing: 0x80E80 bytes at address 0x488280
-I- 	Erasing: 0x80E80 bytes at address 0x509100
-I- 	Erasing: 0x80E80 bytes at address 0x589F80
-I- 	Erasing: 0x80E80 bytes at address 0x60AE00
-I- 	Erasing: 0x80E80 bytes at address 0x68BC80
-I- 	Erasing: 0x80E80 bytes at address 0x70CB00
-I- 	Erasing: 0x80E80 bytes at address 0x78D980
-I- 	Erasing: 0x80E80 bytes at address 0x80E800
Load at91boostrap in the first sector of the dataflash
GENERIC::SendFile foxg20/at91bootstrap.bin at address 0x0
-I- File size : 0xD84 byte(s)
-I- 	Writing: 0xD84 bytes at 0x0 (buffer addr : 0x20002A70)
-I- 	0xD84 bytes written by applet
Load u-boot in the next sectors
-I- Send File foxg20/u-boot.bin at address 0x00008400
GENERIC::SendFile foxg20/u-boot.bin at address 0x8400
-I- File size : 0x22B30 byte(s)
-I- 	Writing: 0x22B30 bytes at 0x8400 (buffer addr : 0x20002A70)
-I- 	0x22B30 bytes written by applet
Create the starting u-boot environment variables file...
... and load it in the DataFlash
-I- Send File foxg20/starting-uboot-env.bin at address 0x00004200
GENERIC::SendFile foxg20/starting-uboot-env.bin at address 0x4200
-I- File size : 0x4200 byte(s)
-I- 	Writing: 0x4200 bytes at 0x4200 (buffer addr : 0x20002A70)
-I- 	0x4200 bytes written by applet
(sam-ba_cdc_2.9.linux_cdc_linux) 22 % 

Bootstrap

Now turn off or reset your FOX Board G20 and check the bootstrap messages on the debug console:

RomBOOT

This message in generated by RomBOOT that is the very first piece of code executed by the CPU. This code is saved directly inside the CPU ROM memory.

RomBOOT launches AT91Bootstrap that doesn't print any message in the console and launches U-Boot:

...
Hit any key to stop autoboot:  0 

U-Boot tries to get an IP address from your DHCP server and then launches the Linux Kernel image.



The Kernel panic error at the end is normal because you have to prepare your microSD card with the rootFS.

 
dev/factory-default.txt · Last modified: 2010/06/09 16:44 by tanzox
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki