burning firmware onto an ST-Link to burn firmware onto anything else

davedarkodavedarko wrote 06/07/2021 at 18:37 • 1 min read • Like

at least I'm trying to find that out. The clones from aliexpress are supposed to be only able to program st chips. But I want to use it to program some SAMD-21 chips. Never done that as well. So this is a link drop first. Figuring it out for MAC OS.

install open-OCD via homebrew

for unlocking the stm for new firmware go here

install new firmware called cmsis-dap

get this file

install with this line

openocd -f interface/stlink.cfg -f target/stm32f1x.cfg -c "init" -c "halt" \

    -c "flash write_image ./CMSIS-DAP-STLINK21.hex" -c "shutdown"

doing this to flash arturos latest keyboard firmware, had to install arm gcc first. Brew doesn't work as it's not trusted. Downloading here helped.

to compile arturos fine firmware, you need to add the ARM stuff to your path, otherwise you compile and wonder why he wont find "gcc-arm-none-eabi" again. 

export PATH="$PATH:/Applications/ARM/bin/"