Hi folks. I was told I'd need to reference this: https://lists.berlios.de/pipermail/openocd-development/2008-August/002988.html
when offering up this patch for Daniel Gimpelevich, who is off to a Linux expo shortly. It can be found here... in case the mailer messes it up. http://linuxmafia.com/pub/helpful-things/flashpatch.diff Cheers, john Index: src/flash/flash.c =================================================================== --- src/flash/flash.c (revision 1376) +++ src/flash/flash.c (working copy) @@ -950,7 +950,7 @@ } /* check whether it fits */ - if (addr + length > c->base + c->size) + if (addr + length - 1 > c->base + c->size - 1) return ERROR_FLASH_DST_BREAKS_ALIGNMENT; addr -= c->base; @@ -1030,7 +1030,7 @@ section_first = section; section_last = section; padding[section] = 0; - while ((run_address + run_size < c->base + c->size) + while ((run_address + run_size - 1 < c->base + c->size - 1) && (section_last + 1 < image->num_sections)) { if (image->sections[section_last + 1].base_address < (run_address + run_size)) @@ -1052,7 +1052,7 @@ } /* fit the run into bank constraints */ - if (run_address + run_size > c->base + c->size) + if (run_address + run_size - 1 > c->base + c->size - 1) { 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); _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
