cancel
Showing results for 
Search instead for 
Did you mean: 

Complie internal memory only issue

Almed
Associate

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?

1 REPLY 1
JohanAstrup
ST Employee

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