2024-09-24 12:39 AM - last edited on 2024-09-25 12:35 AM by Andrew Neil
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.
2024-09-24 01:12 AM
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 :
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 :
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,
2024-09-24 11:45 PM
Hello @GaetanGodart,
The issue you mentioned about displaying question marks happens in three cases:
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:
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.
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
2024-09-25 08:40 AM
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,
2024-09-26 03:07 AM
Hello @GaetanGodart ,
Thank you for your detailed response.
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.
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.
2024-09-26 04:18 AM - edited 2024-09-26 04:27 AM
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,
2024-09-27 10:27 PM
Hello @GaetanGodart ,
Thank you for your response.
#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
2024-09-30 02:04 AM
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,
2024-09-30 08:20 AM
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
2024-10-18 07:17 AM
Hello @JaiGanesh ,
Have you been able to move forward with your question?
Regards,