|
Hi,
I am usng the AT91SAM7xek board.(I am having the 256 Flash Device) I have configured the One of the Basic Helloworld test code from Atmel, and configured it as a bootloader.
I have two exe files one is Bootloader and another one is my test App.
Bootloader is flashed at 0x100000 and My test_app is at 0x110000
_jmpAddr = 0x110000
On startup of the boot loader when i give the instruction This is the code from startup.s
entry:
resetHandler:
ldr r0, =resetVector
ldr pc=_jmpAddr (Jumping to the test_app)
/* Set pc to actual code location (i.e. not in remap zone) */
ldr pc, =1f
/* Perform low-level initialization of the chip using LowLevelInit() */
1: ...........................
My test_app will start executing. Perfectly fine .....
But ..... In the same startup.S When i give the same instruction at the end of the file i.e before infinity loop it doesn't branch to the 0x110000
/* Branch to main()
******************/
ldr r0, =main
mov lr, pc
bx r0
ldr pc=_jmpaddr (jump to the test_app) /* Loop indefinitely when program is finished */
1:
b 1b
Please can anybody suggest me the method to jump to the location after executing the main code. As my main code will check for the any upgrade avilable for the current test_app if so it will upgrade flash. Basically i am fallowing the method exactly the guys discussed in this thread for upgrading the flash over the AIR.
Please suggest me why its able to jump if i give instruction at the starting of the startup.s and whynot its jumping if i give the same instruction at the end of the startup.s
Do i need to change the any registers or any CPU registers must be reset before jumping or any thing else should be done..
Trying past 1 Week unable to find the solution or clue why its happening like this...
Harsha S
|