2026-01-03 1:06 AM
Hello,
We appear to be experiencing a severe code generation bug with CubeMX. After naming and sizing application regions in the memory management tool, what used to generate a correct linker script now generates bad output.
Upon generation the linker script STM32U575XX_FLASH.ld now shows:
/* Specify the memory areas */
MEMORY
{
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 768K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
/*start of MX regions Auto-generated By STM32CubeMX*/
RAMBK (rw) : ORIGIN = 0x20000000, LENGTH = 768K
RAM4 (rwx) : ORIGIN = 0x20000000, LENGTH = 768K
SPIFLASH (rwx) : ORIGIN = 0x08000000, LENGTH = 2048K
/*end of MX regions*/
}Given that we cannot downgrade the IOC and have performed more work this is an awkward situation and we will manually manage regions in the meantime. This was not an issue before. Please advise what may be going on.
Host: OS X 26.2
CubeMX: 6.16.1
Target: STM32U575xx
2026-01-03 1:32 AM
We can confirm this issue reproduces on Windows 10 running CubeMX 6.16.1
We can also confirm this issue is occurring with multiple projects all in the STM32U5 family
2026-01-03 6:59 AM - edited 2026-01-03 7:01 AM
No such issues here when starting a new project.
Please include the IOC you are having trouble with.
Looks like your linker file has been manually modified. The linker file isn't regenerated when you click "Generate Code" unless it's missing.
2026-01-03 10:55 AM
@TDK Not sure what you mean. CubeMX absolutely regenerates the linker script with user-provided application regions. Notice:
/*start of MX regions Auto-generated By STM32CubeMX*/
We have isolated and reproduced this issue.
The problem is when regenerating the ld file. We took these steps
1. New ioc without any code generated (attached)
2. Generate code
3. Check .ld file, no issue looks good.
4. Generate code again
5. Corrupted .ld file.
6. Manually delete the .ld file in the project directory
7. Generate code again
8. Check newly generated .ld file, looks good again.
Please confirm issue replication.
In summary, first generation of a new file:
/* Specify the memory areas */
MEMORY
{
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 768K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
/*start of MX regions Auto-generated By STM32CubeMX*/
RAMBK (rw) : ORIGIN = 0x40036400, LENGTH = 2K
SRAM4 (rwx) : ORIGIN = 0x28000000, LENGTH = 16K
/*end of MX regions*/
}
Every subsequent regeneration of the same file with no changes then shows this:
/* Specify the memory areas */
MEMORY
{
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 768K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
/*start of MX regions Auto-generated By STM32CubeMX*/
RAMBK (rw) : ORIGIN = 0x20000000, LENGTH = 768K
SRAM4 (rwx) : ORIGIN = 0x20000000, LENGTH = 768K
/*end of MX regions*/
}