Yeah, that did the trick. After changing debug configuration to load the second "elf", and after adding the symbols file (the elf itself), it was just a matter of issuing >monitor reset halt to force a target reset.
Going head:
My boot loader tries jumping into applicative as below (__app_interrupt_vector_table__ is a global symbol from locator script, containing the address of applicative's vector table - in this case, 0x3000):
-----------------
/* Set VTOR (VTOR's memory mapped address: 0xE000ED08) pointing to applicative's Vector Table */
ldr r0, =__app_interrupt_vector_table__
ldr r1, =0xE000ED08
str r0, [r1]
/* Branch to application's Reset Handler vector content (applicative's Reset Handler will set the stack pointer properly)*/
ldr r1, =__app_interrupt_vector_table__ + 4
blx r1
-----------------
Everything seems ok until right before the branch (blx r1). At this point, r1 does contain 0x3004, and memory, at 0x3004 does contains applicative's Reset Handler's address:
Memory browser:
0000_3000: 000034A5
And 0x34A5 does point to the beginning of applicative's Reset Handler:
Disassembly:
000034a5: cpsid i
000034a7: mov.w r1, #0
000034ab: mov.w r2, #0
000034af: mov.w r3, #0
000034b3: mov.w r4, #0
000034b7: mov.w r5, #0
000034bb: mov.w r6, #0
...
The assembly file, in applicative's project that generates the disassembly above reads as below:
...
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
/* Init the rest of the registers */
ldr r1,=0
ldr r2,=0
ldr r3,=0
ldr r4,=0
ldr r5,=0
ldr r6,=0
...
Well, everything seems to be ok.
However, going one single step ahead blows it, and processor gets stuck at application's default ISR loop.
***What I am not grasping here***: shouldn't the ddress of applicative's Reset Handler be a multiple of 4?
To get another look into it, I changed Debug configuration back to loading only the applicative, and voila:
The address of the first Reset Handler's instruction is 0x34A4:
Disassembly:
000034a4: cpsid i
310 ldr r1,=0
000034a6: mov.w r1, #0
311 ldr r2,=0
000034aa: mov.w r2, #0
312 ldr r3,=0
000034ae: mov.w r3, #0
313 ldr r4,=0
000034b2: mov.w r4, #0
314 ldr r5,=0
000034b6: mov.w r5, #0
315 ldr r6,=0
...
Where is my bad step?
Best regards,
João