cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX 6.16.1 linker generation bugs

sandwizard
Associate II

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

 

3 REPLIES 3
sandwizard
Associate II

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

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".
sandwizard
Associate II

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