STM32CubeMX (standalone) generated linker script differs from the one generated by STM32CubeIDE with NUCLEO-H7A3ZI-Q
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-07 2:20 AM - last edited on ‎2025-07-28 7:38 AM by Andrew Neil
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 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-06 3:34 PM
Same problem with CubeMX, H747I-DISCO and Makefile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-07-28 6:00 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-07-28 7:29 AM - edited ‎2025-07-28 7:31 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-07-28 8:10 AM
I got the last versions of both programs. The difference still exists.
CubeMX puts the data into:
