Skip to main content
LAlna.1
Associate II
May 10, 2020
Question

TouchGFX / Hardware integration tutorials

  • May 10, 2020
  • 19 replies
  • 5735 views

Hi there

I have been experimenting and creating simple TouchGFX GUI applications on STM32 touch screen dev kit.

Is there a simple start guide to creating as simple touchGFX GUI and controlling an LED on the STM32F429i Disco board? I tried some online examples/Youtube but they never seem to work properly.

TouchGFX websites contains good tutorials but they don't include HAL integration and control (as far as I have seen)

To keep it simple, I use ST32CubeMX, TouchGFX designer, and ST_link Utility to flash the board.

Any simple code would be a great help

Thanks

This topic has been closed for replies.

19 replies

Alexandre RENOUX
Visitor II
August 17, 2020

Hello,

What's your current status ?

/Alexandre

LAlna.1
LAlna.1Author
Associate II
September 5, 2020

Hi Alexandre

I gave up on the development to be honest, it wasn't as straight through process as I hoped it would be.

I loved the GFX interface, but the library and the examples were too vague to integrate the TouchGFX to the actual STM32 board. Unless you have a direct example I can follow to get a bearing on that process? I use the STM32F4 at work , so I am familiar with the IC

Regards

Alexandre RENOUX
Visitor II
September 7, 2020

What do you not manage to do exactly ?

Have you tried using the F429-DISCO Application Template in the Designer ? We create these Application Template so that people can start with something already working instead of doing their own code from scratch. Also, it's a great reference when trying to create your own custom project.

What exactly is not clear in the Website documentation regarding how to create a UI or even a project ?

If you want to turn on a LED, simply configure the corresponding pin in CubeMX, generate code and call the function HAL_GPIO_WritePin() when needed. I don't know on what event you want to turn on your led but it should not matter.

/Alexandre

GAuye
Associate
September 7, 2020

Hi Alexandre,

My question regarding this topic is: If we start from TouchGFX, using the template, it possible to generate the code and also to import to CubeIDE, compile and debug without problems. But, the Project folder is completly different, it generate a .ioc file with the board name and my point here is: how can we run the ioc file (inside CubeIDE or CubeMX) to configure more peripherals, that could include USB or also others GPIOs? (only by hand?) If I try to run the .ioc file generated by TocuhGFX (again with the name of the board, not the project) it generates files inside the folder with another structure and it is not running. I have also try to change the .ioc file name and other references inside but it was not working... I'm currently using latest versions of software (CubeIDE 1.4.0 and Touch 4.14.0) Thanks for your help-!!!

LAlna.1
LAlna.1Author
Associate II
September 5, 2020

Follow up:

A simple example of a touch application that would turn on a LED would be perfect.

GAuye
Associate
September 5, 2020

Totally agree.... I have spend 3 day looking for a simple but complete example, with no result. An it is very important to undersand how CubeMX could be integrated. The folder structure created by TouchGFX is completly different comparing with CubeMX and there is now way to integrate the three tools (TouchGFX, CubeMX and CubeIDE) CubeMX is very important if we need to use other perifericals in the same board (unless you do it by hand, witch means a lot of time an efford) Thanks for you help!!!!

RMega.1
Visitor II
September 5, 2020

I think u may try just STM32CUBEIDE ,because its include stm32cubemx inside.hopefully your pc can run easily.

RMega.1
Visitor II
September 5, 2020

hi i've same problem with u im beginner when first time using c# gui. but ithink u can keep learn on https://create.arduino.cc/projecthub/haoming-weng/c-arduino-gui-to-control-the-led-0877f8. how to configure c# gui to hardwere include STM32.....

MM..1
Super User
September 5, 2020

LED is simple you can implement it as action on buttons on screen directly or as if gpio button in model tick example

if ((HAL_GPIO_ReadPin(SW3_GPIO_Port, SW3_Pin) == GPIO_PIN_RESET && filter == false && timeout1.t == 0) ) 

 {

  filter = true; //block hold gpio key down repeat

  static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(73); // call to action asigned to symbolic keyboard keycode event KEY 73

// gpio led directly here ...

 }

Project create steps:

  1. CubeIDE create new project with MX ioc
  2. inside IDE open ioc and in MX configure and generate code
  3. instal touchGFX module and app (manual install need) when dont installed
  4. repeat edit ioc and add touchGFX part config generate code
  5. open from IDE touchGFX part and create project ... design some ... generate code
  6. back in IDE edit main code add touch process ... build and test LCD
  7. when LCD dont work block RTOS start and in main before it test all parts ram ltdc ...
LAlna.1
LAlna.1Author
Associate II
September 6, 2020

Thanks but I need a bit more detail, as I have tried that approach and I have apps running on the STM32 but no interaction between the HAL layer and app works.

GAuye
Associate
September 6, 2020

Hello regarding the Project creation, here are my comments:

Project create steps:

  1. CubeIDE create new project with MX ioc--- OK
  2. inside IDE open ioc and in MX configure and generate code--- OK
  3. instal touchGFX module and app (manual install need) when dont installed---Ok
  4. repeat edit ioc and add touchGFX part config generate code--- Not clear what you mean in this step
  5. open from IDE touchGFX part and create project ... design some ... generate code--Ok
  6. back in IDE edit main code add touch process ... build and test LCD-- I have not added nothing just test it... and it is not working. BSP folder is missing (not generated) and this, I think, is the problem. This is also showed in MOOC part 3 from STM, but it is not clear how to solve it. (just to clarify, if I start from Touch GFX, I can compile and run it into the Discovery, but I want to use the ioc file in order to add some others periphericas and not do it by hand...)
  7. when LCD dont work block RTOS start and in main before it test all parts ram ltdc ... --- Could you please explain with more datails...

Thanks for you help, appreciated!!!!!

MM..1
Super User
September 7, 2020

0693W000003Qx0iQAC.pngOn point 4 i mean add and set parts on image.

On 6 you need add lines to main.c, because generated code not start TouchGFX, maybe newer MX do it , but my 5.6 generate empty defaultTask

without add task no touch start exist...

void StartDefaultTask(void const * argument)

{

 /* USER CODE BEGIN 5 */

MX_TouchGFX_Process(); //added line

 /* Infinite loop */

 for(;;)

 {

  osDelay(1);

 }

 /* USER CODE END 5 */ 

}

BSP --- Cube clean project dont create it , you need add (copy) files when you need any. For my project i only create new driver for my LCD.

POINT 7 : block rtos start comment it out and add some test as backlight on some pixels on display change ...

 /* Start scheduler */

// osKernelStart();

 /* We should never get here as control is now taken by the scheduler */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

//test here

 while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

GAuye
Associate
September 10, 2020

MM..1 thanks for you answer and explanation, but I gave up... TouchGFX and CubeIDE (without touching the .ioc) is working fine, but if I want to start from CubeIDE (MX) I followed your explanation, and finally its says " c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208\tools\arm-none-eabi\bin\ld.exe: Graphic05.elf section `TouchGFX_Framebuffer' will not fit in region `RAM'

c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208\tools\arm-none-eabi\bin\ld.exe: region `RAM' overflowed by 153336 bytes" (it is just a button)

I think the tools are not complete integrated yet, so I will not spend too much time with this... I have added some periphericas by hand and I will test it (using the project original from TouchGFX) Again, thanks for your help but something is not working well. I have also recieved some advices from ST Employee on how to change the names in .ioc files generated by TouchGFX (to have the possibility to touch the .ioc file) but it didnt work...

Next step: Do you have a good link or reference to understand how graphics control hardward and vice versa? Thanks for your help!!!