cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX integration with External Project

koderboi22
Associate III

Hi there, I'm coming across some issues with respect to Touch GFX and my project. I'm trying to build a UI on the Touch GFX Designer software such that it can display certain temperature readings onto the Riverdi STM32H7 embedded display. I'm trying to use SPI2 communication line from the on-display board MCU to the temperature sensor module and hardware seems to be fine. For the CS Pin I'm using the GPIOA Pin 5 which is used for DAC1 (I've commented out it's initialisation and used it as a Output pin).

I was able to successfully build the Touch GFX project and was able to access the 'gui' folder generated by the designer as you can see below:

 

FilesFiles

 

Next, I added the files pertaining to the MAX31856 temperature sensor that I'm using and please note that these files are in C and not C++. I also made sure that they were included in the project correctly however I'm not certain. Below are the include paths, the sensor files and the sensor file position in the project explorer:

A) GCC Compiler -> Include paths:

Screenshot 2024-02-23 135448.png

B) G++ Compiler -> Include paths:

Screenshot 2024-02-23 135601.png

 

C) MAX31856.c and .h files:

 

MAX31856.c file: 

 

Screenshot 2024-02-23 142905.png

Screenshot 2024-02-23 142918.png

 

MAX31856.h file: 

Screenshot 2024-02-23 143106.png

Screenshot 2024-02-23 143115.png

 

D) Project Explorer View:

 

Screenshot 2024-02-23 141129.png
 
Below is the Screen1View.cpp file that was generated by the Designer and I've tried to call one of the functions into it but it gives me an error message:
 
koderboi22_0-1708697949789.png

 

 Error message:

C:/Tempcounter/CM7/TouchGFX/gui/src/screen1_screen/Screen1View.cpp:27: undefined reference to `MAX31865_readTemp()'

collect2.exe: error: ld returned 1 exit status

 

It would be great if anyone could help with this issue!

 
11 REPLIES 11
koderboi22
Associate III

@Mohammad MORADI ESFAHANIASL I've had a look at some of your responses on Touch GFX and external buttons, it would be great if I could please get some insight on this.

koderboi22
Associate III

@Martin KJELDSEN it would be great to have your opinion on this as well.

koderboi22
Associate III

@LouisB Could I please get some assistance with this.

Hello @koderboi22 ,

First of all, I got a bit confused by your statement "I was able to successfully build the Touch GFX project and was able to access the 'gui' folder generated by the designer", are you trying to create a custom project yourself? Or are you using the available board setup in TouchGFX Designer? 

And for the error you mentioned, you need to define some functions in the Model that will interact with MAX31856, and then, you need to call those functions in you Screen1View.cpp. 

You can check the available Board Specific Demos to get inspiration for your project because they show how you can interact with the rest of the board.

Board Specific DemosBoard Specific Demos

 

I hope this helps you, don't hesitate to ask more questions.

Mohammad MORADI
ST Software Developer | TouchGFX

Yes I'm trying to build my custom project and I want to use certain functions from my own .c and .h files which I've added to the project. I'm using the onboard MCU on the Riverdi STM32H7 Display to setup coms between the sensor module and the screen. I'm struggling to get the data from the sensor onto my screen and wanted to know how I can achieve this.

Also I will have a look at some demos and get back to you regarding the issue if it persists, Thank you.

Andrew Neil
Evangelist

Please use this button to properly post source code - not as images/screenshots:

AndrewNeil_0-1708705577068.png

 

 

JTP1
Lead

Hello

You probably should use extern "C" in max_31856.h- file funtion definitions when calling from cpp- file.

Check this:

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/stm32h7b3l-eval-custom-screen-with-gt911-tc-interface-not-able/td-p/641237

Br JTP

Hi @JTP1 , I tried using extern as well but it didn't work, I'll use the MVP structure and try it, hope I'll have better luck.

 

Hello @koderboi22 ,

Did you make any progress on this matter? 

Mohammad MORADI
ST Software Developer | TouchGFX