Skip to main content
Associate
February 19, 2025
Question

TouchGFX build errors

  • February 19, 2025
  • 6 replies
  • 2244 views

I am new to MCUs in general and now I am working with a riverdi rvt70hssfwca0. My issue atm is that I am trying to run the stimulator on TouchGFX before I can further work on the main issue but it showing the following errors:

TTH_1-1739957506856.png

while there is no building error when I build it on STM32CudeIDE. I have tried many solutions suggestion I found online but nothing seems to work. Any tips would be appreciated!

    This topic has been closed for replies.

    6 replies

    GaetanGodart
    ST Employee
    February 19, 2025

    Hello @TTH and welcome to the ST community!

     

    The error states that it failed something in Model.o.
    Specifically, it mentions

    #include "main_model.h"

    I don't think there is a file that should be called main_model.

    Can you check the beginning of your Model.c file and try to locate where they say #include "main_model.h".
    Check if it say #include "Model.h".
    If you don't see #include "Model.h", add it manually.

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    TTHAuthor
    Associate
    February 20, 2025

    Hello @GaetanGodart. Thank you for you reply. I am not aware of many details since I didn't start this project myself but from what I am seeing I am assuming the main_model.h was most probably manually added. If i remove it from Model.cpp I get a lot of error since contains a lot of necessary functions. There is a Model.hpp file as well which was included here.

    TTH_0-1740046118180.png

    Another thing I have noticed is that the model.o file is missing so is model.c. Is that normal? 

    Best Regards

     

    GaetanGodart
    ST Employee
    February 24, 2025

    Hello @TTH ,

     

    It is not normal to not have a Model.cpp but your project is not normal.

    It seems that your are trying to use TouchGFX (based on the screenshot), Designer to build. Since you (or your previous colleague) added a file to the project, it needs to be added in the Makefile for the compilation to work since you include the file.

    Perhaps your colleague used another toolchain to compile the project, is there anything about STM32CubeIDE, Keil or IAR mentioned somewhere in your project?

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    TTHAuthor
    Associate
    February 27, 2025

    Dear @GaetanGodart , 

    upon further research I also came to the conclusion that the issue is that as you mentioned the STM32CubeIDE and TouchGFX do not share the include paths and that's what is causing the error on the designer. When i just add the path to main_model.h the designer can't seem to find the STM32H7xx_HAL path. Next I added the path to STM32H7xx_HAL and now Touchgfx can't seem to find main_model.h again. You can see my makefile below. Can you please tell me what am I doing wrong?

    # Helper macros to convert spaces into question marks and back again 
    e := 
    sp := $(e) $(e)
    qs = $(subst ?,$(sp),$1)
    sq = $(subst $(sp),?,$1)
    
    # Get name of this Makefile (avoid getting word 0 and a starting space)
    makefile_name := $(wordlist 1,1000,$(MAKEFILE_LIST))
    
    # Get path of this Makefile
    makefile_path := $(call qs,$(dir $(call sq,$(abspath $(call sq,$(makefile_name))))))
    
    # Get path where the Application is
    application_path := $(call qs,$(abspath $(call sq,$(makefile_path)../..)))
    
    # Define the new include paths
    Core_Inc_Path := C:/Users/Tahrima/Desktop/CHG300_uC-Software_HT-01_00/CM7/Core/Inc
    STM32_HAL_Path := C:/Users/Tahrima/Desktop/CHG300_uC-Software_HT-01_00/CM7/Drivers/STM32H7xx_HAL_Driver/Inc
    
    # Ensure no spaces in paths
    .PHONY: clean assets all
    
    ifneq ($(words $(makefile_path))$(words $(MAKEFILE_LIST)),11)
    all clean assets:
    $(error Spaces not allowed in path)
    else
    
    # Define and export additional paths and sources
    ADDITIONAL_SOURCES := 
    ADDITIONAL_INCLUDE_PATHS := $(Core_Inc_Path) $(STM32_HAL_Path) 
    ADDITIONAL_LIBRARY_PATHS := 
    ADDITIONAL_LIBRARIES :=
    
    # Export the variables for Makefile usage
    export ADDITIONAL_SOURCES ADDITIONAL_INCLUDE_PATHS ADDITIONAL_LIBRARY_PATHS ADDITIONAL_LIBRARIES
    
    # Ensure the compiler knows about the STM32 HAL include path
    CFLAGS += -I$(Core_Inc_Path) -I$(STM32_HAL_Path)
    
    # Fix for Windows paths in MinGW
    ADDITIONAL_INCLUDE_PATHS := $(addprefix -I,$(subst \,/,$(subst C:/,C:$(shell cygpath -w C:/),$(ADDITIONAL_INCLUDE_PATHS))))
    
    # Targets for all, clean, and assets
    all: $(filter assets,$(MAKECMDGOALS))
    all assets: $(filter clean,$(MAKECMDGOALS))
    all clean assets:
    	@$(MAKE) -r -f generated/simulator/gcc/Makefile -s $(MFLAGS) $@ -C "$(application_path)"
    
    
    endif