summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-16 13:12:48 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-16 13:12:48 +0000
commitcb6ebced3df72668091d5920fef3fbc46ddbc7ac (patch)
treefd4ee89fee961ae6251184a9b21b0168aaedbaf6 /src/flash
parentc35cc0b8b7463148fd6110a6357e0d141db0e247 (diff)
downloadopenocd_libswd-cb6ebced3df72668091d5920fef3fbc46ddbc7ac.tar.gz
openocd_libswd-cb6ebced3df72668091d5920fef3fbc46ddbc7ac.tar.bz2
openocd_libswd-cb6ebced3df72668091d5920fef3fbc46ddbc7ac.tar.xz
openocd_libswd-cb6ebced3df72668091d5920fef3fbc46ddbc7ac.zip
- 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
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/flash.c9
1 files changed, 6 insertions, 3 deletions
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;
}