From 9e6cec0dd3301395345777cfe2617559a868f2a9 Mon Sep 17 00:00:00 2001 From: mifi Date: Sun, 9 Dec 2007 15:36:21 +0000 Subject: - added patch to display device information as INFO too - added patch which fixes a crash upon flash write error - added patch which will improve the reset handling when SRST is tied to TRST (thanks to Oyvind Harboe for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@218 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/flash.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/flash') diff --git a/src/flash/flash.c b/src/flash/flash.c index 03ee46f..390e37a 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -570,10 +570,19 @@ int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cm failed = malloc(sizeof(int) * image.num_sections); - if ((retval = flash_write(target, &image, &written, &error_str, failed, auto_erase)) != ERROR_OK) + error_str=NULL; + retval = flash_write(target, &image, &written, &error_str, failed, auto_erase); + + if (retval != ERROR_OK) { - command_print(cmd_ctx, "failed writing image %s: %s", args[0], error_str); - free(error_str); + if (error_str) + { + command_print(cmd_ctx, "failed writing image %s: %s", args[0], error_str); + free(error_str); + } + image_close(&image); + free(failed); + return retval; } for (i = 0; i < image.num_sections; i++) @@ -938,3 +947,4 @@ int handle_flash_auto_erase_command(struct command_context_s *cmd_ctx, char *cmd return ERROR_OK; } + -- cgit v1.1