From cb6ebced3df72668091d5920fef3fbc46ddbc7ac Mon Sep 17 00:00:00 2001 From: drath Date: Thu, 16 Aug 2007 13:12:48 +0000 Subject: - update jtag_speed setting when changing it during runtime with a FT2232 based interface - use 'etm trigger_percent' setting when programming ETB trigger count - fixed some small bugs in ETM trace analysis - fixed minor bug in flash writing (thanks to Pavel Chromy) git-svn-id: svn://svn.berlios.de/openocd/trunk@197 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/flash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/flash/flash.c') diff --git a/src/flash/flash.c b/src/flash/flash.c index 19d5c3c5..9ca5f157 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -797,10 +797,13 @@ int flash_write(target_t *target, image_t *image, u32 *written, char **error_str while ((run_address + run_size < c->base + c->size) && (section_last + 1 < image->num_sections)) { - if (image->sections[section_last + 1].base_address > (run_address + run_size)) - break; if (image->sections[section_last + 1].base_address < (run_address + run_size)) + { WARNING("section %d out of order", section_last + 1); + break; + } + if (image->sections[section_last + 1].base_address != (run_address + run_size)) + break; run_size += image->sections[++section_last].size; } @@ -836,8 +839,8 @@ int flash_write(target_t *target, image_t *image, u32 *written, char **error_str if (retval != ERROR_OK) snprintf(*error_str, FLASH_MAX_ERROR_STR, "error reading from image: %s", image->error_str); else - snprintf(*error_str, FLASH_MAX_ERROR_STR, "error reading from image"); + return ERROR_IMAGE_TEMPORARILY_UNAVAILABLE; } -- cgit v1.2.3