From cfb1e862525f95252e367ccc38845da5a9a017af Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Thu, 7 Jun 2012 18:03:23 +0200 Subject: [PATCH 1/2] st-flash: Honor size, if given --- flash/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash/main.c b/flash/main.c index 2428745..4716b66 100644 --- a/flash/main.c +++ b/flash/main.c @@ -154,10 +154,10 @@ int main(int ac, char** av) } else /* read */ { - if ((o.addr >= sl->flash_base) && + if ((o.addr >= sl->flash_base) && (o.size == 0) && (o.addr < sl->flash_base + sl->flash_size)) o.size = sl->flash_size; - else if ((o.addr >= sl->sram_base) && + else if ((o.addr >= sl->sram_base) && (o.size == 0) && (o.addr < sl->sram_base + sl->sram_size)) o.size = sl->sram_size; err = stlink_fread(sl, o.filename, o.addr, o.size); From 0e7ee109f6c37dd2f1acfdc861eb12803e96eabb Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Thu, 7 Jun 2012 18:13:43 +0200 Subject: [PATCH 2/2] Add \n to WLOG when no STLINK found --- src/stlink-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 72ffda1..a25f7ec 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -652,7 +652,7 @@ stlink_t* stlink_open_usb(const int verbose) { if (slu->usb_handle == NULL) { slu->usb_handle = libusb_open_device_with_vid_pid(slu->libusb_ctx, USB_ST_VID, USB_STLINK_PID); if (slu->usb_handle == NULL) { - WLOG("Couldn't find any ST-Link/V2 devices"); + WLOG("Couldn't find any ST-Link/V2 devices\n"); goto on_error; } slu->protocoll = 1;