install your sketch using st link, and connect to the pill board using a separate usb-cable
when the sketch/firmware is running, st-link is no longer needed. it is used to flash the firmware (and do debug, beyond scope to describe debug, one can find plenty of articles in web searches)
you can also install a boot loader
https://github.com/rogerclarkmelbourne/ ... ill-Boards
^^the various mods are not needed, the key step is to get the boot loader firmware, and install the firmware using st-link
after that you can place your st-link aside and the Arduino ide can flash the sketch just from that usb cable alone. no st-link needed after that
the command is actually
to install a sketch outside of the Arduino ide. provided the boot loader is previously installed on the board using st-link
and you have to choose the correct upload method (stm32duino boot loader) when you are building your sketch
for the details, review the various wiki
https://github.com/rogerclarkmelbourne/ ... STM32/wiki
http://docs.leaflabs.com/docs.leaflabs.com/index.html
http://docs.leaflabs.com/docs.leaflabs.com/index.html
in the arduino IDE, your compiled sketch is actually in a temporary folder
https://forum.arduino.cc/index.php?topic=492544.0
and in a folder in /tmp in linux
the sketch binary is a sketch.bin file. that file is the binary firmware of your compiled sketch which you can install on the device etc
that file is one that you can use that
dfu-util command to install on the device if the boot loader is installed prior and you choose stm32 duino boot loader as the upload method when you are building your sketch (i.e. click verify)
if you choose st-link as upload and build your sketch, you would need to use st-link to install your sketch, and it is similar to how the boot loader is installed in the first link given above
a fake chip will fail in various ways if you tried the steps in the various popular documented ways and it doesn't work.
if you are able to get a blinky to run on the board, chances are that it isn't fake. but u'd not know really
until you hit trouble again