This section discusses compiler support for the targets supported by TouchGFX. Currently, the following three compilers are supported for Cortex-M3, Cortex-M4F and Cortex-M7:
- IAR C/C++ Compiler for ARM (IAR Embedded Workbench for ARM)
- Keil C/C++ Compiler for ARM (uVision 4 and 5 IDE)
- GNU GCC Compiler for ARM
By inspecting the structure of the
target/ folder for any application in the TouchGFX distribution, one can learn about the type of targets and compilers the application in question is intended to support. I.e. if an application was designed for a 4.3” display, any targets with 7.0” displays would typically not be represented here since applications are usually designed for a specific resolution.
app/template/EmptyApplication is an empty application shell that contains build configurations for every target and compiler supported by TouchGFX. Below we see the contents of the
EmbeddedArtists/LPC4357DevKit folder from the TouchGFX distribution.
+-- target | +-- EmbeddedArtists/LPC4357DevKit | | +-- gcc | | \-- IAR | | \-- Keil | +-- FDI | +-- Mjolner | \-- ST
IAR project file (
.ewp ) in the TouchGFX distribution makes a reference to a flash loader configuration (
.board file at the same level) for the specific target it is designed for, specifying a pass for each type of flash to program. Not all
.board files specify passes for both internal and external flash for one of the following reasons:
- Target has no external flash.
- No IAR flash loader for external flash exists. Refer to Overview: Boards and Flash loaders for alternative ways of programming targets.
Note: For ST targets specifically, projects that do not support programming the external flash, an additional build step is enabled that converts the application binary to Intel Extended
.hexfile format. This
.hexfile can then be programmed onto your board using ST-Link, as detailed in this article.
To deploy an application attach a debugger supported by IAR to the target hardware and configure the debugger in the projects configuration. Ctrl+D compiles the project source code, downloads the resulting binaries and starts a debug-session.
Note: Unlike Keil projects, and since the IAR flash loader configuration is detached into it’s own file, the type of debugger in IAR can be freely changed without having to update the flash loader configuration .
Most IAR Embedded Workbench for ARM projects in the TouchGFX distribution were created using version 6.60/6.70. IAR projects for Cortex-M7 based targets (
STM32756G-EVAL) were created using IAR 7.40 for its ST STM32F756 support. Up until version 7.20, IAR projects in TouchGFX were version compatible. Should one try to open an IAR 6.60 project with version 7.40, the following error occurs. Among broken options are device type (STM32F756 is unknown) and debugger settings.
This section discusses support for the Keil uVision IDE in TouchGFX. For the majority of boards, Keil projects (be it uVision 4 or 5) offer full flash loader support for both internal and external flash. For a select few boards, however, external flash loader support is not available from within Keil uVision.
Note: Please see the Overview: Boards And Flash Loaders table for specifics on how to deploy application to your board.
Keil projects for Cortex-M7 based targets (
STM32756G-EVAL) are based on Keil uVision 5. Project files based on the new
.uvprojx format are not compatible with Keil uVision 4. When one, illegally, attempts to open an
.uvprojx Keil 4, the following error occurs:
Opening a keil 4 project (
.uvproj) with Keil 5 is allowed but produces the following prompt to migrate to the new format or to install legacy support.
Deploying applications with Keil uVision IDE
Keil projects in the TouchGFX distribution are based on a mix between Keil uVision4 (
.uvproj) and uVision5 (
.uvprojx), all with preconfigured settings for flashing both internal and external flash. As with IAR, you will find a uVision project in the target folder for a given application (I.e.
To deploy an example on an evaluation board, simply open the uVision project file, pressF7 to compile the code and press the “Load” button afterwards (F8 in uVision5). You will then need to either start a debugging session from within uVision or simply power cycle the target to get the application running.
The Keil projects are preconfigured to use either the J-Link or ST-Link debugger. This setting can be changed in project options, as shown below. Please note that in uVision (both 4 and 5), flash programming algorithms are generally tied to a specific debugger and if you change the debugger setting actively, you will also need to (re)configure the flash programming algorithms. The image below shows the flashloader settings for an NXP based board (
LPC4357DevKit from EmbeddedArtists) with a 4MB external flash, using J-Link with ~10kb RAM allocated for the flash algorithm.
Note: For ST targets specifically, projects that do not support programming the external flash, an additional build step is enabled that converts the application binary into an ‘.axf’ file format using the
fromelfimage converter from the ARM toolchain. This
.axffile can then be programmed onto your board using ST-Link, as detailed inthis article.
The MinGW development environment for Windows (See this lesson for installation instructions) comes with a pre-installed version of the GNU GCC compiler suite for ARM processors. Those who do not plan on using the TouchGFX development environment can download the GCC compiler suite here. The version used by TouchGFX is currently
To build an application using this compiler, for i.e. the
STM32F746G-DISCO board, navigate to an application that supports this target (i.e.
app/example/button_example) and execute the following command:
$ make -f target/ST/STM32F746G-DISCO/gcc/Makefile
build/bin folder now contains the following files:
Note: The build process outputs seperate binaries for internal and external flash, but also outputs a combined binary (
target.elf) if you have access to a tool that can flash both internal and external flash from a single
.elffile. While you may use whatever tools you wish, we suggest that you follow the methods suggested in this article.