From 7a595ead255f2a052fe4561c24a0577112c9de84 Mon Sep 17 00:00:00 2001 From: zvova7890 Date: Sat, 18 Jan 2020 16:42:10 +0200 Subject: [PATCH] fixup F103x8 flash size before build dfu iface string we handle F103x8 as F103xB with 128k flash --- src/platforms/stm32/dfucore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/stm32/dfucore.c b/src/platforms/stm32/dfucore.c index 5931d1d9..1307dad7 100644 --- a/src/platforms/stm32/dfucore.c +++ b/src/platforms/stm32/dfucore.c @@ -352,9 +352,9 @@ static char *get_dev_unique_id(char *s) /* Calculated the upper flash limit from the exported data in theparameter block*/ fuse_flash_size = *(uint32_t *) FLASH_SIZE_R & 0xfff; - set_dfu_iface_string(fuse_flash_size - 8); - if (fuse_flash_size == 0x40) /* Handle F103x8 as F103xC! */ + if (fuse_flash_size == 0x40) /* Handle F103x8 as F103xB! */ fuse_flash_size = 0x80; + set_dfu_iface_string(fuse_flash_size - 8); max_address = FLASH_BASE + (fuse_flash_size << 10); /* If bootloader pages are write protected or device is read * protected, deny bootloader update.