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  [ 2 posts ] 
Author Message
 Post subject: AT91FR40162SB project using Keil UVision3
PostPosted: Thu Mar 11, 2010 3:34 am 
Offline

Joined: Thu Mar 11, 2010 3:30 am
Posts: 2
Dear Community. I am a firmware engineer new to ARM architecture, looking for some general advice pertaining to a project I recently joined. I'm using Keil uVision3 with an AT91FR40162SB based target (that is 256K internal RAM, 2 Meg flash part.)

As I look at the example Startup.s file that is generated by Keil and the code in which it is integrated, I understand how the circuit is set to start reading from flash at location 0x0000000. I understand the vector table, how I jump into the startup assembler, how the vector table is transfered to RAM using LDMIA, STMIA... and I understand how the remap is actuated when the EBI table is copied. but for the life of me...I don't understand HOW the SOURCE code is copied from flash memory to RAM when the project first boots!

I see code that does

LDMIA R8!, {R0-R7} Load Vectors
STMIA R9!, {R0-R7} Store vectors
LDMIA R8!, {R0-R7} Load handlers <<---- What is this for? I copied the
STMIA R9!, {R0-R7} Store handlers <<---- Vector table already. Why
copy the proceeding 24 bytes?

I start the project, and magically the code is executing my main in ram (which has been remapped from flash at 0 to flash at 0x1000000) The only thing that has been "copied" per-se is my vector table, right? It looks like the vector table, and then 24 bytes of junk thereafter ( I know I'm not reading this right, I'm a newcomer to ARM assembler.)

What am I missing here? HOW is my code getting copied to RAM on the AT91? Or is it just getting mirrored after the remap and not actually copied?

Thanks sincerely,
Michael Thomas


Top
 Profile  
 
 Post subject: Re: AT91FR40162SB project using Keil UVision3
PostPosted: Fri Mar 12, 2010 2:22 am 
Offline

Joined: Thu Mar 11, 2010 3:30 am
Posts: 2
http://infocenter.arm.com/help/topic/co ... UI0203.pdf

"During startup, C library initialization code in __main carries out the copying and
zeroing of code and data necessary to move from the image load view to the execute view."


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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: