cancel
Showing results for 
Search instead for 
Did you mean: 

Import Fully-Working TouchGFX Project into STM32CubeIDE. "Run as" grayed out. How to flash from STM32CubeIDE?

ilyus
Senior II

Situation: STM32F469 Discovery board with DSI 800x480 Screen, broken native BSP drivers (Display-related part of the driver). I tried to create a project in STM32CubeIDE, set all the settings, initialized as default for the discovery. Added BSP files. Doesn't work. Spent 2 months editing BSP drivers, but only got it to half-working state with 9000 glitches and wrong things happening.

Solution I found this morning: if I create the project FIRST in Touch GFX Designer, I can choose example program for my discovery board. Then I press "Run Target", and it uploads a whole working GUI program to the discovery board without me ever seeing a single line of code. It even generates all the main files, sets up FreeRTOS, generates CubeMX file with the CORRECT settings (which are different from default discovery board's settings if I make new STM32F469-disco project, no wonder it doesn't work). It generates MX automatic parts and fills in all "user customizable" sections of files too, makes all BSP calls, initializes DSI display, SDRAM, starts FreeRTOS task, everything.

So, I have full code of a working program with all necessary drivers/files/initializations included, fully self-contained, and it WORKS when uploaded via TouchGFX Designer. BUT!

I can't upload (flash) it in STM32CubeIDE! Only via TouchGFX Designer "Run Target". Where I can't edit code, obviously.

In STM32CubeIDE, I go to "File"->"Open Projects from File System", go to the project folder generated by TouchGFX Designer, it has all mains, all SDRAM setups and everything-everything, fully working thing, and the folder structure is just like any other natively created STM32CubeIDE project. Except that when I right click any file in this project (which btw has a symbol of folder for whatever reason), "Run As" is grayed out for no obvious reason, even though it has mx ioc file, main.c file, all libraries, drivers, linkers and stuff.

Question is: how can I force STM32CubeIDE to upload this imported project from STM32CubeIDE and not from TouchGFX Designer? (100% identical files, 0 changes, TouchGFX can compile and upload it, CubeIDE can't - grayed out)

I tried to google this question, but it's hard to word it right, and I couldn't find anything of value. Videos of embryonic.dk were extremely helpful in understanding what is what and why, among other things, but he creates STM32CubeIDE project first and then adds TouchGFX - it worked for me for STM32F746 board, but not with STM32F469, unfortunately, this procedure is out of the question for me on 469, because CubeIDE is broken for F469 (wrong default configs, nowhere to get all correct configs unless you already have them).

Alternative solution would be to "steal" configs and setup from that generated touchgfx fully working program and make new STM32CubeIDE Project from scratch with that info, it's a little more time consuming, but doable; but I have to be able to import it straight into CubeIDE, right?

6 REPLIES 6
ktrofimo
Senior III

Yes, for some reason open existing project in CubeIDE doesn't work. As a workaround you can import it as existing git repository:

1. install git

2. install git extensions for Eclipse

4. ​initialize git repository in existing project folder:

a) git init

b) git add .

5. import existing git project in CubeIDE

Unfortunately, I've never used any version control system in my entire life, because I've always been the only developer in the company (and still am). Installed git. I have no idea what it is and how to operate it tho, million weird terms and functions that I never needed before. I'm sure this is not relevant to this discussion, but in case there is any other solution which doesn't involve third party software, it would be good to know

At first you do not need full git functionality. It is just a workaround that will help​ you to import project into CubeIDE.

Open command prompt in the project folder ​and type those two commands: "git init" will create git repository in this folder and "git add ." will add all files under version control. Then you will be able to import existing git repository in CubeIDE using git tools for Eclipse (need to install from Eclipse marketplace).

​Read about git (official docs or any articles). Even you are alone it will help to keep your projects in order for example if you need to rollback any changes or use any early version of your project.

There is a number ​of GUI tools for git like Git Extensions (for Windows) or Sourcetree (for Mac). They make life little easier 😀

ilyus
Senior II

I have found the answer to my question pretty much word for word here: https://www.youtube.com/watch?v=Q-mfuzW6S-0&ab_channel=EEbyKarl

He goes to File->Import->(General)->Import Existing projects into a workspace. And imports the project and it works right out of the box!

Alright, so I should do the same.

I have same software versions of everything. EXCEPT! When I try to import a project, all projects found in the folder are GRAYED OUT! FOR NO REASON! WTF?!

I do exactly the same things, with exactly the same software with the same versions and everything. Unfortunately, this random "gray something out" thing seems common for CubeIDE. Either it's very buggy (since when you try to import projects, this kind of *** happens to random projects for no obvious reason and without any comment), or there is some error, except that it doesn't give any comment. It's literally NO YOU CAN'T DO IT EVEN IF YOU DO EVERYTHING RIGHT HAHAHA.

This is annoying...

Please, anyone make some indication about why some project is grayed out while importing. Otherwise I can only brute force my way through by trying everything and hope to find the reason for grayout eventually.

UPDATE: Deleted from the drive all CubeIDE projects from the workspace. Imported successfully, wasn't grayed out. In the video, the guy just builds the project immediately after importing. Of course, my identical setup doesn't work that way, because why the f not to screw with me some more.

"No rule to make target...". Guess I have another round of infuriating googling ahead of me looking for errors that I have and nobody else has, but not in this thread anymore, of course. The point of "grayed out" imports still holds tho. Would be nice to have some comment on why something is grayed out.

This question is closed.

UPDATE 2: again deleted everything and did from the start. It builds. Killmeplease. Well, at least I can proceed with the project.

Fake it till you make it in the nutshell

Romain DIELEMAN
ST Employee

Coming after the storm sorry, I will just clear out the reason why the project generated when creating a project from TouchGFX Designer with the application template for the STM32F746 disco has some different settings than the ones in a project created from STM32CubeMX or STM32CubeIDE. The application template is something "we" (the TouchGFX team) set up with all the things necessary to create and run TouchGFX projects on the board whereas the settings of STM32CubeIDE generated projects are made for other uses and involve usually more functionalities. There is also more configuration through user code for the touch control for example, as you can see in the <project name>/TouchGFX/target folder.

/Romain

yeah, thank you, I've already examined all the generated code and stuff (2 months! I explored almost everything there is, of course; it was useful, but I was getting frustrated and desperate, of course). It's just that it works for 746 if you start from Cube, configure HW, add drivers, add TouchGFX and start it; and it DOESN'T work with 469 with the identical (similar) development process - adding necessary activation drivers for the DSI apart from other small differences. Lack of documentation on hardware settings is a little frustrating (lack of info about display - I tried all sorts of edits to drivers and only got some buggy or slo-mo picture at best). It would have been nice to have a PDF with all the LTDC/DSI/Other parameters listed with their acceptable values for disco boards. Eventually, I found out - by accident - that the TouchGFX can do RUN TARGET thing and upload the program without me doing ANY HW setup straight from the TouchGFx without a single line of code. So I immediately came to the idea that TouchGFX example is the only source I can find some working program that's not pre-compiled binary so I can look the stuff up or pull some files from it. And MX peripheral configuration from TouchGFX differs from default peripheral MX configuration for STM32F469-Disco if you start from CubeIDE.

Anyway, I made it work (project name "STM32F469TRY29" heh, there is also a dozen 746 projects, some even work correctly, but I really wanted DSI) with the help of the communities (st, ee stackexchange, youtube comments) and search engines, I can edit GUI as well as change code generator to use other peripherals, already tested it a little.

That's a good project right there, takes edit like no problem.