ST-Link Vs Jlink

MartynC
Wed Nov 22, 2017 6:01 am
Hi

What are the differences between ST-Link and Jlink and can Jlink be used to program the STM32F103 boards?


RogerClark
Wed Nov 22, 2017 6:37 am
J-Link provides both JTAG and SWD hardware interfaces (and possibly others), but ST-Link only does SWD and SWIM

At a hardware level both can be used to program the STM32

My LibMaple based Arduino Core has the option to upload via JLink for some boards eg. generic _stm32f103 aka Blue Pill

However it will only work if you have JLink’s own software installed, i.e JFlash and specifically the command line tool.
Also you must add the path to your JFlash binaries folder to the system path, because it was impractical to get it to work without doing this, because annoyingly Segger put each version of JFlash into a folder with a different name (based on its version).
i.e this is handy if you happen to want loads of different versions of JLink installed as they don’t overwrite when you upgrade, but its a problem for any third party software e.g. the Arduino IDE as there is no way to know the path to the Segger JFlash binaries


MartynC
Wed Nov 22, 2017 8:01 am
Thanks. I was starting to get a bit lost in all the half information that is available online.

This means the boards can be programmed with:
USB to serial adapter,
ST-Link,
J-Link, and
Bootloader + onboard USB.

Are there any other options?


Slammer
Wed Nov 22, 2017 8:28 am
and the Black Magic Probe…. (aka BMP)

Is another type of SWD adaptor but…

– It is open-source/open hardware.
– Includes debugging functionality as gdb server ( replaces stlink+ocd )
– Includes an UART interface
– Supports non STM chips.

Actually you can transform to BMP any STM32F103 board with USB, for example it is very good idea to use an extra Blue Pill as BMP.


RogerClark
Wed Nov 22, 2017 9:57 am
For the STM32F103, the MCU can be directly flashed via USB to Serial or some sort of SWD programmer

JLink, BlackMagic Probe and ST-Link are all SWD programmers. There other types of SWD progamers, but my Libmaple based repo only supports upload via those three.

The Maple bootloader (aka stm32duino bootloader) the only bootloader option that the libmaple and STM32 GENERIC repo’s support on the STM32F1

Note. The STM32F4 has a built in USB DFU bootloader, however it uses DFUSE which is a STM specific extension to DFU and requires completely different drivers (installed by Zadig) and a different version of DFU_util which supports the DFU extensions

I don’t know if any of the cores support this, but my LibMaple based core only supports bootloader on the F1


MartynC
Wed Nov 22, 2017 2:09 pm
Many thanks

racemaniac
Wed Nov 22, 2017 2:42 pm
maybe also interesting for this topic: the ST-Link has less capabilities, but is there anything you miss out on by not going for a J-Link?
i’m currently using an ST-Link for debugging etc… and can’t imagine what another device could offer extra.

so i think part of the answer is: go for whichever one you can get cheaper, they’ll all fit your needs :).


Ollie
Wed Nov 22, 2017 6:17 pm
I do agree with racemaniac that the simple ST-Link does everything you need. In addition to the cost, you should select the least problematic platform. I don’t know which one is the most robust. Over the past, I have had a lot of driver issues with ST-Link and the latest V2.1 is not working for my boards. In addition to the mentioned links, I am planning to switch to EBLink.

Slammer
Wed Nov 22, 2017 8:07 pm
Personally, I found BMP more convenient than others. I like also the embedded usb to serial interface.
For professional use, specially for debugging, I think that JLink is the way to go, as it is the industry standard and is officially supported (eg. Eclipse, ARM plugin, etc…).
For hobby use, and for downloading programs to MCU (as ISP), ST-Link is more than enough for the price.

RogerClark
Wed Nov 22, 2017 8:27 pm
I have found that the JLink boards from China have a habit of erasing themselves, Fortunately someone posted an old binary on the web ages ago and it is possible to reflash them. Nevertheless it’s a pain when this happens

Also there are some JLinks on eBay ( from China) which use a STM32. They do work, but are a very old version, which was only intended to be permanently embedded on a target board.
And Segger stopped supporting them in JFlash about 6 months ago.


Slammer
Wed Nov 22, 2017 8:59 pm
Original JLink is not a toy… costs about 300$ for basic version and 500$ for Plus, it is unfair to compare it with the ST-Link. Actually ST-Link is an ISP interface with some debugging abilities and JLink is a professional JTAG.

Rick Kimball
Wed Nov 22, 2017 9:10 pm
When you say it isn’t toy .. what makes it not a toy? I get the feeling the Segger guys have been making an extreme profit for a long time because there wasn’t any low cost alternatives. Their willingness recently to offer a low cost version seems to not because they care, but because they are getting price pressure for the BMP, ST-Link, and CMSIS providers.

I tried switching my st-link to a j-link. I really didn’t see any advantage.

* I should say I’m biased to the BMP software, I converted my stm32f100 value line ST-LInk V1 to be BMP and I’m extremely happy


RogerClark
Wed Nov 22, 2017 9:12 pm
With JLink you are also playing for JFlash and the large suite of tools which support thousands of processors.
STLink is only designed to program ST devices (but can program others if you use Open OCD) , hence it just has a simple windows GUI and command line exe

Note. STLink on some Nucleo boards also has USB to Serial, and I think some have USB Mass storage as well

I only use JLink occasionally because of JFlash, which makes it convenient to read and write binaries and modify the flash etc


Rick Kimball
Wed Nov 22, 2017 9:18 pm
[RogerClark – Wed Nov 22, 2017 9:12 pm] –
Note. STLink on some Nucleo boards also has USB to Serial, and I think some have USB Mass storage as well

Every NUCLEO supports the USB Mass Storage program load. This is seriously underrated by the crowd here. It allows you to flash the target MCU without any custom host side software. You just drag and drop the binary and it loads onto the target. This is a huge advantage. It allows you to use any device that can deal with USB Mass Storage, be it a raspberry pi, a tablet or os/x computer without having to worry about custom drivers.

Also underatted, is that the NUCLEO devices provide a Virtual COM device. So you don’t have to use native USB if you don’t want to, you can just connect to PA9/PA10 USART serial.


RogerClark
Wed Nov 22, 2017 9:56 pm
Rick

I did investigate whether it would be possible to make a USB mass storage bootloader but I think the overhead of the file system, made it quite large

Drive letter on Windows can also be a problem for automating the USB Mass storage, as the IDE does have a dropdown to select mass storage drive for upload.
I think there is a workaround for the drive letter on Windows, but using one of Windows on built in command line utils, I presume Linux etc has the same

BTW.

I’m not contesting that JLink is vastly over priced, even including that it comes with JLink etc, as they can’t now be spending very much to keep things updated, and the development costs must gave been recovered years ago.


Slammer
Wed Nov 22, 2017 10:41 pm
[Rick Kimball – Wed Nov 22, 2017 9:10 pm] –
When you say it isn’t toy .. what makes it not a toy?

The price, I think…. I totally agree with you about the pricing policy of JLink.
I am also using BMP with Eclipse and gdb and it is OK.


Leave a Reply

Your email address will not be published. Required fields are marked *