cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Designer: option to auto delete ./touchgfx folder upon exit

ferro
Senior III

Dear Gfx Team,

1. Could you please consider adding project setting to automatically delete ./touchgfx folder when Designer exits or project closed (Ctrl+Q) ?

The folder's size is nearing 300Mb. I have tried many Designer Examples and they consume a lot of disk space because of ./touchgfx folder.

ferro_0-1727178881076.png


This would mirror auto copy of the "./touchgfx" folder into project if not present.

Something like this:

ferro_0-1727433016416.png

 

 

2. Idealy, option to set to auto delete "./simulator/msvs/.vs" folder as well would great as it is often even bigger than ./touchgfx.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Hello @ferro ,

 

It is important for us to keep a clean working environment.

The feature you requested won't be implemented on incoming minor releases but it will be considered for future major releases.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

8 REPLIES 8
ferro
Senior III

I deleted libraries from "c:\TouchGFX\4.24.1\touchgfx\lib\core\" which are for MCUs not used in my project so that helped with ./touchgfx folder size. Still, I think it would be an improvement to have the option to remove the folder completely every time Designer exits or project is closed (Ctrl+Q)

I like your suggestion, but I don't believe in deleting things by default. If implemented it should be optional and opt-in.

I have all my projects in git and I ignore files I don't need such as build artifacts and temporary files. I do keep generated source files so building is possible without TouchGFX or STM32CubeMX.

I archive all our tools and packs:

  • STM32CubeMX version I use
  • downloaded packs for STM32CubeMX
  • STM32CubeIDE version I use
  • TouchGFX version I use
  • Visual Studio 2022 for simulator debugging


I can build and flash my target (MCU + external FLASH) in STM32CubeIDE and in TouchGFX Designer.
And I can build the simulator in TouchGFX Designer and in Visual Studio 2022 (for debugging).

All my projects' builds are always reproducible without an internet connection and automatically build on a build server. Can be build on Windows and Linux (except simulator).

My .gitignore file:

 

*.bak
Debug/
Release/
TouchGFX/build/
TouchGFX/config/*
TouchGFX/generated/user.config
TouchGFX/*_backup.touchgfx
TouchGFX/simulator/msvs/.vs/
TouchGFX/simulator/msvs/enc_temp_folder/
TouchGFX/screenshots/
TouchGFX/generated/fonts/cache/
TouchGFX/generated/texts/cache/
Middlewares/ST/touchgfx_backup*
Middlewares/ST/touchgfx/lib/core/*
!Middlewares/ST/touchgfx/lib/core/cortex_m7/
Middlewares/ST/touchgfx/lib/core/cortex_m7/*
!Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/
Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc/libtouchgfx.a 
*.vcxproj.user
.settings/

 

If you have ignored files with .gitignore you can remove temporary files with

git clean -dfX

 

 

To delete ignored files which are tracked (happens if you update the .gitignore file after adding a file):

 

 

git ls-files -c --ignored --exclude-standard -z | xargs -0 git rm --cached

You could probably find a way to recursively run the clean command on all your local repos once you have set the .ignore files correctly (and untracked those files and folders). If you are not using git, then you should start doing so. I could help you with setting it up.

My TouchGFX folder is only 30MiB after cleaning and most of that is image assets. After building for simulator it is 62MiB. I checked this with the Windows tool "TreeSize Free".

Edit:
The Middlewares folder is the largest with 279.8MiB. I was able to reduce it to 78.5MiB by removing unused MCUs from the libraries and unused libraries build for non-GCC compilers.
Edit2:
font and text cache folders is not needed. It will build in STM32CubeIDE without these folders. TouchGFX will just generate them again if they are removed.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
GaetanGodart
ST Employee

Hello @ferro ,

 

It is important for us to keep a clean working environment.

The feature you requested won't be implemented on incoming minor releases but it will be considered for future major releases.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @unsigned_char_array 

Seems like a rather sophistiocaterd setup you've got. Really helpfull you detail described it. I am not that far yet, I run simulation only. Getting familiar with Gfx, Git. Integration with HW is few months away.

"I could help you with setting it up."
That is a very generous offer, thank you.

I run this batch script to delete all temporary files

:: ====================================================================================
::
:: Folders removed:
::  /build/Debug/obj        - MSVC object files etc. are not needed to run Application.exe
::  /build/MINGW32_NT-6.2/  - Gfx object files etc. are not needed to run Application.exe
::  /simulator/msvs/.vs     - MSVC hidden folder holding debug temporaries e.g. precompiled header files
::  /touchgfx               - if not present, this folder is auto-copied from Gfx install
::                            folder before GfxDesigner generates code 
::
:: ====================================================================================

@echo off

echo.

IF exist .\\simulator (
	rem
) ELSE (
	echo Error: This batch file is in a wrong folder, move it to the top level where *.touchgfx project file lives
	exit /b
)
echo.

:: ====================================================================================
:: Delete all *.obj and any file needless to run Application.exe
:: MSVC
echo =========================================================================
echo [MSVC *.obj]
IF exist .\\build\\Debug\\obj (
	rmdir /S /Q .\\build\\Debug\\obj
	echo [MSVC *.obj] Success: Deleting MSVC *.obj in '/build/Debug/obj' folder
) ELSE (
	echo [MSVC *.obj] Nothing done: Could not find '/build/Debug/obj' folder
)
echo.

:: GfxDesigner
echo =========================================================================
echo [Gfx  *.obj]
IF exist .\\build\\MINGW32_NT-6.2 (
	rmdir /S /Q .\\build\MINGW32_NT-6.2
	echo [Gfx  *.obj] Success: Deleting GfxDesigner *.obj in '/build/MINGW32_NT-6.2' folder
) ELSE (
	echo [Gfx  *.obj] Nothing done: Could not find '/build/MINGW32_NT-6.2' folder
)
echo.

:: ====================================================================================
:: delete MSVC temporary debug files, eg precompiled headers
echo =========================================================================
echo [MSVC .vs  ]
IF exist .\\simulator\\msvs\\.vs (
	rmdir /S /Q .\\simulator\\msvs\\.vs
	echo [MSVC .vs  ] Success: Deleting '/simulator/msvs/.vs' folder
) ELSE (
	echo [MSVC .vs  ] Nothing done: Could not find '/simulator/msvs/.vs' folder
)
echo.

:: ====================================================================================
:: no need to track Gfx framework - auto-copied from install folder when running Gfx project
echo =========================================================================
echo [Gfx frame ]
IF exist .\\touchgfx (
	rmdir /S /Q .\\touchgfx
	echo [Gfx frame ] Success: Deleting '/touchgfx' folder
) ELSE (
	echo [Gfx frame ] Nothing done: Could not find '/touchgfx' folder
)

echo.
echo [Finished]
echo.

 

Have you created your project from TouchGFX or from STM32CubeMX? Those projects have different resulting structures. I've never seen the folder touchgfx inside my my folder TouchGFX.

My folder structure:

 

TouchGFX/App/
TouchGFX/assets/
TouchGFX/build/
TouchGFX/condig/
TouchGFX/generated/
TouchGFX/gui/
TouchGFX/simulator/
TouchGFX/target/
TouchGFX/myproject.touchgfx
TouchGFX/ApplicationTemplate.touchgfx.part
TouchGFX/target.config
TouchGFX/Build.cmd
Middlewares/
Middlewares/ST/touchgfx/
.cproject
.mxproject
.project
myproject.ioc
Debug/
Release/
Core/
.gitignore
.gitmodules
etc.
Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

@unsigned_char_array 

Ah, I see. Correct. This is a generic template I use when creating Gfx projects in GfxDesigner.

It should be in the same folder as project.touchgfx

When starting from CubeMX, ./touchgfx folder is in \\Middlewares\\ST\\ so the last part of the script should be

:: ====================================================================================
:: no need to track Gfx framework - auto-copied from install folder when running Gfx project
echo =========================================================================
echo [Gfx frame ]
IF exist ..\\Middlewares\\ST\\touchgfx (
	rmdir /S /Q ..\\Middlewares\\ST\\touchgfx
	echo [Gfx frame ] Success: Deleting '/touchgfx' folder
) ELSE (
	echo [Gfx frame ] Nothing done: Could not find '/touchgfx' folder
)

 

 

The middlewares folder contains libs and source files that are needed for building in STM32CubeIDE.
So I don't delete it, because I don't want to start TouchGFX in order to build my project. I want all code in the repo.
Alternatively I could put this middleware in a submodule so I don't have to duplicate it for all projects. I haven't thought of that before.

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.