From 646388fcb7c6db306b483bf31944ac7079a4f751 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 22 Apr 2019 15:51:57 +0800 Subject: [PATCH] sw: dfu: fix calculation for address offset We were using the wrong offset for address calculation. Use the block size, rather than the program size. This wasn't an issue before, because the block size and the program size were both 256 bytes. Now the block size can be 1024 bytes. Signed-off-by: Sean Cross --- sw/src/dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/src/dfu.c b/sw/src/dfu.c index 0470c93..8f7e9ee 100644 --- a/sw/src/dfu.c +++ b/sw/src/dfu.c @@ -137,7 +137,7 @@ static uint32_t address_for_block(unsigned blockNum) else starting_offset = RESCUE_IMAGE_OFFSET; - return starting_offset + (blockNum * WRITE_SIZE); + return starting_offset + (blockNum * DFU_TRANSFER_SIZE); } void dfu_init(void)