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 !

1 REPLY 1
vsilux
Associate

Same problem with CubeMX, H747I-DISCO and Makefile