Skip to main content
Associate
January 1, 2026
Solved

Complie internal memory only issue

  • January 1, 2026
  • 2 replies
  • 359 views

Hey, our team is working with TouchGFX Designer (4.19.1) and IAR IDE.

TouchGFX assets include 50 MB of images, videos, fonts and texts.
We are trying to find a way to change the app without touching and flashing TouchGFX assets.
The TouchGFX should stay constant while only the app code itself changes.
Meaning compiling the code without compiling TouchGFX assets again to get a smaller hex file to flash/store, and current TouchGFX assets that are stored in the external memory will work, so basically we want to exclude all TextFlashSection, ExtFlashSection and FontFlashSection files from compilation.

The main goal is to store a backup version of the code inside the internal flash for cases of software updates, so we want to compile only the app code.

Is it related to the linker file or some other configuration file?

Best answer by Almed

Hey,
Yes.. Right now we're going to try to update touchGFX from version 4.19.1 to version 4.26.0 but gradually, updating each new version, regenerating code from CUBEMX and touchGFX. 
We want to create an A\B solution for Internal and External flash for further updates. 

 

 

2 replies

ST Employee
January 5, 2026

Hello @Almed.

Starting from TouchGFX 4.23.0, the relevant TBSs available in TouchGFX Designer support flashing only the internal flash memory when pressing Run Target. I believe you can use a similar approach.
The following example from the STM32U5G9J-DK2 TBS shows how we split the sections into separate executables.

$(binary_output_path)/$(target_executable): $(object_files) $(object_asm_files) $(object_upper_s_files)
	@echo Video Objects: $(video_object_files)
	@echo Linking $(@)
	@mkdir -p $(@D)
	@mkdir -p $(object_output_path)
	@$(file >$(build_root_path)/objects.tmp) $(foreach F,$(object_files) $(video_object_files),$(file >>$(build_root_path)/objects.tmp,$F))
	@$(linker) \
		$(linker_options) -T $(makefile_path_relative)/../STM32U5G9xx_FLASH.ld -Wl,-Map=$(@D)/application.map $(linker_options_local) \
		$(patsubst %,-L%,$(library_include_paths)) \
		@$(build_root_path)/objects.tmp $(object_asm_files) -o $@ \
		-Wl,--start-group $(patsubst %,-l%,$(libraries)) -Wl,--end-group
	@rm -f $(build_root_path)/objects.tmp
	@echo "Producing additional output formats..."
	@echo " target.hex - Combined internal+external hex"
	@$(objcopy) -O ihex $@ $(@D)/target.hex
	@echo " intflash.elf - Internal flash, elf debug"
	@$(objcopy) --remove-section=ExtFlashSection $@ $(@D)/intflash.elf 2>/dev/null
	@echo " intflash.hex - Internal flash, hex"
	@$(objcopy) -O ihex --remove-section=ExtFlashSection $@ $(@D)/intflash.hex
	@echo " extflash.bin - External flash, binary"
	@$(objcopy) -O binary --only-section=ExtFlashSection $@ $(@D)/extflash.bin

The sections (e.g. ExtFlashSection) are defined in the linker script.

Best regards,
Johan

ST Employee
January 23, 2026

Hello @Almed.

Have you been able to make any progress?

Best regards,
Johan

AlmedAuthorBest answer
Associate
January 23, 2026

Hey,
Yes.. Right now we're going to try to update touchGFX from version 4.19.1 to version 4.26.0 but gradually, updating each new version, regenerating code from CUBEMX and touchGFX. 
We want to create an A\B solution for Internal and External flash for further updates.