diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-02-12 15:35:03 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-02-12 15:35:03 +0000 |
commit | 2e160c6bad640297e4e8473b07ecff587c633e27 (patch) | |
tree | 80afa7426610bb2aece1a3c39ebad5e09651a290 /src/flash | |
parent | e77ae9096a40707d3b878b46969a60a06656dc06 (diff) | |
download | openocd+libswd-2e160c6bad640297e4e8473b07ecff587c633e27.tar.gz openocd+libswd-2e160c6bad640297e4e8473b07ecff587c633e27.tar.bz2 openocd+libswd-2e160c6bad640297e4e8473b07ecff587c633e27.tar.xz openocd+libswd-2e160c6bad640297e4e8473b07ecff587c633e27.zip |
- issue warning when flash image exceeds configured flash size.
- see https://lists.berlios.de/pipermail/openocd-development/2009-February/004680.html
git-svn-id: svn://svn.berlios.de/openocd/trunk@1371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/flash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index 72ba1271..ce2ce75d 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -1053,7 +1053,11 @@ int flash_write(target_t *target, image_t *image, u32 *written, int erase) /* fit the run into bank constraints */ if (run_address + run_size > c->base + c->size) + { + LOG_WARNING("writing %d bytes only - as image section is %d bytes and bank is only %d bytes", \ + c->base + c->size - run_address, run_size, c->size); run_size = c->base + c->size - run_address; + } /* allocate buffer */ buffer = malloc(run_size); |