cortexm_forced_halt: Only release SRST after "Halt on reset" command.
This should make life easier if program remaps JTAG/SWD pins so that with program running, JTAG/SWD access is impossible.
This commit is contained in:
parent
3ebf049424
commit
8d6092b73f
|
@ -239,17 +239,10 @@ static void cortexm_priv_free(void *priv)
|
||||||
|
|
||||||
static bool cortexm_forced_halt(target *t)
|
static bool cortexm_forced_halt(target *t)
|
||||||
{
|
{
|
||||||
uint32_t start_time = platform_time_ms();
|
target_halt_request(t);
|
||||||
platform_srst_set_val(false);
|
platform_srst_set_val(false);
|
||||||
/* Wait until SRST is released.*/
|
|
||||||
while (platform_time_ms() < start_time + 2000) {
|
|
||||||
if (!platform_srst_get_val())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (platform_srst_get_val())
|
|
||||||
return false;
|
|
||||||
uint32_t dhcsr = 0;
|
uint32_t dhcsr = 0;
|
||||||
start_time = platform_time_ms();
|
uint32_t start_time = platform_time_ms();
|
||||||
/* Try hard to halt the target. STM32F7 in WFI
|
/* Try hard to halt the target. STM32F7 in WFI
|
||||||
needs multiple writes!*/
|
needs multiple writes!*/
|
||||||
while (platform_time_ms() < start_time + cortexm_wait_timeout) {
|
while (platform_time_ms() < start_time + cortexm_wait_timeout) {
|
||||||
|
|
Loading…
Reference in New Issue