Segger free upgrade of Nucleo ST-Link to J-Link compatible

Post Reply
gbulmer
Posts: 67
Joined: Wed Sep 23, 2015 12:04 am
Location: UK

Segger free upgrade of Nucleo ST-Link to J-Link compatible

Post by gbulmer » Thu May 05, 2016 1:31 am

I stumbled across this Firmware for ST-LINK on-board announcement at Segger.com

Segger are offering a free firmware upgrade to be applied to ST Nucleo's on-board ST-Link.
The upgrade promises to turn the on-board ST-Link hardware into something "compatible to J-Link OB".

The one feature which caught my eye is "Virtual COM port (VCOM) support"

There are various restrictions though, for example:
The firmware may only be used for development and/or evaluation purposes. It may not be used for production purposes.
It might be useful to someone who has a development system which supports the Segger J-Link product.

They appear to include instructions on how to restore the origonal ST-Link firmware, which begs a few intriguing questions.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Segger free upgrade of Nucleo ST-Link to J-Link compatible

Post by RogerClark » Thu May 05, 2016 3:34 am

@gbulmer

Yes. ReFlashing back to the original firmware would imply that they have come to an agreement with ST-Link to license the ST-Link firmware, as AFIK ST do not freely distribute the ST-Link binary.

From what I've read, ST's own firmware updater downloads an encryped version of the STLink binary, (probably from a site with SSL - though this won't really matter as the binary is encrypted), and what actually happens is that ST's updated decripts the binary into the PC's RAM, and then re-encrypts again to match a key in the STLink hardware.
The freshly encrypted binary is then sent to the STLink (via USB) and the STLink firmware decrypts the binary and reflashes its self.

So to flash a ST-Link using its own internal reflash system, would imply that Seggers EXE can perform the encryption (Blowfish algorithm), that is needed to send the encrypted binary to the ST-Link.

They could have reverse engineered the whole lot (like some hackers have), but I would imagine that they have an agreement with ST and gained access to their source code and also their encryption keys

gbulmer
Posts: 67
Joined: Wed Sep 23, 2015 12:04 am
Location: UK

Re: Segger free upgrade of Nucleo ST-Link to J-Link compatible

Post by gbulmer » Thu May 05, 2016 9:02 am

Yes I agree with your analysis, though I did have a less-likely alternative.

For this to work, either Segger has permission, and support from ST to use ST's ST-Link binary, or Segger have their own implementation of ST-Link. I think this later option is less likely than your analysis.

So, I wonder what one has to do to get that permission?

AFAYK, does the normal ST-Link firmware upgrade mechanism overwrite whatever is on the ST-Link?

I was wondering if an ST Nucleo's on-board ST-Link could be converted to a Black Magic Probe, and further, if it could be converted back to an ST-Link.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Segger free upgrade of Nucleo ST-Link to J-Link compatible

Post by RogerClark » Thu May 05, 2016 10:50 am

I was wondering if an ST Nucleo's on-board ST-Link could be converted to a Black Magic Probe, and further, if it could be converted back to an ST-Link.
I don't see why you cant run BMP on the STLink MCU, but you'd need to flash the STLink MCU using USB Serial or another STlink, I doubt that the the STLink upgrading system would be compatible with replacing its self with the BMP, even if the BMP could be sent in an encrypted format expected by the STLink.

From what I've read the update that is downloaded by the STLink program (on Windows), is a complete binary and includes its own updater. So the STLink update system isnt structured like a bootloader and a runtime. Well, it could be structured in that way, its hard to tell without reverse engineering the STLink binary.

Anyway, if you flashed the STLink MCU on a Nucleo with BMP it would only be possible to get back to STLink if you reflashed with a full STLink binary.
I know its not officially released, but there is a copy of the STLink dongle binary kicking around on the web.

But I'm not aware of a version of the STLink binary on the Nucleo board which also has USB Serial pass-though


Actually, I've never seen a Nucleo board with this version of STLink, but I thought they existed (though I could be wrong)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest