Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: how to write AT91Bootstrap into nand with uboot?
PostPosted: Thu Feb 02, 2012 5:35 pm 
Offline

Joined: Wed Jul 07, 2010 7:10 am
Posts: 8
is it possible? I have tried nand write, but it cannot boot.
eg:
tftp 0x72200000 nandflash_at91sam9g45ekes.bin
nand erase 0x0 0x4000
nand write 0x72200000 0x0 0x4000


thanks.


Top
 Profile  
 
 Post subject: Re: how to write AT91Bootstrap into nand with uboot?
PostPosted: Thu Feb 02, 2012 10:48 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
You have to ensure the vector specifying the size of the code is correctly set. This is what "send boot file" achieves.

The vector in question is the 32-bit word at offset 0x14, and it is validated by RomBOOT, along with the other vectors starting with $E5 or $EA.

By default your linker is probably not setting the size vector correctly, and consequently RomBOOT rejects your code, and FAILS.


Top
 Profile  
 
 Post subject: Re: how to write AT91Bootstrap into nand with uboot?
PostPosted: Fri Feb 03, 2012 1:49 am 
Offline

Joined: Wed Jul 07, 2010 7:10 am
Posts: 8
Thank you very much!

I use the nandflash_at91sam9g45ekes.bin from linux4sam-angstrom-at91sam9g45ekes. And it can boot when using "send boot file" in sam-ba but failed with "nand write" in uboot.

In sam-ba there is something about nfParamHeader_t and PMECC , is it I have to do same thing in uboot?

in this page:http://www.at91.com/forum/viewtopic.php/f,9/t,19492/p,36152/
Quote:
Most of you failing here are not correctly formatting the image to pass the RomBOOT sanity checks.

Reinhard basically states the issue here:


reinhardm wrote:

Yes, you must program the binary variant into NAND, check before writing to flash whether the image has the vectors at the beginning, including the proper size entry.


I don't know how to proram right binary? could you give more details?


Top
 Profile  
 
 Post subject: Re: how to write AT91Bootstrap into nand with uboot?
PostPosted: Fri Feb 03, 2012 2:06 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
You need to fix the binary, like SAM-BA does.

A quick review of the front of the .BIN should be quite indicative of it's chances of running.

00000000 : 0D 00 00 EA 05 00 00 EA - 05 00 00 EA 05 00 00 EA ................
00000010 : 05 00 00 EA DC 12 20 00 - 05 00 00 EA 05 00 00 EA ...... .........

The value of 0x002012DC @ offset 0x14, in this case needs to change to 0x000012DC to reflect that the binary is 4828 bytes in length. Your length will be different, but must be less than the size of the SRAM into which your boot code is being loaded.


Top
 Profile  
 
 Post subject: Re: how to write AT91Bootstrap into nand with uboot?
PostPosted: Fri Feb 03, 2012 2:21 am 
Offline

Joined: Wed Jul 07, 2010 7:10 am
Posts: 8
Thanks. It's work now after fixed the binary with your help. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: