Skip to main content
Associate
January 3, 2026
Solved

CubeMX 6.16.1 linker generation bugs

  • January 3, 2026
  • 3 replies
  • 499 views

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

 

sandwizard_0-1767430692804.png

 

Best answer by Souhaib MAZHOUD

Hello all,

Issue is fixed in the latest STM32CubeMX release 6.17.0 available here.

KR, Souhaib

3 replies

Associate
January 3, 2026

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

TDK
Super User
January 3, 2026

No such issues here when starting a new project.

TDK_1-1767452326120.png

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
January 3, 2026

@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*/
}

 

Technical Moderator
January 5, 2026

Hello @sandwizard 

Thank you for highlighting this issue.!

Issue has been raised internally with the dedicated team for further investigation. (Ticket 224550 This is an internal tracking number and is not accessible or usable by customers).

KR, Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Souhaib MAZHOUDBest answer
Technical Moderator
February 25, 2026

Hello all,

Issue is fixed in the latest STM32CubeMX release 6.17.0 available here.

KR, Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.