Prerequisites
TouchGFX is primarily developed for use on Windows 10. The TouchGFX Designer is only running on Windows, but the underlying tools also runs on Linux.
Using TouchGFX on Windows
Starting from version 4.18 TouchGFX only runs on Windows 10 or later.
TouchGFX comes with all the basic tools required for development. You don't need to install a C++ compiler, since TouchGFX is bundled with g++.
See the Installation articles for instruction on installation of TouchGFX and extra tools for flashing code.
Tip
Using TouchGFX on Linux
TouchGFX can also be used on Linux, and even though the TouchGFX Designer cannot be run natively on Linux, the code generate by the TouchGFX Designer works on both Linux and Windows.
The sugested solution to this is to run the TouchGFX Designer in a virtual machine running Windows. This allows the developer to use the Designer when needed, and use the normal Linux environment anywhere else.
A few extra tools and libraries are required to use TouchGFX on Linux. The next section gives instructions for Ubuntu. The requirements will be similar for other Linux distributions.
Using TouchGFX on Ubuntu 20.04
Before you can use the TouchGFX tools in a fresh Ubuntu 20.04 LTS you need to install the following:
First install ruby: the command is
sudo apt install ruby
This will give you a ruby version 2.7. TouchGFX for Windows includes version 3.0, but that version is currently not available in the Ubuntu repositories. Version 2.7 should work fine for normal use.
Next install the "roo" gem:
sudo gem install roo
Install make and g++ to allow compilation of C++ programs:
sudo apt install make g++
The last part is SDL2 libraries and header files:
sudo apt install libsdl2-dev libsdl2-image-dev
The default g++ version is 9.3.0. This version uses a warning level different from the g++ for Windows included in TouchGFX. Two changes must be made to the g++ flags and linker flags for the simulator:
config/gcc/app.mk
# Copyright (c) 2018(-2021) STMicroelectronics.
# All rights reserved.
#
# This file is part of the TouchGFX 4.18.1 distribution.
#
# This software is licensed under terms that can be found in the LICENSE file in
# the root directory of this software component.
# If no LICENSE file comes with this software, it is provided AS-IS.
#
###############################################################################/
# Relative location of the TouchGFX framework from root of application
touchgfx_path := ../../../touchgfx
# Optional additional compiler flags
user_cflags := -DUSE_BPP=16 -Wformat-truncation=0
linker_options := -no-pie
Linux ruby will give you a warning because the TouchGFX files are using Windows line endings:
ruby: warning: shebang line ending with \r may cause problems
This warning can be removed by changing two files to Unix line endings
(or by removing the entire first line starting with #!
):
dos2unix touchgfx/framework/tools/textconvert/main.rb
dos2unix touchgfx/framework/tools/videoconvert/videoconvert.rb