cancel
Showing results for 
Search instead for 
Did you mean: 

Where did the touch driver code go?

vince
Associate III

I’ve updated to IDE 1.2.1 and GFX 4.13. After a HARD uphill struggle, I finally figured out how to get a screen running on a 746 Discovery board. I can’t find how to enable the touch controller, though. In the previous software, this functionality was generated in a cpp file in the TouchGFX folder. That file contains nothing but comments now, with no code to initialize or service touch events. How do we get the touch function going? We need some clear example code or instruction. (And may I vent a bit here? This release can not possibly have been regression tested. I’ve done this long enough to recognize a train wreck when I see one. ST “broke the build�?, and left their base to suffer the consequences. It is inexcusable.)

29 REPLIES 29

Thank you, Martin. I look forward to seeing how you import your GFX projects into the Cube. This is so close, but for that little piece. Probably it is obvious, but not at the moment. Appreciate the support -

Hi @vince​,

Not sure i follow you. How i import my projects into which Cube? Have you tried opening one of the V3 template .ioc files in CubeMX/CubeIDE ?

0690X00000Bwd1cQAB.pngThanks for your patience. Details: GFX v4.13.0, Cube IDE v1.2.1 (latest updates of which I am aware).

Unfortunately, the system behavior has not been consistent over all the trials run, but the result is about the same each time. Here is a typical scenario, which I verified three times just now:

1) Using the Designer, I select a V3.0.0 template. I name my project something like "TestDisc746". Designer creates all necessary code, and I can run it on the target board from Designer.

2) I can import this newly created project to the IDE, at least sort of; everything except the GFX folder(s) containing the code needed for further development is brought into the work space. That is usually just a folder structure thing, and I will normally add such folders manually in the IDE, but trying this results in build errors of various types, even after excluding the simulator related files from the build. [Also note that Designer always forces the application name to be "STM32F746G_DISCO", regardless of what I call it when creating it; this is okay so long as it also names the project folder the same, but on occasion it has not, causing an import error. This happened several times last week, but so far not today.]

I suspect that getting the full project into the Cube and building it is a simple process, to judge from your comments, but I'm not seeing it. What is the final step in the process to get that Designer project into the Cube IDE, complete with the GFX files, so that they build error free? I am attaching a screenshot showing both the directory structure that has been created and the IDE import dialog.

BO Re.1
Associate II

Hi Vince,

im having same issues, tried to open and compile in both Keil IDE and cubeIDE after using template In TouchGFXDesigner. But loads of errors, I have managed to open in visual studio and wrote code in main.c , file created by CubeMX to set up my ADC, I wrote necessary code to sample input and ran in visual studio , then downloaded to board through TouchGFXDesigner.. my only issue is getting my adc value to touch screen, which is separate to this thread, ;), unless someone has some guidance?

im no expert , just a mature student, so not sure if it’s 100%... of note I deliberately went back and created syntax errors in the CubeMX main file and they were highlighted in TouchGFXDesigner when downloading to board .

i don’t know if this helps or not. :face_with_tears_of_joy:

But I’ve been banging my head for a while now trying to get something working and I now seem to be getting somewhere, hopefully it’s not a false positive :thinking_face:

Barry

Martin, I now see part of the problem. The GFX stuff is being imported, but the directory structure is different between those projects created by GFX and the ones generated in the Cube, and that is why I was not able to see the files where they used to be. I will start fresh with this in mind and see if I can get this to go.

Okay, great. This different structure sounds weird, and i plan on taking a look at it. I think i mentioned that i find it weird because the AT is based on what comes out of CubeMX/CubeIDE.

/Martin

Lagodolio
Senior

Hello!

I have a problem with my "STM32TouchController.cpp" . It's the same of Martin KJELDSEN , but CubeIDE give me an error:

void STM32TouchController::init()
{
    /* Initialize the TS driver structure */
    tsDriver = &ft5336_ts_drv;
 
    /* Initialize the TS driver */
    tsDriver->Start(TS_I2C_ADDRESS);
}

" TouchGFX/target/STM32TouchController.cpp:36:21: error: 'TS_I2C_ADDRESS' was not declared in this scope".

I think I have to declare TouchScreen I2C Address, but .... where?

Thanks a lot!

P.S. : My configuration is:

Board STM32F746G-Discovery

CubeIDE 1.2.1

TouchGFX 4.13.0

Have you included the component folder and the TS driver?

All the variables and addresses should be available when you tab-complete otherwise there's something missing

Lagodolio
Senior

I have included :

\STM32Cube_FW_F7_V1.15.0\Drivers\BSP\STM32746G-Discovery\stm32746g_discovery_ts.c & .h

Components directory with three subdir:

->Common

->ft5336

->ts3510

I think that the last one is for TouchScreen but probably it's wrong...

I included (as test) in my STM32TouchController.cpp also

//#include <STM32746G-Discovery/stm32746g_discovery.h>
#include <STM32746G-Discovery/stm32746g_discovery_ts.h>

but other errors (multiple declarations) made me understand it's not the right way so I removed it.

DCost.1
Associate II

I have had the same problem(the folder STM32TouchController.cpp was empty) and it worked for me.

Thanks a lot @HP​ !!