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  [ 3 posts ] 
Author Message
 Post subject: at91bootstrap (v1.16) bug (bootstrap size calculation)
PostPosted: Tue May 31, 2011 2:56 pm 
Offline

Joined: Tue May 31, 2011 2:04 pm
Posts: 2
Hi, everyone!
I found a little bug in at91bootstrap (v1.16).
After bootstrap compilation its size (4 bytes) stored at the offset 0x14 from bootstrap image beginning.
This size is calculated incorrectly. For example value in file 0x00200ED0, real value 0x00000ED0. When you use SAM-BA for bootstrap uploading, problem fixed automatically, because "Send boot file" script in SAM-BA rewrite bootstrap size value automatically.
But when I try to rewrite bootstrap manually (from u-boot) to the DataFlash, device will not boot.
When I try to rewrite bootstrap manually (from u-boot) to NandFlash, device will boot correctly (i don't no why).

Problem in thе file /Bootstrap-v1.16/crt0_gnu.S:
.word _edata /* Size of the image for SAM-BA */

After compillation _edata= bootstrap_real_size+ 0x200000;

I change this string to:
.word 0x00001000 /* Size of the image for SAM-BA */

And device is beginning to load correctly.

I use angstrom-2009.X-test-20091214-armv5te-linux-gnueabi-toolchain-qte-4.6.0-i686 toolchain
+ at91sam9260ek evolution board.


Top
 Profile  
 
 Post subject: Re: at91bootstrap (v1.16) bug (bootstrap size calculation)
PostPosted: Tue May 31, 2011 5:27 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
I'm not sure it's actually a bug, but more of a compiler/linker agnostic method. The fact SAM-BA has always fixed this as part of the "Write Boot", suggests it is a known side effect.

This might be a better method, and also prevent you bricking the system when the boot code exceeds the loadable limit of the part in question.

/* Exception vectors (should be a branch to be detected as a valid code by the rom */
_exception_vectors:
b reset_vector /* reset */
b undef_vector /* Undefined Instruction */
b swi_vector /* Software Interrupt */
b pabt_vector /* Prefetch Abort */
b dabt_vector /* Data Abort */
.word _edata - _exception_vectors /* Size of the image for SAM-BA */
b irq_vector /* IRQ : read the AIC */
b fiq_vector /* FIQ */


Top
 Profile  
 
 Post subject: Re: at91bootstrap (v1.16) bug (bootstrap size calculation)
PostPosted: Tue May 31, 2011 7:08 pm 
Offline

Joined: Tue May 31, 2011 2:04 pm
Posts: 2
Thank you. Your variant more universal.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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: