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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-04-22 15:51:57 +08:00
parent 1a5867c5e5
commit 646388fcb7

View File

@ -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)