From 5eda4566d617fedd2a9d3020ddae06b394d08a5f Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 13 Dec 2011 17:48:54 +0100 Subject: [PATCH] Determine the device parameters explicit after running stlink_reset(). Otherwise a sleeping device (WFI) doesn't return the parameters. --- flash/main.c | 1 + src/stlink-sg.c | 1 - src/stlink-usb.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/flash/main.c b/flash/main.c index 9033b17..609a6f7 100644 --- a/flash/main.c +++ b/flash/main.c @@ -108,6 +108,7 @@ int main(int ac, char** av) stlink_enter_swd_mode(sl); stlink_reset(sl); + stlink_load_device_params(sl); if (o.do_read == 0) /* write */ { diff --git a/src/stlink-sg.c b/src/stlink-sg.c index 197d59b..991bc87 100644 --- a/src/stlink-sg.c +++ b/src/stlink-sg.c @@ -1025,7 +1025,6 @@ stlink_t* stlink_v1_open(const int verbose) { } // by now, it _must_ be fully open and in a useful mode.... stlink_enter_swd_mode(sl); - stlink_load_device_params(sl); ILOG("Successfully opened a stlink v1 debugger\n"); return sl; } diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 4f8debc..f0a4695 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -702,7 +702,6 @@ stlink_t* stlink_open_usb(const int verbose) { } stlink_version(sl); - stlink_load_device_params(sl); error = 0; -- 2.30.2