Skip to main content
Visitor II
April 10, 2022
Question

Flash MCU SW via SWD without ST-Link

  • April 10, 2022
  • 3 replies
  • 1720 views

I am currently working on a HIL Setup. I want to flash my Target Software on a STM F3 via SWD.

Only the SWD Pins pins are free, all other Pins are already used and can't be used for flashing the device.

I have a STM H7 on the simulator of the HIL. I want my STM H7 to behave like a ST-Link for the STM F3 while flashing the Software on the STM F3.

My question is if there is a easy way to implement the ST-Link software on a STM H7.

Has anyone found the source code of ST-Link? Are there any useful UML diagrams for this,

if there is no open software?

Thank you in advance

    This topic has been closed for replies.

    3 replies

    Explorer II
    April 10, 2022

    For open source code:

    https://github.com/bl*ckmagic-debug/bl*ckmagic

    (replace '*' by 'a')

    The binary for STLINK-V2 flows around, but sources???

    For docs:

    "ARM Debug Interface Architecture Specification ADIv5.0 to ADIv5.2",

    search for "ARM IHI 0031D"

    Graduate II
    April 10, 2022

    Other methods include using the Boot ROM, and the System Loader to push the update with the Serial port. See AN 2606 and 3155​

    thechrisAuthor
    Visitor II
    April 10, 2022

    Thank you for your answers, really helpful.

    The easy way with flashing the device via interal ROM bootloader is unfortunately not working. All pins are in use, the important pins are not directly connected to the H7. So flashing via UART is probably not working.

    Have to verify, if I can use a Y-cable to flash the F3.

    Also flashing via USB is not working.

    I will have a deeper look into black-magic. Sounds really interesting. Also very happy to see, that the github repo is still actively maintained. Hope I can copy parts of the code and run it on the H7.

    Thank you