- issue warning when flash image exceeds configured flash size.
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 12 Feb 2009 15:35:03 +0000 (15:35 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 12 Feb 2009 15:35:03 +0000 (15:35 +0000)
- 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

src/flash/flash.c

index 72ba12715bc751ad43fd6ef0de18c6886316a88d..ce2ce75daa6b2052720d92d991eb4df81ca87bfa 100644 (file)
@@ -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);