On Tue, 19 Aug 2008 21:30:58 +0000, Daniel Gimpelevich wrote:

> On Tue, 19 Aug 2008 10:47:30 -0400, Nicolas Pitre wrote:
> 
>> So far I've always been able to halt a Feroceon based board with no
>> flash content simply by holding the reset button while performing a
>> halt on the openocd console then quickly releasing the reset button. 
>> It seems that the processor will happily halt right on the reset vector
>> at that point if DBGRQ is already asserted when it attempts to execute
>> the very first instruction after a reset.

I just reread this section, and I had some thoughts. I managed to get 
OpenOCD to halt the Feroceon consistently! Thank you, thank you, thank 
you! Here is the patch:

Index: src/target/feroceon.c
===================================================================
--- src/target/feroceon.c       (revision 947)
+++ src/target/feroceon.c       (working copy)
@@ -60,6 +60,19 @@
 int feroceon_init_target(struct command_context_s *cmd_ctx, struct target_s 
*target);
 int feroceon_quit(void);
 
+int feroceon_assert_reset(target_t *target)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       int ud = arm7_9->use_dbgrq;
+
+       arm7_9->use_dbgrq = 0;
+       if (target->reset_halt)
+               arm7_9_halt(target);
+       arm7_9->use_dbgrq = ud;
+       return arm7_9_assert_reset(target);
+}
+
 target_type_t feroceon_target =
 {
        .name = "feroceon",
@@ -73,7 +86,7 @@
        .resume = arm7_9_resume,
        .step = arm7_9_step,
 
-       .assert_reset = arm7_9_assert_reset,
+       .assert_reset = feroceon_assert_reset,
        .deassert_reset = arm7_9_deassert_reset,
        .soft_reset_halt = arm926ejs_soft_reset_halt,
        

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to