cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX (standalone) generated linker script differs from the one generated by STM32CubeIDE with NUCLEO-H7A3ZI-Q

AMale.3
Associate

Hi,

 

I am using the Nucleo-H7A3ZI-Q Board and was trying to use the DMA to transmit SPI frames.

 

Only creating simple SPI TX Circular DMA request works when generating the code from STM32CubeIDE 1.12.1 (with STM32CubeMX 6.8.1). I get two linker scripts STM32H7A3ZITXQ_FLASH.ld and STM32H7A3ZITXQ_RAM.ld. In the STM32H7A3ZITXQ_FLASH.ld, I get this memory section

MEMORY
{
  ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
  FLASH (rx)     : ORIGIN = 0x08000000, LENGTH = 2048K
  DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
  DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
  RAM (xrw)      : ORIGIN = 0x24000000, LENGTH = 1024K
  RAM_CD (xrw)   : ORIGIN = 0x30000000, LENGTH = 128K
  RAM_SRD (xrw)  : ORIGIN = 0x38000000, LENGTH = 32K
}

When I was generating the code from STM32CubeMX (alone) to generate code with the "toolchain/IDE" option set to Makefile, the same code does not work. Diff reveals no difference in Core/ and Drivers/ folders (Firmware version are the same in IDE and MX : STM32Cube FW_H7 V1.11.0) but I get only one linker file STM32H7A3ZITxQ_FLASH.ld in which the memory section contains:

MEMORY
{
DTCMRAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 128K
RAM (xrw)      : ORIGIN = 0x24000000, LENGTH = 1024K
ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx)     : ORIGIN = 0x8000000,  LENGTH = 2048K
}

 

If in the CubeMX generated code, I update the only linker script with the STM32H7A3ZITXQ_FLASH.ld (from the CubeIDE), the Makefile version works well as the CubeIDE project.

 

Do you think it might be a CubeMX bug ?

I did not find linker option sections in STM32CubeMX.

 

Note that I tried to reproduce the same with a Nucleo-L476RG and there was not this issue, everything works fine on the first try in both CubeIDE and CubeMX.

 

Thank you in advance for you help !

 

4 REPLIES 4
vsilux
Associate

Same problem with CubeMX, H747I-DISCO and Makefile

Vmanne
Associate

I encountered the same issue with my STM32H7A3VGT controller. The linker script generated by CubeMX does not work for spi transmit by dma.

But when I use the CubeIDE the dma works with its different linker script.

I simply copied this linker file to my CubeMX project and it worked. It seems the linker script in Cube MX is somehow "outdated" and does not use the proper RAM which is needed for the dma (?) since other transfer types (it and direct) work properly.

For the moment I just use the other linker script.

Ghofrane GSOURI
ST Employee

Hello @AMale.3 

I am currently investigating this issue. In the meantime, could you please verify using the latest versions of CubeMX (6.15.0) and STM32CubeIDE (1.19.0) to see if the problem still persists?

 

THX

Ghofrane

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.

I got the last versions of both programs. The difference still exists.

 

CubeMX puts the data into:

 

DTCMRAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 128K

 

CubeIDE puts the data into:
 
RAM (xrw)      : ORIGIN = 0x24000000, LENGTH = 1024K
 
Only the CubeIDE version works.