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: *.bin download issue
PostPosted: Mon Mar 07, 2011 2:39 pm 
Offline

Joined: Thu Jul 29, 2010 12:47 pm
Posts: 11
Hi all,

I have created a helloworld.bin and i was able to download it to the SPI flash through SAMBA and it works fine.

But, when i try to download the *.bin through my flash writer application it does not boot.
The difference i found is SAMBA overwrite a section of interrupt vector table of the reserve offset.
in my startup.s i have mentioned the reserve offset of interrupt vector table like this.
B . ; RESERVED

this particular part of the *.bin (4 bytes of vector table)file is modified by SAMBA while
downloading it to the flash.

Can somebody tell me the reason for this or let me know if i am wrong.

Regards,
Vipin.


Top
 Profile  
 
 Post subject: Re: *.bin download issue
PostPosted: Mon Mar 07, 2011 4:20 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
The RomBoot loader sanity checks the code before jumping to it. The modified vector must contain the length of the image, or the max size of one of the SRAM banks. The size of the of the SRAM will depend on the part you are using. The other vectors are check for standard vectoring instructions. If the tests fail, RomBoot does not map SRAM to 0x00000000, and your code does not execute.

SAM-BA performs this vector modification as part of it's boot writing function, so that it will pass the RomBoot test.


Last edited by CptTitanic on Tue Mar 08, 2011 2:25 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: *.bin download issue
PostPosted: Tue Mar 08, 2011 6:26 am 
Offline

Joined: Thu Jul 29, 2010 12:47 pm
Posts: 11
Thanks for the reply.

So If I use my own code downloader (not SAMBA) should I modify the vector table (ie Reserve vector with the *.bin file size) before I download it to the Flash?

Is this the correct way to download the code or is there a better way? Pls suggest.

Vipin.


Top
 Profile  
 
 Post subject: Re: *.bin download issue
PostPosted: Tue Mar 08, 2011 2:35 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Remember that RomBoot is copying your code into SRAM from NAND or Serial Flash, if it doesn't meet the check it's not going to run it.

Your available choices would appear to include :

a) Change the 6th vector to be the length before download, like SAM-BA
b) Set the 6th vector to a constant in your assembler code
c) Construct the 6th vector content in assembler so that when fixed up by the linker it becomes the length.
d) Run a post-link step which fixes the 6th vector.


Top
 Profile  
 
 Post subject: Re: *.bin download issue
PostPosted: Wed Mar 09, 2011 7:49 am 
Offline

Joined: Thu Jul 29, 2010 12:47 pm
Posts: 11
Thanks a lot...


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 16 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: