for a 'workaround' assuming that you are using a stm32f401/f411 black pill, stm32f4 has DFU built-in.
just that you'd need to set boot0. normally this is done with this finger dance. connect usb (just a usb cable would do, no dongles needed)
press both boot0 and reset.
release reset
release boot0 1 sec later
that should put it in dfu mode.
you need an updated version of dfu-util
http://dfu-util.sourceforge.net/
then normally check that dfu is connected
if you can see it, usually the command to flash is
Code: Select all
dfu-util -a 0 -s 0x8000000 -RD sketch.bin
you'd need to find the sketch.bin in your Arduino IDE temp folders or use export binary from the menu.
after flashing press reset and the sketch should be running
as for st-link, normally you would see it in
if you are using the open sourced st-link (st-flash)
https://github.com/stlink-org/stlink
normally there is a command st-info
that should get you something about the st-link and the stm32 if it is properly connected
the command to flash normally is
Code: Select all
st-flash erase
st-flash write sketch.bin 0x8000000
the erase step is normally unnecessary, if it can't connect there would normally be error messages.
if ti did not say that the flash is write protected, it could be that the debug ports (e.g. swd) is disabled.
that can be bypassed using that 'connect under reset' technique when doing the erase or flashing (i.e. press/hold reset and run that command to erase)
or another way is to write a binary via usb DFU with a sketch that doesn't block out the debug ports, for that u'd need to check in your core/sketch or config settings (e.g. is some option selected to disable the debug ports in the menu?).