From ce17cc2e2b8b5afe79247dcd96f1fc222fed1dfc Mon Sep 17 00:00:00 2001 From: Pavel Burgr Date: Sat, 14 Dec 2013 21:25:10 +0100 Subject: [PATCH] Fix in checksum calculation condition --- src/lpc11xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpc11xx.c b/src/lpc11xx.c index 9adbe2b..f7d72fa 100644 --- a/src/lpc11xx.c +++ b/src/lpc11xx.c @@ -216,7 +216,7 @@ lpc11xx_flash_write(struct target_s *target, uint32_t dest, const uint8_t *src, chunk_offset = 0; /* if we are programming the vectors, calculate the magic number */ - if (dest == 0) { + if (chunk * IAP_PGM_CHUNKSIZE == 0) { uint32_t *w = (uint32_t *)(&flash_pgm.data[0]); uint32_t sum = 0;