On Tue, Nov 03, 2009 at 09:24:31PM +0100, Øyvind Harboe wrote:
> How did this problem manifest itself?

As a quick way to get code running on a mc13224v, I perform a
soft_reset_halt, load an image into RAM, and then I need to bypass the
internal bootloader by changing the PC with:

   arm7_9_write_core_regs 15 19 0x00400000

and then when you resume your code is running. 

The general result though is you can't poke registers that get used by
other commands. Such as with step, which uses r0, r1, and pc, you
would see:

 > arm7_9_write_core_regs 0 19 0xdeadbeef

Debug: 231 329137 command.c:68 script_debug(): command -
write_core_reg
Debug: 232 329137 command.c:77 script_debug(): write_core_reg -
argv[0]=ocd_arm7_9_write_core_reg
Debug: 233 329137 command.c:77 script_debug(): write_core_reg -
argv[1]=0
Debug: 234 329137 command.c:77 script_debug(): write_core_reg -
argv[2]=19
Debug: 235 329137 command.c:77 script_debug(): write_core_reg -
argv[3]=0xdeadbeef

 > step

Debug: 238 361674 command.c:77 script_debug(): step - argv[0]=ocd_step
Debug: 239 361674 target.c:2215 handle_step_command(): -
Debug: 240 361674 arm7_9_common.c:2282 arm7_9_read_memory(): address:
0x00010860, size: 0x00000004, count: 0x00000001
Debug: 241 361684 target.c:1482 target_read_u32(): address:
0x00010860, value: 0xe3a00840
Debug: 242 361684 arm7_9_common.c:1642 arm7_9_restore_context(): -
Debug: 243 361684 arm7_9_common.c:1661 arm7_9_restore_context():
examining User mode
Debug: 244 361684 arm7_9_common.c:1675 arm7_9_restore_context():
examining dirty reg: r0
Debug: 245 361684 arm7_9_common.c:1675 arm7_9_restore_context():
examining dirty reg: r1
Debug: 246 361684 arm7_9_common.c:1675 arm7_9_restore_context():
examining dirty reg: pc
Debug: 247 361684 arm7_9_common.c:1723 arm7_9_restore_context():
writing register 0 of mode User with value 0xffffffff
Debug: 248 361684 arm7_9_common.c:1723 arm7_9_restore_context():
writing register 1 of mode User with value 0x80003000

and if you changed r0, r1, or pc, then you would get stale cache
values instead of the values you wrote (since the cache wasn't updated
by write_core_regs).

> 
> Should this fix be included for 0.3 or not?

Doesn't matter to me...

-Mar.

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to