From de83dbb7e2fccdc336ef56ba5f8ff3999336462b Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 1 Jun 2021 14:05:36 +0200 Subject: [PATCH] cl-utils: Fix bug introduced with 5288eef6171b9cff194fbeb087bc942bad08d9db Always use the file size for write and verify. --- src/platforms/pc/cl_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platforms/pc/cl_utils.c b/src/platforms/pc/cl_utils.c index 145dccb..fc34496 100644 --- a/src/platforms/pc/cl_utils.c +++ b/src/platforms/pc/cl_utils.c @@ -418,7 +418,10 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) } if (opt->opt_flash_start == 0xffffffff) opt->opt_flash_start = lowest_flash_start; - if (opt->opt_flash_size == 0xffffffff) + if ((opt->opt_flash_size == 0xffffffff) && + (opt->opt_mode != BMP_MODE_FLASH_WRITE) && + (opt->opt_mode != BMP_MODE_FLASH_VERIFY) && + (opt->opt_mode != BMP_MODE_FLASH_VERIFY)) opt->opt_flash_size = lowest_flash_size; if (opt->opt_mode == BMP_MODE_SWJ_TEST) { switch (t->core[0]) {