From 22993fb5bd522a58fb54b449b2592216d54498f0 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Thu, 28 Jun 2012 20:11:53 +1200 Subject: [PATCH] Clear target error on attaching. Fixes possible lock-up on devices booting from blank flash. --- src/cortexm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cortexm.c b/src/cortexm.c index 43f3d98..98707ce 100644 --- a/src/cortexm.c +++ b/src/cortexm.c @@ -358,6 +358,9 @@ cortexm_attach(struct target_s *target) unsigned i; uint32_t r; + /* Clear any pending fault condition */ + target_check_error(target); + target_halt_request(target); while(!target_halt_wait(target));