at91bootstrap (v1.16) bug (bootstrap size calculation)

Discussions about all user software around SAM Series.

Moderator: nferre

dml
Posts: 2
Joined: Tue May 31, 2011 2:04 pm

at91bootstrap (v1.16) bug (bootstrap size calculation)

Tue May 31, 2011 2:56 pm

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.
CptTitanic
Posts: 871
Joined: Sat Oct 30, 2010 6:04 pm

Re: at91bootstrap (v1.16) bug (bootstrap size calculation)

Tue May 31, 2011 5:27 pm

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 */
dml
Posts: 2
Joined: Tue May 31, 2011 2:04 pm

Re: at91bootstrap (v1.16) bug (bootstrap size calculation)

Tue May 31, 2011 7:08 pm

Thank you. Your variant more universal.

Return to “Software”

Who is online

Users browsing this forum: No registered users and 2 guests