2023-04-25 01:18 PM
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?
Solved! Go to Solution.
2023-04-25 08:35 PM
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.
2023-04-25 01:25 PM
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?
2023-04-25 07:23 PM
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.
2023-04-25 08:35 PM
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.
2025-01-07 10:07 PM
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.
2025-02-06 04:57 AM - edited 2025-02-06 04:57 AM
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.
2025-02-10 02:39 AM
Hello @ego,
This issue has already been raised to our development team and will be fixed in upcoming releases.
Solved: STM32CubeProgrammer 2.18 BUG on STM32H730 - STMicroelectronics Community
We apologize for any inconvenience and appreciate your understanding.
Maryem.
2025-02-12 07:20 AM
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.