2024-09-01 11:03 PM
Hi,
STM32CubeIDE- 1.13.2
TouchGFX - 4.24.0
STM32F423ZHT6 evaluation board has lack of LTDC and DMA2D compare to other STM32F4 series. I want to turn on the LCD panel (NHD-2.8-240320AF-CSXP-FCTP-ND) and it display the white background. Can any one please guide me? How to do it.
Solved! Go to Solution.
2024-09-02 02:46 AM
Hello @Marudhupandian ,
TouchGFX allows for a simple and quick control of a screen thanks to its framework but it is not plug and play for all boards.
For a few STM32F4 we have made a TBS (TouchGFX Board Setup) that allows those board to be plug and play but this is not available for the STM32F423HT6.
This means that you have to create your TBS yourself, basically giving TouchGFX the information about your board speed, communication protocol, screen technology, etc.
You can find how to make a TBS in our documentation : board-introduction
Furthermore, you can check the other F4 series TBS by opening TouchGFX Designer, clicking on "Create new" and typing "f4" to see al the available TBS for F4 series boards:
You can also check some videos, here is a complete but long one : How to integrate TouchGFX in a custom board
I hope this helps. :smiling_face_with_smiling_eyes:
If this message answer your question, I invite you to select it as "best answer".
Regards,
2024-09-02 02:46 AM
Hello @Marudhupandian ,
TouchGFX allows for a simple and quick control of a screen thanks to its framework but it is not plug and play for all boards.
For a few STM32F4 we have made a TBS (TouchGFX Board Setup) that allows those board to be plug and play but this is not available for the STM32F423HT6.
This means that you have to create your TBS yourself, basically giving TouchGFX the information about your board speed, communication protocol, screen technology, etc.
You can find how to make a TBS in our documentation : board-introduction
Furthermore, you can check the other F4 series TBS by opening TouchGFX Designer, clicking on "Create new" and typing "f4" to see al the available TBS for F4 series boards:
You can also check some videos, here is a complete but long one : How to integrate TouchGFX in a custom board
I hope this helps. :smiling_face_with_smiling_eyes:
If this message answer your question, I invite you to select it as "best answer".
Regards,
2024-09-02 04:45 AM
Thanks for your quick reply @GaetanGodart
I already watched that video https://youtu.be/SRQD8JMeg_k?si=oWqNTiEddbzsl_pj
Here, STM32F413ZHT6 does not have LTDC. So I'm using FSMC as a LCD interface.
I create a TouchGFX project via STM32CubeIDE-> TouchGFX-> ApplicationTemplate.touchgfx.part
Then I created an example project.
Then I run a TouchGFX project and refresh it. After compile successfully. In between that where I put a LCD initialization code?
2024-09-02 04:52 AM
When I enter the Program and run target. I got failed message.
Like:
Program and Run Target
Generate
Done
Generate Assets
make -f simulator/gcc/Makefile assets -j8
Reading ./application.config
Reading ./target.config
Done
Post Generate
touchgfx update_project --project-file=simulator/msvs/Application.vcxproj
Done
Post Generate Target
touchgfx update_project
Writing STM32CubeIDE project file: ../.cproject
Done
Compile
make -f ../gcc/Makefile -j8
make: ../gcc/Makefile: No such file or directory
make: *** No rule to make target '../gcc/Makefile'. Stop.
Failed
Failed
2024-09-02 05:01 AM
No problem! :smiling_face_with_smiling_eyes:
The error happens during compilation.
Apparently, there is no Makefile.
Can you check that you have a Makefile in the gcc fodler?
If you don't, you should create one (you can get very inspired by the ones we created for boards similar to yours).
Regards,
2024-09-02 05:06 AM
This is my make file;
2024-09-02 06:32 AM
This make file seems to only be good to run the simulator as it seems to call "make generated/simulator/gcc/Makefile".
I could be wrong though.
Do you have a Mafekile in generated/simulator/gcc?
2024-09-02 09:44 PM
Yes, I've Makefile in generated/simulator/gcc
# Get identification of this system
ifeq ($(OS),Windows_NT)
UNAME := MINGW32_NT-6.2
else
UNAME := $(shell uname -s)
endif
board_name := $(UNAME)
.PHONY: all clean assets
# Directories containing application-specific source and header files.
# Additional components can be added to this list. make will look for
# source files recursively in comp_name/src and setup an include directive
# for comp_name/include.
components := gui simulator generated/gui_generated generated/simulator
# Location of folder containing bmp/png files.
asset_images_input := assets/images
# Location of folder to search for ttf font files
asset_fonts_input := assets/fonts
# Location of folder where the texts.xml is placed
asset_texts_input := assets/texts
# Location of folder where video files are places
asset_videos_input := assets/videos
build_root_path := build
object_output_path := $(build_root_path)/$(board_name)
binary_output_path := $(build_root_path)/bin
# Location of output folders where autogenerated code from assets is placed
asset_root_path := generated
asset_images_output := $(asset_root_path)/images
asset_fonts_output := $(asset_root_path)/fonts
asset_texts_output := $(asset_root_path)/texts
asset_videos_output := $(asset_root_path)/videos
#include application specific configuration
include config/gcc/app.mk
### END OF USER SECTION. THE FOLLOWING SHOULD NOT BE MODIFIED ###
ifeq ($(UNAME), Linux)
library_path := $(touchgfx_path)/3rdparty/libjpeg/lib/linux $(touchgfx_path)/lib/linux $(ADDITIONAL_LIBRARY_PATHS)
libraries := touchgfx SDL2 SDL2_image jpeg rt m pthread dl $(ADDITIONAL_LIBRARIES)
libstart := -Wl,--start-group
libend := -Wl,--end-group
libextra :=
library_includes += $(touchgfx_path)/3rdparty/libjpeg/include
linker_options_local := -Xlinker -rpath -Xlinker $(touchgfx_path)/3rdparty/libjpeg/lib/linux
resource_file :=
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/linux/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/linux/fontconvert.out
simulator_executable := simulator.out
linker_options += -static-libgcc -Xlinker --no-as-needed
else
sdl_library_path := $(touchgfx_path)/lib/sdl2/win32
jpeg_library_path := $(touchgfx_path)/3rdparty/libjpeg/lib/win32
library_path := $(sdl_library_path) $(jpeg_library_path) $(touchgfx_path)/lib/win/mingw32 $(ADDITIONAL_LIBRARY_PATHS)
libraries := touchgfx SDL2 SDL2_image jpeg-8 m pthread mingw32 $(ADDITIONAL_LIBRARIES)
libstart := -Wl,--start-group
libend := -Wl,--end-group
libextra := -Wl,--subsystem,windows
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl2/vendor $(touchgfx_path)/3rdparty/libjpeg/include
resource_file := generated/simulator/touchgfx.res
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/win/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/win/fontconvert.out
simulator_executable := simulator.exe
$(resource_file): $(resource_file:%.res=%.rc) $(resource_file:%.res=%.ico)
@echo Creating Windows resource file with program icon
@windres $(resource_file:%.res=%.rc) -O coff -o $@
linker_options += -static-libgcc -static-libstdc++
endif
c_compiler := g++
c_compiler_options += -DSIMULATOR='' -g
cpp_compiler := g++
cpp_compiler_options += -g -DSIMULATOR='' -DENABLE_LOG
linker := g++
WARN = error all extra write-strings init-self cast-qual \
pointer-arith strict-aliasing format=2 uninitialized \
missing-declarations no-long-long no-unused-parameter \
no-variadic-macros no-format-extra-args \
no-conversion no-overloaded-virtual
CXXWARN = non-virtual-dtor ctor-dtor-privacy
c_compiler_options_local += -pedantic $(addprefix -W,$(WARN))
cpp_compiler_options_local += -pedantic $(addprefix -W,$(WARN) $(CXXWARN))
#include everything + specific vendor folders
framework_includes := $(touchgfx_path)/framework/include
#only take in the source we want to build for this sim
framework_files := $(touchgfx_path)/framework/source/platform/driver/touch/SDL2TouchController.cpp
framework_source := $(touchgfx_path)/framework/source/platform/hal/simulator/sdl2
#this needs to change when assset include folder changes.
all_components := $(components) \
$(asset_fonts_output) \
$(asset_images_output) \
$(asset_texts_output) \
$(asset_videos_output)
#keep framework include and source out of this
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes) $(ADDITIONAL_INCLUDE_PATHS)
source_paths = $(foreach comp, $(all_components), $(comp)/src) $(framework_source) simulator
# Finds files that matches the specified pattern. The directory list
# is searched recursively. It is safe to invoke this function with an
# empty list of directories.
#
# Param $(1): List of directories to search
# Param $(2): The file pattern to search for
define find
$(foreach dir,$(1),$(foreach d,$(wildcard $(dir)/*),\
$(call find,$(d),$(2))) $(wildcard $(dir)/$(strip $(2))))
endef
unexport find
fontconvert_ttf_lower_files := $(call find, $(asset_fonts_input), *.ttf)
fontconvert_ttf_upper_files := $(call find, $(asset_fonts_input), *.TTF)
fontconvert_otf_lower_files := $(call find, $(asset_fonts_input), *.otf)
fontconvert_otf_upper_files := $(call find, $(asset_fonts_input), *.OTF)
fontconvert_bdf_lower_files := $(call find, $(asset_fonts_input), *.bdf)
fontconvert_bdf_upper_files := $(call find, $(asset_fonts_input), *.BDF)
fontconvert_font_files := $(fontconvert_ttf_lower_files) \
$(fontconvert_ttf_upper_files) \
$(fontconvert_otf_lower_files) \
$(fontconvert_otf_upper_files) \
$(fontconvert_bdf_lower_files) \
$(fontconvert_bdf_upper_files)
source_files := $(call find, $(source_paths),*.cpp) $(framework_files) $(ADDITIONAL_SOURCES)
c_source_files := $(call find, $(source_paths),*.c)
object_files := $(source_files:$(touchgfx_path)/%.cpp=$(object_output_path)/touchgfx/%.o) $(c_source_files:$(touchgfx_path)/%.c=$(object_output_path)/touchgfx/%.o)
object_files := $(object_files:%.cpp=$(object_output_path)/%.o)
object_files := $(object_files:%.c=$(object_output_path)/%.o)
dependency_files := $(object_files:%.o=%.d)
textconvert_script_path := $(touchgfx_path)/framework/tools/textconvert
videoconvert_script_path := $(touchgfx_path)/framework/tools/videoconvert
text_database := $(asset_texts_input)/texts.xml
.PHONY: all clean assets generate_assets build_executable
all: generate_assets
generate_assets: assets
@$(MAKE) -f generated/simulator/gcc/Makefile -r -s $(MFLAGS) build_executable
build_executable: $(binary_output_path)/$(simulator_executable) post_build
$(binary_output_path)/$(simulator_executable): $(object_files) $(resource_file)
@echo Linking $(@)
@mkdir -p $(@D)
@mkdir -p $(object_output_path)
@$(file >$(build_root_path)/objects.tmp) $(foreach F,$(object_files),$(file >>$(build_root_path)/objects.tmp,$F))
@$(linker) \
$(linker_options) $(linker_options_local) \
$(patsubst %,-L%,$(library_path)) \
@$(build_root_path)/objects.tmp -o $@ $(resource_file) \
$(libstart) $(patsubst %,-l%,$(libraries)) $(libend) $(libextra)
@rm -f $(build_root_path)/objects.tmp
# Remove old images
@rm -f $(binary_output_path)/*.bin
@if ls $(asset_videos_output)/bin/*.bin >/dev/null 2>&1; then cp $(asset_videos_output)/bin/*.bin $(binary_output_path); fi
ifneq ($(UNAME), Linux)
@if [ ! -f $(binary_output_path)/SDL2.dll ]; then cp $(sdl_library_path)/SDL2.dll $(binary_output_path); fi
@if [ ! -f $(binary_output_path)/SDL2_image.dll ]; then cp $(sdl_library_path)/SDL2_image.dll $(binary_output_path); fi
@if [ ! -f $(binary_output_path)/libpng16-16.dll ]; then cp $(sdl_library_path)/libpng16-16.dll $(binary_output_path); fi
@if [ ! -f $(binary_output_path)/zlib1.dll ]; then cp $(sdl_library_path)/zlib1.dll $(binary_output_path); fi
@if [ ! -f $(binary_output_path)/libjpeg-8.dll ]; then cp $(jpeg_library_path)/libjpeg-8.dll $(binary_output_path); fi
endif
.PHONY: post_build
post_build:
@mkdir -p $(binary_output_path)
@if [ -f simulator/landscape.png ]; then cp simulator/landscape.png $(binary_output_path); else rm -f $(binary_output_path)/landscape.png; fi
@if [ -f simulator/portrait.png ]; then cp simulator/portrait.png $(binary_output_path); else rm -f $(binary_output_path)/portrait.png; fi
$(object_output_path)/touchgfx/%.o: $(touchgfx_path)/%.cpp config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.cpp config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.c config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(c_compiler) \
-MMD -MP $(c_compiler_options) $(c_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
ifeq ($(MAKECMDGOALS),build_executable)
$(firstword $(dependency_files)): config/gcc/app.mk
@rm -rf $(object_output_path)
-include $(dependency_files)
endif
assets: images texts videos
.PHONY: images
images:
@$(imageconvert_executable) -r $(asset_images_input) -w $(asset_images_output)
.PHONY: texts
texts:
@ruby $(textconvert_script_path)/main.rb $(text_database) $(fontconvert_executable) $(asset_fonts_output) $(asset_texts_output) $(asset_fonts_input) .
.PHONY: videos
videos:
@ruby $(videoconvert_script_path)/videoconvert.rb $(asset_videos_input) $(asset_videos_output)
clean:
@echo Cleaning
@rm -rf $(build_root_path)
# Do not remove gui_generated
@rm -rf $(asset_images_output)
@rm -rf $(asset_fonts_output)
@rm -rf $(asset_texts_output)
@rm -rf $(asset_videos_output)
# Create directory to avoid error if it does not exist
@mkdir -p $(asset_root_path)
# Remove assets folder if it is empty (i.e. no gui_generated folder)
@rmdir --ignore-fail-on-non-empty $(asset_root_path)
2024-09-03 01:30 AM
Hello @Marudhupandian ,
Are you sure that you have a gcc folder and a Makefile in it?
When I look at your screenshots, I see that you have the TouchGFX folder but I do not see the gcc folder.
The TouchGFX and gcc folder should be at the same level :
Can you double check that please?
Regards,
2024-09-03 03:06 AM
You are correct. I don't have gcc file. How to make gcc file.
What is the next step to complete my project? How can I do to turn on my LCD display?