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