Hi,
I have a bootloader + main app memory layout. What needs to be done when bootloader is giving control to main app? I have read couple posts here, but nobody gave any definitive answers so far.
To be more specific, I am using Keil 4.21 and my memory image specs is following
boot 0x00400000 0x00404000
app 0x00404000 and on
Now I am able to load the main app to flash and verify it, but then I get stuck
1) What needs to be done before the jump itself? I found two suggestions here in the forums, to set offset of the interrupt vector table and to modify stack pointer. Do I really need to do that + why?
2) The jump itself. I have tried jump with assembler function in separate file Jump2Main.s, but I got this weird linker error.
Code:
PRESERVE8
AREA Jump, CODE, READONLY
EXPORT JumpToProgram
JumpToProgram
B 0x00404004
END
.\obj\BootSAM3S.axf: Error: L6471E: Relocation #REL:0 in jump2main.o(Jump) with respect to [Anonymous Symbol]. Branch refers to ARM Absolute Symbol defined in jump2main.o, Suppress error to treat as a Thumb address.
When I suppress it as suggested, I can compile and load it into the device, but when executing B instruction, I end up in HardFault_Handler loop, instead of in main app.
I am sorry for all the noobie questions, but I haven't found any rock-solid answers anywhere else
Thanks
Entik