From e509310406ba4db9e88ce7c0ea2aad985cb25008 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Mon, 14 Nov 2011 03:52:19 +0000 Subject: [PATCH] Start up stlinkv1 faster. Now that we're not using sg, and we've told the kernel to ignore the device in usb-mass storage, we don't need to close and wait 5 seconds. We can just immediately issue the command to switch modes. --- src/stlink-sg.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/stlink-sg.c b/src/stlink-sg.c index f917000..7f0badc 100644 --- a/src/stlink-sg.c +++ b/src/stlink-sg.c @@ -467,7 +467,7 @@ void _stlink_sg_enter_jtag_mode(stlink_t *sl) { } // XXX kernel driver performs reset, the device temporally disappears - +// Suspect this is no longer the case when we have ignore on? RECHECK void _stlink_sg_exit_dfu_mode(stlink_t *sl) { struct stlink_libsg *sg = sl->backend_data; DLOG("\n*** stlink_exit_dfu_mode ***\n"); @@ -964,18 +964,6 @@ stlink_t* stlink_v1_open_inner(const int verbose) { DLOG("Attempting to exit DFU mode\n"); _stlink_sg_exit_dfu_mode(sl); - // exit the dfu mode -> the device is gone - DLOG("\n*** reopen the stlink device ***\n"); - delay(1000); - stlink_close(sl); - delay(5000); - - DLOG("Attempting to reopen the stlink...\n"); - sl = stlink_open(verbose); - if (sl == NULL) { - fputs("Error: could not open stlink device\n", stderr); - return NULL; - } // re-query device info (and retest) stlink_version(sl); if ((sl->version.st_vid != USB_ST_VID) || (sl->version.stlink_pid != USB_STLINK_PID)) { -- 2.47.2