fix block alignment bug also in dfu_sd_image_validate

This commit is contained in:
fanoush 2019-05-24 13:07:32 +02:00 committed by GitHub
parent fb847b942e
commit 90e3149050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -790,6 +790,9 @@ uint32_t dfu_sd_image_validate(void)
uint32_t image_end = bootloader_settings.sd_image_start + uint32_t image_end = bootloader_settings.sd_image_start +
bootloader_settings.sd_image_size; bootloader_settings.sd_image_size;
/* ##### FIX START ##### */
block_size &= ~(uint32_t)(CODE_PAGE_SIZE - 1);
/* ##### FIX END ##### */
uint32_t img_block_start = bootloader_settings.sd_image_start + 2 * block_size; uint32_t img_block_start = bootloader_settings.sd_image_start + 2 * block_size;
uint32_t sd_block_start = sd_start + 2 * block_size; uint32_t sd_block_start = sd_start + 2 * block_size;