Clarify STM32F103x8 Flashsize handling.

Should finally fix #471.
This commit is contained in:
Uwe Bonnes 2019-08-29 13:35:20 +02:00
parent d39dc34382
commit 80a9fd51ca
2 changed files with 22 additions and 25 deletions

View File

@ -20,34 +20,31 @@ This flash may have been tested bad, or not have been tested at all,
or, in the best case, was tested good but market requirements made STM sell or, in the best case, was tested good but market requirements made STM sell
it as F103C8. it as F103C8.
Ignoring the chip marking and using an F103C8 blindly as a F103Cb is done 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 already with no known problems on many STM board and china boards (e.g. blue
this second approach will work for many of the older STLinks. pill) with genuine STM32. China stlinks clones with a GD32F103x8 will
probably not work. Best is to get new genuine ST hardware. The
dfu-util cares for the size and refuses to programm above the announced size: STLINK-Vmini is < 10 $ without VAT or to resolder a genuine
> dfu-util -S E4D078EA -s 0x08002000:leave -D blackmagic.bin STM32F103CB chip. Think also about using the pc-hosted pc-stlinkv2
dfu-util 0.9 platform on stlinks with revent firmware.
...
dfu-util: Last page at 0x0801093f is not writeable
Flash above the announced size with recent bootloader/BMP: Flash above the announced size with recent bootloader/BMP:
========================================================== ==========================================================
script/stm32_mem.py does not care for the announced size:
Use either the provided python tool, as script/stm32_mem.py
does not care for the announced size and verifies:
> ../scripts/stm32_mem.py blackmagic.bin > ../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 or compile and use the upgrade executable.
> ls -l blackmagic.bin
-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 > cd upgrade
> dfu-util -s 0x08002000:leave:force:59712 -U blackmagic.bin.1 > make (PROBE_HOST=...)
> ./blackmagic_upgrade
Compare To long to read
> diff blackmagic.bin* ===============
No differences should get reported! Use the BMP provided upgrade tools:
- scripts/stm32_mem.py
- Compiled upgrade tool in upgrade
Only if mismatch is reported, think further.

View File

@ -36,7 +36,7 @@ endif
bindata.o: $(PROBE_HOST).d bindata.o: $(PROBE_HOST).d
$(PROBE_HOST).d: ../src/blackmagic.bin $(PROBE_HOST).d: $(wildcard ../src/blackmagic.bin)
-rm *.d -rm *.d
make -C ../src $0 clean make -C ../src $0 clean
make -C ../src $0 make -C ../src $0