cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK/V2-1 software

Jeroen de Bruijn
Associate II
Posted on March 08, 2018 at 21:23

I'm designing a PCB and am interested in adding the ST-LINK/V2-1 programming and debugging board to it. I found the schematics and example PCB design in the

http://www.st.com/en/evaluation-tools/nucleo-f103rb.html

 page but could not find the software anywhere. I know I can just buy the components used in the design, but then the STM32F103CBT6, used in the ST-LINK/V2-1 section, would be unprogrammed (or only contain a bootloader). The program that is used to do the SWD/JTAG interface between the host MCU needs to be programmed to it (using USB and bootloader or ST-LINK/V2 or something), but I don't have that software. Is that software available anywhere? I could only find the 

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link007.html

 firmware update so far. Preferably I'd like the source code of the software so it doen't matter if I swap any pins in the design or add some LEDs and extra signals to the host MCU or something.

Really hope someone (from ST) can help we with this!
8 REPLIES 8
Andrew Neil
Evangelist III
Posted on March 09, 2018 at 09:42

Why would you want to put an STLink on your own board?

ST put it on Discovery and Nucleo boards because those are for use during prototyping & development - where it is convenient to have the programmer & debugger integrated.

But putting it on a custom board just adds cost, size, & complexity for something which is of no use in an end-product.

The normal approach is to put a connection point for loading firmware. Often, this isn't even a connector - just test-points for use on a 'bed-of-nails' jig.

AFAIK, ST don't make the STLink firmware available.

Uwe Bonnes
Principal III
Posted on March 09, 2018 at 11:14

Ask your FAE. Things may be different than Andrew knows...

Otherwise you can also put the BMP firmware

https://github.com/blacksphere/blackmagic

  on the STM32F103. Ask on

https://gitter.im/blacksphere/blackmagic

  if you have special problems.

Andrew, if you do single or small quantity boards, it comes handy to have debug/program facility on board with USB connectivity with no need for a  special connector.

Posted on March 09, 2018 at 11:55

It is very useful during prototyping & development. Especially when you can connect a single USB cable to it for both a (virtual) serial interface and programming/debugging.

For the end-product situation I completely agree with you, just some test points should be enough for that.
Posted on March 09, 2018 at 11:57

Thanks Uwe,

Do you know whether the BMP firmware also supports the virtual COM port like the ST-LINK/V2-1 on a nucleo board does. That is one of the main reasons to use this vs a external ST-LINK/V2 and a UART to USB converter. We use the UART for logs etc.
Posted on March 09, 2018 at 12:04

No doubt it's very handy for the developer - but a useless overhead as far as the actual product and end-users are concerned.

I guess if you've got board space and BoM cost to burn - that's fine ... ?

Tilen MAJERLE
ST Employee
Posted on March 09, 2018 at 13:54

Hello

vidavidorra

‌,

sorry but ST does not provide the source or binary of ST-Link V2/1 firmware.

Solution in this case is to use external. You can cut part of Nucleo board and use only ST-Link in your prototyping.

Best regards,

Tilen

Posted on March 09, 2018 at 13:07

Yes, BMP does UART too. SWO via asyn serial is also supported experimental in one of my branches at github. Use

https://github.com/orbcode/orbuculum

  to evaluate SWO.
Geoffrey1
Associate III
Posted on March 11, 2018 at 18:47

Having been down this path, it's not for the faint of heart.  As the previous replies suggested, you do need a compelling reason to add the extra hardware -- the stlink board that is a (removable) part of the nucleo is the best cheap solution.   Really, any probe that talks ARM SWD will work fine (e.g. j-link) and a 10-pin mini connector is a lot less expensive than a spare processor + associated components.

In our application, we have a compelling reason.  We're designing data collection tags for biologists studying the movement and activity of song birds.  Our partners need a base to configure the tags, charge the batteries, and download data.  One possible approach would have been to build this around the stlink from a nucleo, but we still needed a processor to handle battery charging.  Once there's an extra processor, lots of other things become possible (e.g. power measurement).   So, we replicated the stlink api and added another USB (logical) interface to control the auxiliary functionality.    All much more work than I anticipated and I wouldn't have bothered had I known what I was in for.

If you are set on this and don't want to use the black magic probe or don't need much functionality, look at CMSIS DAP libraries.  They're quite portable and (relatively) easy to understand.    They are a bit bandwidth limited because the Host/Debugger interface is much lower level than stlink.

That said, the SWD interface (through stlink or other device) is a wonderful way to interact with a space and pin limited device.  The Debug Handler interface makes it possible to implement an RPC mechanism through SWD.  We even have a ChibiOS shell running through SWD.

Geoffrey