Skip to main content
CCend.2
Associate II
April 25, 2023
Solved

Downgrade STM32CubeProgrammer in STM32CubeIDE

  • April 25, 2023
  • 4 replies
  • 4012 views

STM32CubeProgrammer v2.13 was giving me the famous "Failed to execute MI command" and "Failed to download Segment[0]" errors within the STM32CubeIDE, so I downloaded the standalone STM32CubeProgrammer v2.10 and it works fine. The IDE still uses v2.13, so how do I downgrade that one to v2.10 so I can program my chip through the IDE?

Best answer by CCend.2

I discovered that the original error was coming from the line "file segment @0x08000000 is not 255-bytes aligned. it will be aligned to @0x07FFFFF8" in the STM32CubeProgrammer output. The programmer cannot download the binary to 0x07FFFFF8 because that is an invalid address for flash memory. For some reason certain versions of the programmer does this incorrect alignment (v2.13 and v2.10, in my experience).

I fixed the problem by downgrading the IDE from v1.12 to v1.11.2, which uses STM32CubeProgrammer v2.12 and works as expected.

4 replies

Tesla DeLorean
Guru
April 25, 2023

Rename the directory it currently lives in, and replace it with an unpacked copy of the tools into a directory or the original naming?

Check pathing / naming in the settings for the tools, or within the project meta-data?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
CCend.2
CCend.2Author
Associate II
April 26, 2023

Ok, I did your first suggestion. I went into my debug configuration and clicked "Show Command Line" and got this:

/opt/st/stm32cubeide_1.12.0/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.0.500.202301161003/tools/bin/ST-LINK_gdbserver -p 61234 -l 1 -d -s -cp /opt/st/stm32cubeide_1.12.0/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.0.600.202301161003/tools/bin -m 0 -k

So I went into the cubeprogrammer directory that's used in the command and replaced the bin folder with the bin folder of my v2.10 STM32CubeProgrammer installation, and it actually worked. Now the IDE uses v2.10 when I click "Debug". However, it's still giving me the "Error: failed to download Sigment[0]" error that v2.13 was giving me, which is strange because the standalone v2.10 STM32CubeProgrammer still works fine. Any suggestions? I'll keep messing around and report back if anything changes.

CCend.2
CCend.2AuthorBest answer
Associate II
April 26, 2023

I discovered that the original error was coming from the line "file segment @0x08000000 is not 255-bytes aligned. it will be aligned to @0x07FFFFF8" in the STM32CubeProgrammer output. The programmer cannot download the binary to 0x07FFFFF8 because that is an invalid address for flash memory. For some reason certain versions of the programmer does this incorrect alignment (v2.13 and v2.10, in my experience).

I fixed the problem by downgrading the IDE from v1.12 to v1.11.2, which uses STM32CubeProgrammer v2.12 and works as expected.

Associate II
January 8, 2025

Hello,

I am using the STM32H730ZBTX and the problem is solved for IDE version 1.16.1 and programmer version 2.17.0, but again reapears for 1.17.0 and 2.18.0 versions respectively...

 

Please, could someone check and fix it?

 

Thank you.

Explorer
February 6, 2025

Many thanks to the above post - I wasted a day of my life (and project schedule) because I assumed that the latest versions of these tools would not re-introduce problems that had already been fixed.

Associate II
February 12, 2025

I encountered the same problem with STM32 Cube CLT V1.17. Works OK with V1.16 but not with V1.17.

Please, check it too, it's a real pain.