There is more to life than STM32F103's.
Could you build an stm32F103 (BP) image for 128kB of flash, plz?
EDIT: Totally missed techman's reply above ... And that imu asked for for Forth for a Bluepill Well here's the BMP (BlackMagic Probe) guide anyway & a DIY from src Please direct any BMP related replies to this thread , i have asked Dave to move this post there too.
https://www.eevblog.com/forum/microcontrollers/make-a-blackmagic-probe-out-of-a-stm32-bluepill/msg2823502/#msg2823502I just "pulled" the latest git 30 min ago , and built it for a bluepill (attched)
driver - contains udev/inf files , bmp .. the binaries.
**** git version ****
From
https://github.com/blacksphere/blackmagic 8a07f44..0b6f393 master -> origin/master
Updating 8a07f44..0b6f393
***** PIN Defs *****
See here for STM BMP Pin defs
https://github.com/blacksphere/blackmagic/blob/master/src/platforms/swlink/platform.h/* Hardware definitions... */ - SWLINK
#define TMS_PORT GPIOA
#define TCK_PORT GPIOA
#define TDI_PORT GPIOA
#define TDO_PORT GPIOB
#define JRST_PORT GPIOB
#define TMS_PIN GPIO13
#define TCK_PIN GPIO14
#define TDI_PIN GPIO15
#define TDO_PIN GPIO3
#define JRST_PIN GPIO4
#define SWDIO_PORT TMS_PORT
#define SWCLK_PORT TCK_PORT
#define SWDIO_PIN TMS_PIN
#define SWCLK_PIN TCK_PIN
You could use any STM programming sw as a replacement for st-link (ie. if you have windows)
Only problem is if the programming sw honours the chips reported 64k , and refuses to program more than that.
st-flash --flash=0x20000 - overrides the 64k reported , and tells it to use 128k
I use linux , don't know if st-flash exists for windows (it might)
Edit: There's a v1.3.0 here - It might work , i use 1.5.1-50 (linux) SVN
https://github.com/texane/stlink/releases/tag/1.3.0You might be able to program via serial/uart w.
stm32flash , and it seems like Tormod made it use 128K for a stm32f103c8
https://sourceforge.net/projects/stm32flash/There's a 64-bit win exe here
https://sourceforge.net/projects/stm32flash/files/Edit: Seems line imu is using STM's st-link to program 90k Forth into a 64K device wo. problems , that means the BMP combined might be progra,med w. st-link too.
That ought to make life easier for a M$ user.
Programmer
----------------------
I use a cheap st-link "usb alu stick" clone , and SWD for programming the bluepill.
***** st-link for "easy" programming else use oocd *****
Try to install via your distro's install first
else build from source
git clone
https://github.com/texane/stlinkcd stlink
make
cd build/Release
make
make install
(make sure /usr/local/lib/ is in some .conf file in /etc/ld.so.conf.d)
ldconfig
******** Program the Bluepill w. the combined dfu & binary in the attached zip *****
st-flash erase
** Now disconnect & reconnect the BMP
blackmagic/src$ st-flash --flash=0x20000 write bmp-combined-dfu-bin.bin 0x8000000
st-flash 1.5.1-50-g3690de9
2019-12-10T19:49:45 INFO common.c: Loading device parameters....
2019-12-10T19:49:45 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2019-12-10T19:49:45 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
Forcing flash size: --flash=0x00020000
2019-12-10T19:49:45 INFO common.c: Attempting to write 90196 (0x16054) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08016000 erased
2019-12-10T19:49:47 INFO common.c: Finished erasing 89 pages of 1024 (0x400) bytes
2019-12-10T19:49:47 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-12-10T19:49:47 INFO flash_loader.c: Successfully loaded flash loader in sram
89/89 pages written
2019-12-10T19:49:53 INFO common.c: Starting verification of write complete
2019-12-10T19:49:54 INFO common.c: Flash written and verified! jolly good!
************ DONE *******************
DIY
BMP project recommends swlink as probe target for a bluepill
git clone --recursive
https://github.com/blacksphere/blackmagic.gitcd blackmagic
make
cd src
make clean
#make PROBE_HOST=stlink
make PROBE_HOST=swlink
***** st-link for "easy" programming else use oocd *****
Try to install via your distro's install first
else build from source
git clone
https://github.com/texane/stlinkcd stlink
make
cd build/Release
make
make install
(make sure /usr/local/lib/ is in some .conf file in /etc/ld.so.conf.d)
ldconfig
******** Program the Bluepill dfu & then upgrade *****
Requires that you have build from source (DIY).
st-flash erase
blackmagic/upgrade$ sudo st-flash erase
st-flash 1.5.1-50-g3690de9
2019-12-10T19:54:20 INFO common.c: Loading device parameters....
2019-12-10T19:54:20 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2019-12-10T19:54:20 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
Mass erasing
** Now disconnect & reconnect the BMP
Flash the dfu bootloader
st-flash --flash=0x20000 write blackmagic_dfu.bin 0x8000000
Now the dfu bootloader is programmed
** Now disconnect & reconnect the BMP
dfuutil will fail if the binary is larger than 64KB , on a stm32f103c8 device.
It honours the flashsize reported from the c8 , even if it "has" 128KB
But there is a "trick" ....
If blackmagic DFU is installed on the BMP you can use the blackmagic_upgrade executable to upgrade the BMP
The blackmagic_upgrade is included as source in the upgrade dir.
First build blackmagic_upgrade
----------------------------------
If you are in the src dir , then cd ../upgrade , then :
make
Now blackmagic_upgrade should be there.
sudo ./blackmagic_upgrade
Will upgrade the target w. a blackmagic.bin from ../src -- use sudo
/blackmagic/upgrade$ sudo ./blackmagic_upgrade
[sudo] password for bingo:
Black Magic Probe -- Firmware Upgrade Utility -- Version 1.0
Copyright (C) 2011 Black Sphere Technologies Ltd.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Resetting device in firmware upgrade mode...
Found device at 003:006
All operations complete!
/blackmagic/upgrade$
*********** DONE ******************