Skip to main content
Garnett.Robert
Senior III
March 3, 2025
Question

CubeIDE V1.18.0 Does not link project correctly

  • March 3, 2025
  • 1 reply
  • 1524 views

Hi,

 

I have a touchGFX V4.23.2 project  written with CubeIDE at least four IDE versions ago and have not had any upgrade problems until I upgraded from 1.17.0 to 1.18.0.

 

When I do a clean build I end up with memory link assignment errors:

 

Snag_24f16061.png

When I do a build using 1.17.0 of the IDE i get an error free compilation and the project runs fine on the target.

Snag_24f24b0f.png

I have checked that the build using 1.18.0 is using the correct linker script and that is OK.

I also checked the section attributes on the variable that go into the external ram and flash.

I note that a new version of gcc has been included, (Updated to GCC 13 as default toolchain) maybe there is a problem with that.

Any ideas on this?

 

My linker script is shown below.

 

 

 

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
 _sstack = ORIGIN(DTC_STACK);
_estack = ORIGIN(DTC_STACK) + LENGTH(DTC_STACK);	/* end of "RAM" Ram type memory */

_Min_Heap_Size = 4k ;	/* required amount of heap */
_Min_Stack_Size = 4k ;	/* required amount of stack */

/* Memories definition */
MEMORY
{
 ITCMRAM 			(xr) : ORIGIN = 0x00000000, LENGTH = 64K

 DTC_STACK 			(xrw) : ORIGIN = 0x20000000, LENGTH = _Min_Heap_Size + _Min_Stack_Size
 DTCM_MISC				(xrw) : ORIGIN = 0x20002000, LENGTH = 120K

 RAM 			(xrw) : ORIGIN = 0x24000000, LENGTH = 256K
 RAMFB 			(xrw) : ORIGIN = 0x24040000, LENGTH = 768K
 FLASH 			(rx) : ORIGIN = 0x08000000, LENGTH = 2048K
 OSPI	 			(xrw) : ORIGIN = 0x90000000, LENGTH = 63936K
 OSPI_BACKUP1 		(xrw) : ORIGIN = 0x93ff0000, LENGTH = 4k
 OSPI_BACKUP2 		(xrw) : ORIGIN = 0x93ff1000, LENGTH = 4K
 D2SRAM1	 			 (rw)	 : ORIGIN = 0x30000000, LENGTH = 32K
 D2SRAM2	 			 (rw)	 : ORIGIN = 0x30010000, LENGTH = 64K
 SRD_SRAM 			(rwx)	 : ORIGIN = 0x38000000, LENGTH = 31k
 BACKUP_SRAM 			(rw)	 : ORIGIN = 0x38800000, LENGTH = 4k
 EXT_RAM_STATS_OUT	(xrw) : ORIGIN = 0xD0000000, LENGTH = 16384K
}


/* Sections */
SECTIONS
{
 /* The startup code into "FLASH" Rom type memory */
 .isr_vector :
 {
 . = ALIGN(4);
 KEEP(*(.isr_vector)) /* Startup code */
 . = ALIGN(4);
 } >FLASH


 /* The program code and other data into "FLASH" Rom type memory */
 .text :
 {
 . = ALIGN(4);
 *(.text) /* .text sections (code) */
 *(.text*) /* .text* sections (code) */

 *(.glue_7) /* glue arm to thumb code */
 *(.glue_7t) /* glue thumb to arm code */
 *(.eh_frame)

 KEEP (*(.init))
 KEEP (*(.fini))

 . = ALIGN(4);
 _etext = .; /* define a global symbols at end of code */
 } >FLASH


 /* Constant data into "FLASH" Rom type memory */
 .rodata :
 {
 . = ALIGN(4);
 *(.rodata) /* .rodata sections (constants, strings, etc.) */
 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
 . = ALIGN(4);
 } >FLASH


 .ARM.extab : {
 . = ALIGN(4);
 *(.ARM.extab* .gnu.linkonce.armextab.*)
 . = ALIGN(4);
 } >FLASH


 .ARM : {
 . = ALIGN(4);
 __exidx_start = .;
 *(.ARM.exidx*)
 __exidx_end = .;
 . = ALIGN(4);
 } >FLASH


 .preinit_array :
 {
 . = ALIGN(4);
 PROVIDE_HIDDEN (__preinit_array_start = .);
 KEEP (*(.preinit_array*))
 PROVIDE_HIDDEN (__preinit_array_end = .);
 . = ALIGN(4);
 } >FLASH


 .init_array :
 {
 . = ALIGN(4);
 PROVIDE_HIDDEN (__init_array_start = .);
 KEEP (*(SORT(.init_array.*)))
 KEEP (*(.init_array*))
 PROVIDE_HIDDEN (__init_array_end = .);
 . = ALIGN(4);
 } >FLASH


 .fini_array :
 {
 . = ALIGN(4);
 PROVIDE_HIDDEN (__fini_array_start = .);
 KEEP (*(SORT(.fini_array.*)))
 KEEP (*(.fini_array*))
 PROVIDE_HIDDEN (__fini_array_end = .);
 . = ALIGN(4);
 } >FLASH


 /* Code into ITCMRAM */
 _itcm_load_ = LOADADDR(.itcm);
 .itcm :
 {
 	. = ALIGN(4);
	_itcm_start_ = .;
	*(.isr_vector_itcm)
	*(.ITCM_SECTION)
	. = ALIGN(4);
 	_itcm_end_ = .;
 } >ITCMRAM AT >FLASH


 /* Used by the startup to initialize data */
 _sidata = LOADADDR(.data);

 /* Initialized data sections into "RAM" Ram type memory */
 .data :
 {
 . = ALIGN(4);
 _sdata = .; /* create a global symbol at data start */
 *(.data) /* .data sections */
 *(.data*) /* .data* sections */
 . = ALIGN(4);
 _edata = .; /* define a global symbol at data end */
 } >RAM AT> FLASH


 /* Uninitialized data section into "RAM" Ram type memory */
 . = ALIGN(4);
 .bss :
 {
 /* This is used by the startup in order to initialize the .bss section */
 _sbss = .; /* define a global symbol at bss start */
 __bss_start__ = _sbss;
 *(.bss)
 *(.bss*)
 *(COMMON)
 . = ALIGN(4);
 _ebss = .; /* define a global symbol at bss end */
 __bss_end__ = _ebss;
 } >RAM


 /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
 ._user_heap_stack :
 {
 . = ALIGN(8);
 PROVIDE ( end = . );
 PROVIDE ( _end = . );
 . = . + _Min_Heap_Size;
 . = . + _Min_Stack_Size;
 . = ALIGN(8);
 } >DTC_STACK

/*
 .heap : {
 __heap_start__ = .;
 end = __heap_start__;
 _end = end;
 __end = end;
 . = . + _Min_Heap_Size;
 KEEP(*(.heap))
 __heap_end__ = .;
 __HeapLimit = __heap_end__;
 } > DTC_STACK

 .stack : ALIGN(0x8) {
 _stack = .;
 __stack = .;
 . = . + _Min_Stack_Size;
 __StackTop = . ;
 KEEP(*(.stack))
 } > DTC_STACK
*/


 	.DTCM_MISC : {
 . = ALIGN(4);
 _sDTCM_MISC = .;
 __sDTCM_MISC__ = _sDTCM_MISC;
 *(.DTCM_MISC) /* All nominated variables */
 	. = ALIGN(4);
 _eDTCM_MISC = .;
 __eDTCM_MISC__ = _eDTCM_MISC;
 } >DTCM_MISC


 /* Backup Ram*/
 .proxVars (NOLOAD) :
 {
 	_bubss = .;
 	__bubss__start = _bubss;
 	*(.PROX_VARS_BACK)

 	. = ALIGN(4);
 	_ebubss = .;
 	__ebubss__ = _ebubss;
 }	>BACKUP_SRAM /* Battery Backed RAM */



 /* I2C DMA Ram*/
 .i2cDMA_Ram (NOLOAD) :
 {
 	_bubss = .;
 	__bubss__start = _bubss;
 	*(.PROX_I2C_TX_BUFF)
 	*(.PROX_I2C_RX_BUFF)
 	*(.ADC1_DMA_BUFF)
	*(.WI_FI_RX_Ram)
 	. = ALIGN(4);
 	_ebubss = .;
 	__ebubss__ = _ebubss;
 }	>D2SRAM1 /* BDomain 2 AHB RAM */



 /* ADC2 Ram*/
 .ADC2_DMA_BUFF :
 {
 	_bubss = .;
 	__bubss__start = _bubss;
 	*(.ADC2_DMA_BUFF)
	*(.WI_FI_TX_Ram)
	*(.UART1_TX_DMA_RAM)
 	. = ALIGN(4);
 	_ebubss = .;
 	__ebubss__ = _ebubss;
 }	>D2SRAM2 /* BDomain 2 AHB RAM */


 .RAM_D3_PLAY_BUFF (NOLOAD) : {
 . = ALIGN(4);
 _sRAM_D3_REC_BUFF3 = .;
 . = ALIGN(4);
 _eRAM_D3_REC_BUFF = .;
 } >SRD_SRAM

 .EXT_RAM_STATS_OUT (NOLOAD) : {
 . = ALIGN(4);
 _sEXT_RAM_STATS_OUT = .;
 . = ALIGN(4);
 _eEXT_RAM_STATS_OUT = .;
 } >EXT_RAM_STATS_OUT


 .OSPI_BACKUP_PARS1 (NOLOAD) :
 {
 _sOSPI_BACKUP_PARS1 = .;
 __sOSPI_BACKUP_PARS1 = _sOSPI_BACKUP_PARS1;
 * (.OSPI_BACKUP_PARS1)
 . = ALIGN(4);
 _eOSPI_BACKUP_PARS1 = .;
 __eOSPI_BACKUP_PARS1 = _eOSPI_BACKUP_PARS1;
 } >OSPI_BACKUP1


 .OSPI_BACKUP_PARS2 (NOLOAD) :
 {
 _sOSPI_BACKUP_PARS2 = .;
 __sOSPI_BACKUP_PARS2 = _sOSPI_BACKUP_PARS2;
 * (.OSPI_BACKUP_PARS2)
 . = ALIGN(4);
 _eOSPI_BACKUP_PARS2 = .;
 __eOSPI_BACKUP_PARS2 = _eOSPI_BACKUP_PARS2;
 } >OSPI_BACKUP2


 /* Remove information from the compiler libraries */
 /DISCARD/ :
 {
 libc.a ( * )
 libm.a ( * )
 libgcc.a ( * )
 }

 .ARM.attributes 0 : { *(.ARM.attributes) }

 FramebufferSection :
 {
 *(TouchGFX_Framebuffer TouchGFX_Framebuffer.*)
 *(.gnu.linkonce.r.*)
 . = ALIGN(0x4);
 } >RAMFB

 FontFlashSection :
 {
 *(FontFlashSection FontFlashSection.*)
 *(.gnu.linkonce.r.*)
 . = ALIGN(0x4);
 } >OSPI

 TextFlashSection :
 {
 *(TextFlashSection TextFlashSection.*)
 *(.gnu.linkonce.r.*)
 . = ALIGN(0x4);
 } >OSPI

 ExtFlashSection :
 {
 *(ExtFlashSection ExtFlashSection.*)
 *(.gnu.linkonce.r.*)
 . = ALIGN(0x4);
 } >OSPI
}

 

 

 

1 reply

Semer CHERNI
ST Employee
April 10, 2025

Hello @Garnett.Robert 

First let me thank you for posting.

I tested the linker file you shared and I got link error.
However, I made the test with the latest TouchGFX and it works fine. The bug in the linker file was fixed.

BR,
Semer.

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.