cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE Debug Error - "File segment @0x08000000 is not 255-bytes aligned.."

David George
Associate III

Having just opened a STM32 Cube IDE project from 2024 (which did build and run last year) now when I build and try and debug I get this error message

File segment @0x08000000 is not 255-bytes aligned. It will be aligned to @0x07FFFFF8

 

So, using my original CubeMX .ioc file I have created a new "hello world" project in Cube IDE.

This builds fine, but again when I try and debug I get the same error message

File segment @0x08000000 is not 255-bytes aligned. It will be aligned to @0x07FFFFF8

So this suggests its a IDE/Tool problem.

The linker file is "as created", its not been altered in any way.

 

I'm using "latest" versions of IDE and MX

STM32CubeIDE, Version: 1.17.0, Build: 23558_20241125_2245 (UTC)

STM32CubeMX, Version: 6.13.0-RC5, Build: 20241122-0809 (UTC)

My STLINK-V3SET has been updated with latest firmware.

The target device is a STM32H730 on a custom board.

 

Any help or advice would be appreciated.

Thank you.

 

Console snippet..

Opening and parsing file: ST-LINK_GDB_server_a25708.srec

Memory Programming ...
File : ST-LINK_GDB_server_a25708.srec
Size : 52.79 KB
Address : 0x08000000

Erasing memory corresponding to segment 0:
Erasing external memory sector 0
File segment @0x08000000 is not 255-bytes aligned. It will be aligned to @0x07FFFFF8
Download in Progress:

1 ACCEPTED SOLUTION

Accepted Solutions
David George
Associate III

I installed Cube Programmer v2.17.0 and this now programs my .elf file into the STM32H730 successfully.

 

I then replaced the v2.18.0 Cube Programmer packaged for Cube IDE, I just copied the V2.17.0 version over it.

Contents of folder com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.400.202404281720

to folder com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.0.202409170845

in the ..\STM32CubeIDE\plugins directory.

Now Cube IDE programs the STM32H730 and starts a Debug session successfully.

 

So the issue is with with Cube Programmer v2.18.0

I believe this is a known bug in v2.18.0

But a pain if you've installed Cube IDE 1.17.0 as you'll get Cube Programmer v2.18 packaged with it.

 

View solution in original post

6 REPLIES 6

I recollect other complains about this.

Strikes me that it's metadata related to sections described in the .ELF file.

So perhaps from the .LD, but also perhaps via various .O(OBJ) and .A(LIB) files combined by the linker

@STTwo-32 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
David George
Associate III

This post seems to cover the same problem in the IDE, posted on ‎2025-01-07 by ego

https://community.st.com/t5/stm32cubeprogrammer-mcus/downgrade-stm32cubeprogrammer-in-stm32cubeide/m-p/59156#M191 

I will try another version of Cube Programmer (I have v2.18.0)

 

David George
Associate III

I installed Cube Programmer v2.17.0 and this now programs my .elf file into the STM32H730 successfully.

 

I then replaced the v2.18.0 Cube Programmer packaged for Cube IDE, I just copied the V2.17.0 version over it.

Contents of folder com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.400.202404281720

to folder com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.0.202409170845

in the ..\STM32CubeIDE\plugins directory.

Now Cube IDE programs the STM32H730 and starts a Debug session successfully.

 

So the issue is with with Cube Programmer v2.18.0

I believe this is a known bug in v2.18.0

But a pain if you've installed Cube IDE 1.17.0 as you'll get Cube Programmer v2.18 packaged with it.

 

Kraal
Senior III

If I recall correctly it is not due to the elf / srec file, nor completely CubeProgrammer's fault, but rather the flash loader for the H730 that has a regression issue.

Now that you have a working solution it is not necessary to loose more time, however if the issue rise again in the future, you might want to keep the 0x4xx.stldr file that is used for the H730.
Normally if you launch the debug session in verbose mode it should specify which stldr file is used for your device.

If I'm correct, replacing only this file (which is in bin/FlashLoader) in the 2.18 install with the one from 2.17 should resolve the issue.

Thanks Kraal,  yes, its the 0x483.stldr that used for the STM32H730 devcie.

Makes sense its an issue with the loader file rather than CubeProgrammer.

 

Kraal
Senior III

Hi again,

I believe my workaround is incomplete. According to this thread the other important part to keep from a working Cubeprogrammer installation is the corresponding STM32_Prog_DB_0x4xx.xml file that is located in the folder Data_Base (same level as the bin folder mentionned earlier).