From 02b9d5f1ac3891c3b9bdf958bb670f1741b83ec1 Mon Sep 17 00:00:00 2001 From: Josh Robson Chase Date: Thu, 15 Nov 2018 17:17:25 -0500 Subject: [PATCH] Add delay to cortexm_reset --- src/target/cortexm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/target/cortexm.c b/src/target/cortexm.c index 50141a0..120dbc2 100644 --- a/src/target/cortexm.c +++ b/src/target/cortexm.c @@ -31,6 +31,7 @@ #include "target.h" #include "target_internal.h" #include "cortexm.h" +#include "platform.h" #include @@ -533,6 +534,11 @@ static void cortexm_reset(target *t) /* Reset DFSR flags */ target_mem_write32(t, CORTEXM_DFSR, CORTEXM_DFSR_RESETALL); + + /* 1ms delay to ensure that things such as the stm32f1 HSI clock have started + * up fully. + */ + platform_delay(1); } static void cortexm_halt_request(target *t)