cancel
Showing results for 
Search instead for 
Did you mean: 

Merging STM32CubeIDE and Touch GFX Designer for STM32H747-Disco

JaiGanesh
Associate II

Hello,

I hope this message finds you well. I am currently working on a project involving the STM32H747IH6-Discovery board, where I am merging STM32CubeIDE with Touch GFX Designer to display data on the UI. I'm sending data through various communication protocols, including UART, and although the data is being correctly received and stored in variables, it is not being displayed on the UI. Despite following the available documentation and tutorials, I am encountering issues that require expert guidance to resolve, particularly in getting the stored data to appear on the user interface.

 

Thankyou.

9 REPLIES 9
GaetanGodart
ST Employee

Hello @JaiGanesh and welcome to the community! :smiling_face_with_smiling_eyes:

 

Let's first try to solve that by message here.

 

Let's double check these points, tell me if any is not true :

  1. You create a project using STM32CubeIDE and later added TouchGFX to it
  2. You store your data in variable accessible to your main.c
  3. The GUI part works fine except with displaying the variables
  4. You are able to properly use the wildcard (ex : incrementing a number)

 

What do you see in the GUI when trying to display variables? Do you see question marks instead of the value? Do you not see anything? Is it random values?

 

What is your process to send the data to the GUI?
Here is the simple process that I think you should follow :

  1. Make sure your data are available to the main.c
  2. Include the main.c in the model.cpp file
  3. Propagate the data to the appropriate screen like so : MVP tuto 

This video seems to do exactly what you want to do : TouchGFX GUI and Hardware Interaction 

 

Hope this helps.
If this comment answers your question, I invite you to select it as "best answer". :smiling_face_with_smiling_eyes:

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello @GaetanGodart,

The issue you mentioned about displaying question marks happens in three cases:

  1. When the font is missing.
  2. When the interactions are not set up correctly.
  3. When the ranges in the Typographies section are not defined.

In my situation, when I design the GUI with a text widget, it displays correctly on the screen after flashing the firmware. However, when I try to display the data I’m sending, nothing appears—there are no question marks or random characters.

Here’s the process I’m following to send data to the GUI:

  1. I receive the data in main.c, call a function to pass the data to Model.cpp, then send it to Presenter.cpp, and finally, from there to ScreenView.cpp, where it should update the display. I’ve verified through live expressions that the data is being stored in variables, but it doesn’t show up on the screen.

  2. In another attempt, I wrote the code to receive the data in main.c and passed it directly to View.cpp, but the data still doesn’t display on the screen.

Additionally, when I debug the code in STM32CubeIDE, everything works fine. However, when I try the same process in TouchGFX Designer after writing the code, I encounter an "undefined reference" error. Since I’m using UART to receive data, the specific error is: "undefined reference to HAL_UART_Receive."

Lastly, when I run the simulation in TouchGFX Designer, the same issue occurs, and the data still doesn’t display.

I’ve attached our project file below for your reference. Could you kindly take a look?

My request is to schedule an online session to go more in-depth into these problems. Our project deadline is approaching near, and resolving these issues efficiently would be incredibly helpful.

Thank you!

Best regards,
Jai Ganesh

GaetanGodart
ST Employee

Hello @JaiGanesh ,

 

1)

I’ve verified through live expressions that the data is being stored in variables

So you have verified that you do get the data at all file level (model.cpp, presenter and view) by for instance using the touchgfx_printf function and it worked everytime?
You you have not tested that, can you test it and tell me the result please?

 

2)
I have checked your project but I cannot compile it, it seems some fiels are missing (Uart_Polling.h).
However, I was able to look at your code.
In "Screen1View.cpp" you have :

 

void Screen1View::UartMsgRdy()
{
    if(UartMsgBuff[0] == 0) return;

    memset(&textArea1Buffer,0,TEXTAREA1_SIZE);

    Unicode::snprintf(textArea1Buffer,TEXTAREA1_SIZE-1,(char *) UartMsgBuff);
    textArea1Buffer[16] = 0;
    textArea1.invalidate();
}

 

Can you explain why you have the line "memset(&textArea1Buffer, 0, TEXTAREA1_SIZE);"?
Doesn't this line put all the data of your buffer to 0?
If that is true, then it makes sense that you do not see anything because you are printing the wrong character since you erase your data.

 

3)
I am not allowed to make a call.
If after this message you are still stuck, I can escalate your message but I am not sure that it would be faster.

 

I hope this helps you!

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello @GaetanGodart ,

 

Thank you for your detailed response.

  1. I have now verified that the data is not being passed into Model.cpp, Presenter.cpp, and View.cpp. I used the touchgfx_printf function, and the data does not appear at those file levels.

  2. Regarding the line memset(&textArea1Buffer, 0, TEXTAREA1_SIZE);, I included it because, after each transmission, a callback function is triggered to clear the buffer once the data transmission is complete. This ensures the buffer is reset before the next transmission.

I would also like to mention that the process of merging STM32CubeIDE with TouchGFX has become quite challenging, especially since we are working with a dual-core system (STM32H747-DISCO). Unfortunately, there are no comprehensive tutorials or documentation available online on how to handle communication and integration between the two. We have been struggling with this issue for the past three weeks, and our project submission deadline is fast approaching.

Given the situation, could you please escalate this issue as soon as possible? Any assistance or additional resources would be greatly appreciated.

Thank you for your continued support.

GaetanGodart
ST Employee

Hello @JaiGanesh ,

 

1)
So you are not able to print the data to the TouchGFX console.
What is the type of your data? A string?
I was able to print data that was store in the main (an int) from the model.ccp by using the touchgfx_printf function. To do so, I simple included main.h in the model.cpp and I was able to access it from the main.
I have looked at your project, in the model.cpp, I do not see you include the main.h.
Let's try that and if that doesn't solve your problem, I will escalate.

 

2)
Yes, you are right, the memeset is fine.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello @GaetanGodart ,

Thank you for your response.

  1. Yes, I am still unable to print the data to the TouchGFX console. The data type is a string, not an integer. I have already included " main.h " in the Model.cpp file, as you suggested, but the issue persists.

 

#include "FreeRTOS.h"
#include "semphr.h"

#include <gui/model/Model.hpp>
#include <gui/model/ModelListener.hpp>


#ifndef SIMULATOR

#include"main.h"

​

 

As You Can check I have included "main.h" in the model.cpp 

Could you please assist further, or if necessary, escalate the issue as mentioned earlier?

Thank you for your continued support.

Best regards,

Jai Ganesh

Hello @JaiGanesh ,

 

How are you trying to print to the TouchGFX console?
You need to include <touchgfx/utils.hpp> to use the touchgfx_printf function but you don't do that in the model.cpp.
Also, I am not sure you can use it when running the board, I think you can only use it in simulator (I could be wrong) but you include the main only if not in simulator.
Do you only try to print the data in other files than the model? If so, you need to "propagate" the data from the model to the view.

If you want to test your data access, simply create a string variable in the main ,include the main in the model, include the touchgfx/utils.hpp in the model and use touchgfx_printf to print the string on the TouchGFX console.
If that doesn't work, try to create the string in the model directly.
If you can't do that, do the 2 steps above but with an int instead of a string.

 

I have escalated your question.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Christian N
ST Employee


Thank you for contacting STMicroelectronics.

For your information, questions about TouchGFX can be submitted directly to the ST Online Support Team at https://my.st.com/ols.

Kind Regards,
Christian
ST Support

Hello @JaiGanesh ,

 

Have you been able to move forward with your question?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)