On Mon, May 31, 2010 at 10:43 PM, Andreas Fritiofson
<andreas.fritiof...@gmail.com> wrote:
> On Mon, May 31, 2010 at 10:35 PM, Freddie Chopin <freddie_cho...@op.pl> wrote:
>> On 2010-05-31 21:59, Andreas Fritiofson wrote:
>>>
>>> Also, I believe a second 'reset init' is
>>> needed right after the load in order to update the initial SP and PC
>>> from the newly loaded image.
>>
>> It's not.
>>
>
> Then what sets it?
>

Just tried it:

oocd:
> stm32x mass_erase 0
> reset init

gdb:
(gbd) tar rem :3333
(gbd) load
(gbd) mon gdb_sync
(gbd) stepi
(gbd) info reg
...
sp             0xfffffffc       0xfffffffc
lr             0xffffffff       4294967295
pc             0x80002dd        0x80002dd <Reset_Handler>

So the PC is set up by GDB (assuming the entry point has been set
correctly in the elf-file) but nothing touches the stack pointer. And
sure enough:

(gdb) stepi
-> target is off to infinity and beyond (first instruction pushes some
registers)
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to