Skip to main content
Visitor II
February 12, 2024
Question

ST-LINK V2 Update error Unexpected flash size

  • February 12, 2024
  • 13 replies
  • 18194 views

Used this ST-Link V2 with W10 some years ago. Now on Linux I want to use it with openocd and got error:

ST-Link version does not support DAP direct transport

Most likely the cable adapter needs update.

But the STLinkUpgrade.jar reported  Unexpected flash size after opening the cable in update mode.

What can I do to use the cable?

13 replies

AScha.3
Super User
February 12, 2024

1, Which st-link v2 - the "usb-stick" ?

2. Version of st-link firmware on it ?

3. Use with ..IDE or CubeProgrammer (on Linux, i use it also) ?

4. Check with CubeProgrammer - connect - what it telling ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
February 12, 2024

There are low cost CMSIS-DAP dongles if you need such things.

There is also a tool to convert ST-LINK/V2-1 to Segger J-LINK OB

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
February 12, 2024

@Andreas_Engineer wrote:

this ST-Link V2


What "ST-Link V2"? Did you mean to add a photo or link?

Beware that any so-called "ST-Link V2" looking like this:

AndrewNeil_0-1707748264048.jpeg

is not a genuine ST product - so you get what you pay for!

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Visitor II
March 18, 2024

I am getting the same error on a genuine ST Link v2. My StLink looks like https://uk.farnell.com/stmicroelectronics/st-link-v2/icd-programmer-for-stm8-stm32/dp/1892523

stLink.jpg

Explorer II
April 3, 2024

I have exact the same white st-link v2. The cube programmer v2.16.0 with stlinkupgrade v3.13.4 successfully upgraded my debugger to V2J43S7. This firmware version is at least works with cubeIDE v1.15 although it still triggers the upgrade prompt and the unexpected flash error. However, my NUCLEO F446 has no problem at all. It can be perfectly upgraded inside the cubeIDE v1.15.

It seems like the cubeIDE v1.15 is a major and painful upgrade and it already cost me hours to fix a lot of things. It is obviously not a smooth upgrade. Be careful about the ioc migration and make backup. I have experienced a failure after the IDE upgrade. Without changing any code and just migrate the ioc, recompile and flash, totally not working. However, when I reloaded my backup and migrated again, everything worked.

Considering almost everything are free, I would not complain about ST or cubeIDE team. 

Visitor II
March 18, 2024

I have been using CubeIde 1.10.0. But as part of project migration had to upgrade to 1.15.0. But the ide wont download the application image till I upgrade the firmware of StLink. Unfortunately, stuck with the STLink firmware upgrade!

AScha.3
Super User
March 18, 2024

again:

4. Check with CubeProgrammer - connect - what it telling ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Visitor II
March 18, 2024

Please see below.

I tried to upgrade the firmware using CubeProgrammer too. Unfortunately it reports STLinkUpgrade.jar not found.
image.pngimage.png

March 21, 2024

Encountered Same Issue

Associate III
March 25, 2024

Same here.

Explorer
March 25, 2024

the same issue "unexpected flash size for st-link micro"

Explorer
March 25, 2024

I was able to upgrade, I've downloaded https://www.st.com/en/development-tools/stsw-link007.html a previous version - 3.13.4.

Graduate
March 26, 2024

As I stated, STMCubeProgrammer version -2.16.0- includes the Firmware Upgrade utility and the STLinkUpgrade launched is version 3.13.4 which works as expected.

jon2
Associate II
March 26, 2024

I am seeing this issue also. Using CubeProgrammer still causes the popup too.

Graduate
March 31, 2024

Same problem with STM32CubeIDE 1.15.0, launching STLinkUprade 3.14.5, while I play with an STM32F429I_DISCO board. Will try the stand-alone programmer.