From 203f6702d8d42a028b08ffdbf446b5df924148e8 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Thu, 21 Sep 2017 23:05:20 +0200 Subject: [PATCH] Flashsize_F103: Options for BMP on STM32F103C8 devices --- src/platforms/stlink/Flashsize_F103 | 34 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/platforms/stlink/Flashsize_F103 b/src/platforms/stlink/Flashsize_F103 index d4ece0f..c6b55a2 100644 --- a/src/platforms/stlink/Flashsize_F103 +++ b/src/platforms/stlink/Flashsize_F103 @@ -24,16 +24,30 @@ Ignoring the chip marking and using an F103C8 blindly as a F103Cb is done already with few problems on many china boards (e.g. blue pill). Probably this second approach will work for many of the older STLinks. -Use at your own risk! +dfu-util cares for the size and refuses to programm above the announced size: + > dfu-util -S E4D078EA -s 0x08002000:leave -D blackmagic.bin + dfu-util 0.9 + ... + dfu-util: Last page at 0x0801093f is not writeable -With DFU upload available in the bootloader, you can verify by uploading the -binary from flash and comparing it against the binary downloaded. -- Download new BMP binary (if not already done) - dfu-util -s 0x08002000:leave:force -D blackmagic.bin -- Get length of binary +Flash above the announced size with recent bootloader/BMP: +========================================================== +script/stm32_mem.py does not care for the announced size: + > ../scripts/stm32_mem.py blackmagic.bin + ... + USB Device Firmware Upgrade - Host Utility -- version 1.2 + ... + Programming memory at 0x08010800 + All operations complete! + +Get length of binary > ls -l blackmagic.bin - -rwxr-xr-x 1 bon users 57372 15. Apr 14:17 blackmagic.bin -- Upload binary from flash - > dfu-util -s 0x08002000:leave:force:57372 -U blackmagic.bin.1 -- Compare + -rwxr-xr-x 1 bon users 59712 21. Sep 22:47 blackmagic.bin +Actual file size may differ! + +Upload binary from flash with the exact size + > dfu-util -s 0x08002000:leave:force:59712 -U blackmagic.bin.1 + +Compare > diff blackmagic.bin* +No differences should get reported!