{"id":4205,"date":"2021-03-23T20:00:06","date_gmt":"2021-03-23T19:00:06","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4205"},"modified":"2025-12-27T16:03:25","modified_gmt":"2025-12-27T15:03:25","slug":"first-steps-with-touchgfx-on-stm32-and-a-dedicated-shield","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/first-steps-with-touchgfx-on-stm32-and-a-dedicated-shield\/","title":{"rendered":"First steps with TouchGFX on STM32 and a dedicated shield"},"content":{"rendered":"\n<p>Doing graphics on microcontrollers is always a huge challenge. Even more so if it\u2019s supposed to look nice. For years we\u2019ve known simple so\u2011called GFX libraries that let us draw bitmaps or various fonts. However, that\u2019s not enough, because often our GUI still looks like it came from 1990s devices, or even worse. TouchGFX comes to the rescue!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">TouchGFX on STM32<\/h1>\n\n\n\n<p>What is this mysterious TouchGFX? According to the manufacturer, it\u2019s an advanced software graphics framework optimized for STM32. That wording sounds a bit complicated. What does it mean in simple terms?<\/p>\n\n\n\n<p>I would say that TouchGFX is essentially a graphics engine for microcontrollers. It uses STM32 microcontroller resources such as the Chrom-ART\u2122 accelerator to efficiently manage what happens on the display.<\/p>\n\n\n\n<p>TouchGFX includes TouchGFX Designer. It is WYSIWYG software (hard word, huh?) that allows us to design the entire graphical look of our application.<\/p>\n\n\n\n<p>Not only the look, but also animations, transitions between screens, and behavior when touching the touchscreen panel or pressing defined buttons.<\/p>\n\n\n\n<p>In this Designer we create the entire GUI, which in terms of appearance is no different from modern creations. It\u2019s said that TouchGFX lets us generate smartphone-like GUIs. Just see for yourself.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_promo.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"426\" height=\"222\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_promo.jpg\" alt=\"\" class=\"wp-image-1856\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_promo.jpg 426w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_promo-300x156.jpg 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>It looks pretty nice, doesn\u2019t it? Wait until you see how it works \ud83d\ude42<\/p>\n\n\n\n<p>I\u2019ll write about how the whole TouchGFX works in the next articles. Today I\u2019ll focus on running it for the first time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Demo platform<\/h2>\n\n\n\n<p>ST Microelectronics being ST Microelectronics \u2014 they provide ready-made and easy (we\u2019ll see about that) demo programs to run. The same is true for TouchGFX.<\/p>\n\n\n\n<p>You can run the demos, for example, on <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-discovery\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">STM32 Discovery<\/a> kits with a display. However, today I\u2019ll use another option. Recently ST released a <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/shield-touchgfx-do-stm32-nucleo-x-nucleo-gfx01m1\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">dedicated TouchGFX shield<\/a> for <a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-nucleo\/stm-nucleo-64\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">Nucleo-64<\/a> boards.<\/p>\n\n\n\n<p><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/shield-touchgfx-do-stm32-nucleo-x-nucleo-gfx01m1\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">This shield<\/a> is meant to show that TouchGFX can also be used on smaller microcontrollers that don\u2019t have many resources like e.g. RAM.<\/p>\n\n\n\n<p>RAM is very much needed with displays. It\u2019s where all graphics are drawn using buffering. If we don\u2019t have enough RAM, then what?<\/p>\n\n\n\n<p>TouchGFX supports partial buffering and that\u2019s exactly what the demo uses for the <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/nucleo-g071rb\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">NUCLEO-G071RB<\/a> combined with the <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/shield-touchgfx-do-stm32-nucleo-x-nucleo-gfx01m1\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">X-NUCLEO-GFX01M1 shield<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/zestaw-touchgfx-z-nucleo\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">You can buy a ready-made set in my store. It\u2019s cheaper as a bundle.<\/a><br><\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/zestaw-touchgfx-z-nucleo\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=touchgfx1\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"400\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/TouchGFX-baner.jpg\" alt=\"touch gfx banner\" class=\"wp-image-1857\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/TouchGFX-baner.jpg 1200w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/TouchGFX-baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/TouchGFX-baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/TouchGFX-baner-768x256.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Let\u2019s run the demo program<\/h2>\n\n\n\n<p>So let\u2019s move on to waking TouchGFX up for the first time. It would be nice to see it come alive.<\/p>\n\n\n\n<p>ST has prepared easy-to-run (well\u2026 let\u2019s say) example projects here. However, we need the TouchGFX Designer program.<\/p>\n\n\n\n<p>Starting from version 4.16.0, this program no longer exists as a separate entity. It was pulled into the Cube extension <a href=\"https:\/\/www.st.com\/en\/embedded-software\/x-cube-touchgfx.html\" target=\"_blank\" rel=\"noopener\">X-CUBE-TOUCHGFX<\/a>. It\u2019s like a plugin for Cube that makes it easier to integrate a TouchGFX project with a Cube project.<\/p>\n\n\n\n<p>You can download and unpack it, or you can install it using Cube itself. I recommend installing it from within Cube, because you\u2019ll need it there anyway. However, you need to know where on your computer you have the repository of libraries for Cube.<\/p>\n\n\n\n<p>After installing it, you\u2019ll need to find the TouchGFX Designer installer in it under the path (Windows) <strong>&lt;Repository&gt;\\Packs\\STMicroelectronics\\X-CUBE-TOUCHGFX\\&lt;version&gt;\\Utilities\\PC_Software\\TouchGFXDesigner<\/strong><\/p>\n\n\n\n<p>A terribly complicated path! As if they couldn\u2019t keep providing the installer separately.<\/p>\n\n\n\n<p>There is an installer there, so install the program and we move on. Launch the installed TouchGFX Designer. You\u2019ll get a welcome window like this.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny-1024x555.jpg\" alt=\"\" class=\"wp-image-1860\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny-1024x555.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny-300x163.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny-768x416.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_ekran_powitalny.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>This is the screen for creating a new project. You choose an application template (the hardware it is to run on), and a UI template, i.e. the look. This time we won\u2019t use that. At the top you have a tab like Online Applications. That\u2019s where the demo programs for ST eval boards are, downloaded from the Internet. We go there.<\/p>\n\n\n\n<p>Now you only have Online Application to choose from. Enter it and find the appropriate demo. In the case of <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/nucleo-g071rb\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">NUCLEO-G071RB<\/a> with the <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/shield-touchgfx-do-stm32-nucleo-x-nucleo-gfx01m1\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">X-NUCLEO-GFX01M1 shield<\/a> it will look like below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema-1024x556.jpg\" alt=\"\" class=\"wp-image-1862\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema-1024x556.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema-300x163.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema-768x417.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_wybor_dema.jpg 1204w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Click Select. You still need to provide the application name and the path for the project. Here you have freedom \ud83d\ude42 I wouldn\u2019t recommend Polish characters, though, because they are not handled well by CubeIDE and the compiler.<\/p>\n\n\n\n<p>Once you have everything, click Create.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project-1024x556.jpg\" alt=\"\" class=\"wp-image-1863\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project-1024x556.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project-300x163.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project-768x417.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_create_project.jpg 1197w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>At this moment our demo application is being pulled from the ST repository. After that you\u2019ll see the Designer screen.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen-1024x555.jpg\" alt=\"\" class=\"wp-image-1864\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen-1024x555.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen-300x163.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen-768x416.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen-1536x832.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_designer_screen.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>What you\u2019re looking at is something we\u2019ll deal with another time. There are tons of features here that, even on the day I\u2019m writing this article, I have no idea about.<\/p>\n\n\n\n<p>You can look around this program. You\u2019ll find, for example, all the images that the demo GUI uses as well as the texts. The main \u201cworkhorse\u201d is the first screen called Canvas, though.<\/p>\n\n\n\n<p>It\u2019s exactly where you design the entire look of your application. We\u2019ll get to know it intensively. I can\u2019t wait myself \ud83d\ude09<\/p>\n\n\n\n<p>Alright, but our goal is simply to run the example. On the top right you have 3 buttons.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Run Simulator \u2014 runs the simulator of your TouchGFX project. You can test the GUI without flashing it to the microcontroller. Great stuff. In our case there is one problem. We use a joystick on the <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/shield-touchgfx-do-stm32-nucleo-x-nucleo-gfx01m1\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">Shield<\/a> for navigation, so we have no way to move around in the simulator. It will work great in applications with a touchscreen panel.<\/li>\n\n\n\n<li>Run Target \u2014 I haven\u2019t managed to run this yet. It should work so that we run the project directly from TouchGFX Designer on our evaluation kit.<\/li>\n\n\n\n<li>Generate Code \u2014 this is what we\u2019re interested in right now. TouchGFX should generate a complete project for CubeIDE, which can then be imported.<\/li>\n<\/ol>\n\n\n\n<p>So I try to generate. A blue bar should appear at the bottom of the window, indicating code generation. When it finishes \u2014 you can open STM32CubeIDE. Only which one? Unfortunately it\u2019s hard to find a document that says which CubeIDE is appropriate for projects from a given TouchGFX Designer version.<\/p>\n\n\n\n<p>But, but, but! This applies if you install those two tools separately. If you installed TouchGFX Designer by pulling the add-on in CubeIDE, it should all work together.<\/p>\n\n\n\n<p>I have the STM32Cube IDE 1.6.0 + TouchGFX Designer 4.16.0 set. Let\u2019s launch CubeIDE and go.<\/p>\n\n\n\n<p>As the Workspace, choose the one you entered in TouchGFX Designer at the very beginning. Then import the project generated by TouchGFX Designer.<\/p>\n\n\n\n<p><strong>Now an important thing. When trying to run the Cube file do not update the HAL libraries! Click Continue. Do not click Migrate!<\/strong><\/p>\n\n\n\n<p>Why? We use HAL for STM32G0, because that\u2019s what my Nucleo is. The project was written for HAL FW_G0 V1.3.0. The latest V1.4.1 has a horrible bug in the register definitions and you have to paste a few definitions into the headers\u2026<\/p>\n\n\n\n<p>It\u2019s not worth bending over backwards \ud83d\ude42 Let\u2019s wait until they fix it.<\/p>\n\n\n\n<p>After importing and launching Cube, we see a view like this.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import-1024x555.jpg\" alt=\"\" class=\"wp-image-1865\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import-1024x555.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import-300x163.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import-768x416.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import-1536x832.jpg 1536w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_after_import.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>On the left we see a few additional elements that you don\u2019t have when creating a bare project in CubeMX.<\/p>\n\n\n\n<p>First, we see folders like <em>generated, gui, TouchGFX<\/em>. These are things generated by TouchGFX Designer, as well as the TouchGFX library itself.<\/p>\n\n\n\n<p>In these generated things there are headers informing where images and fonts are located, and also what our screens in the application look like.<\/p>\n\n\n\n<p>Below there is one more cool folder with the mysterious name MB1642B. This is the code for the Shield with the display. This folder contains the display driver, SPI Flash memory, and joystick.<\/p>\n\n\n\n<p>We\u2019ll get to that later, but in short: for the TouchGFX engine you need to provide exactly such drivers. This engine has to know how to interact with the display and the Flash memory in order to work properly. In the future we\u2019ll try to write such a driver ourselves.<\/p>\n\n\n\n<p>Before we run the code, I have one more note. I always repeat that you should tick in Cube \u201cGenerate peripheral initialization as a pair of \u2018.c\/.h\u2019 files per peripheral\u201d. It allows you to keep better readability of the project.<\/p>\n\n\n\n<p><strong>For demo programs we do not tick it.<\/strong> Such splitting unfortunately breaks the example code written by ST. They refer to files that are created exactly in the way we get after generating in TouchGFX Designer, and it\u2019s better not to touch it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Problem with generating bitmaps<\/h2>\n\n\n\n<p>Unfortunately, I\u2019m struggling with quite a big problem. If I create yet another project in TouchGFX Designer based on the online example \u2014 headers for images are not created.<\/p>\n\n\n\n<p>It works nicely the first time, when I have a fresh installation. With each subsequent one \u2014 I get the following compilation error of the generated project.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"196\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps-1024x196.jpg\" alt=\"\" class=\"wp-image-1866\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps-1024x196.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps-300x57.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps-768x147.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_missing_bitmaps.jpg 1244w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>No image definitions exist in the project. I reported the error to ST, but they can\u2019t reproduce it. Let me know if you also have such problems.<\/p>\n\n\n\n<p>Maybe it won\u2019t happen with other projects\u2026<\/p>\n\n\n\n<p>Issue reported on the forum <a href=\"https:\/\/community.st.com\/s\/question\/0D73W000000n7QO\/detail?s1oid=00Db0000000YtG6&amp;s1nid=0DB0X000000DYbd&amp;emkind=chatterCommentNotification&amp;s1uid=0050X000009yDKz&amp;emtm=1615283297896&amp;fromEmail=1&amp;s1ext=0\" target=\"_blank\" rel=\"noopener\">HERE<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">External Loader Flash SPI<\/h2>\n\n\n\n<p>If everything succeeded, you can build the project. You\u2019d probably like to flash it to the microcontroller already, but no! It still won\u2019t work.<\/p>\n\n\n\n<p>TouchGFX uses external Flash memory where it stores all images. For the program to work correctly, those images have to be placed there.<\/p>\n\n\n\n<p>But how do you do that? After all, it\u2019s SPI memory connected to the microcontroller?<\/p>\n\n\n\n<p>Here ST developed something some time ago called External Loader. While programming the microcontroller, we can also program the Flash memory connected via SPI.<\/p>\n\n\n\n<p>It\u2019s a great solution and I will definitely want to practice it on my own examples. The problem is that a single loader is dedicated to a single microcontroller and a specific hardware configuration.<\/p>\n\n\n\n<p>It\u2019s a small firmware that lets you transfer data coming from ST-Link to SPI Flash (or another memory).<\/p>\n\n\n\n<p>You need to tell the script that loads our program that it must use the External Loader.<\/p>\n\n\n\n<p><strong>For our example it is located in the project folder &lt;Project&gt;\\gcc and it is the file MX25L6433F_STM32G071B_NUCLEO.stldr<\/strong><\/p>\n\n\n\n<p><strong>We need to copy it to CubeIDE plugins.<\/strong> For me it\u2019s under the path &lt;installed CubeIDE&gt;\\plugins\\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.6.0.202101291314\\tools\\bin\\ExternalLoader<\/p>\n\n\n\n<p>Again, an inhuman path, right? \ud83d\ude42<\/p>\n\n\n\n<p>Paste this file into that location and return to CubeIDE. Launch the debug configuration.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_debug_config.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"209\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_debug_config.jpg\" alt=\"\" class=\"wp-image-1867\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_debug_config.jpg 628w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_debug_config-300x100.jpg 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>You now need to point to the file you copied. Go into the project debug configuration, then the <em>Debugger<\/em> tab, and at the very bottom you have the <em>Misc.<\/em> section.<\/p>\n\n\n\n<p>Tick the checkbox next to <em>External Loader<\/em> (if it\u2019s not already ticked). You should see some file that was assigned to the project. That loader is outdated and you need to choose the new one you copied.<\/p>\n\n\n\n<p>Press Scan and select your file. In the screenshot below you have all those elements marked.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader-1024x725.jpg\" alt=\"\" class=\"wp-image-1868\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader-1024x725.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader-300x212.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader-768x543.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2021\/03\/touchgfx_external_loader.jpg 1460w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>Save the configuration \u2014 via Apply \u2014 and run debug.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Demo in action<\/h2>\n\n\n\n<p>Now the program and the contents of the external SPI Flash should be programmed. You\u2019ll see during flashing when the External Loader is executed. It\u2019s quite distinctive.<\/p>\n\n\n\n<p>The whole flashing process takes a bit longer due to the external Flash.<\/p>\n\n\n\n<p>However, when everything succeeds, you can run the program. You\u2019ll see a beautiful demo prepared for our Shield. I recorded a short video showing the program in action.<\/p>\n\n\n\n<p><iframe width=\"750\" height=\"422\" loading=\"lazy\" title=\"Prezentacja demo TouchGFX na NUCLEO-G071RB + X-NUCLEO-GFX01M1\" src=\"https:\/\/www.youtube.com\/embed\/aOL1UjuVSSI?feature=oembed&amp;enablejsapi=1&amp;origin=https:\/\/msalamon.pl\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>Admit it: for such a small microcontroller \u2014 <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/nucleo-g071rb\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">STM32G071RB<\/a> \u2014 the GUI runs great. This is TouchGFX. This engine is amazing and it looks like it will stay with me for longer!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>As you can see, just running the demo program can already cause many problems. It doesn\u2019t surprise me that so few people work with TouchGFX if it\u2019s this complicated.<\/p>\n\n\n\n<p>Unfortunately, I\u2019m also worried about the small amount of materials about this environment. Especially ones that show how to implement your own hardware to work with TouchGFX.<\/p>\n\n\n\n<p>It\u2019s nice that there are demo programs, but we need to make our own. That\u2019s what I\u2019ll strive for and show you how I do it.<\/p>\n\n\n\n<p><strong>If you liked the article, buy something from me!<span>&nbsp;<\/span><img decoding=\"async\" draggable=\"false\" role=\"img\" class=\"emoji\" alt=\"?\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/13.0.0\/svg\/1f642.svg\"><span>&nbsp;<\/span><a href=\"https:\/\/sklep.msalamon.pl\/?utm_sorce=blog&amp;utm_medium=article&amp;utm_campaign=touchgfx1&amp;utm_content=Text\">https:\/\/sklep.msalamon.pl\/<\/a><\/strong><\/p>\n\n\n\n<p><span>If you noticed an error, disagree with something, would like to add something important, or simply feel like you\u2019d like to discuss this topic, write a comment. Remember that the discussion should be polite and follow the rules of the Polish language.<\/span><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;4205&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;0&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;First steps with TouchGFX on STM32 and a dedicated shield&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Doing graphics on microcontrollers is always a huge challenge. Even more so if it\u2019s supposed to look nice. For years we\u2019ve known simple so\u2011called GFX libraries that let us draw bitmaps or various fonts. However, that\u2019s not enough, because often our GUI still looks like it came from 1990s devices, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3594,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[160],"tags":[176,174,177],"class_list":["post-4205","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stm32","tag-programming","tag-stm32","tag-stm32cubemx"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/comments?post=4205"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4205\/revisions"}],"predecessor-version":[{"id":4208,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4205\/revisions\/4208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/3594"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}