2024-09-24 04:57 AM - last edited on 2024-09-30 07:25 AM by SofLit
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.
This would mirror auto copy of the "./touchgfx" folder into project if not present.
Something like this:
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.
Solved! Go to Solution.
2024-09-27 01:15 AM
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,
2024-09-24 05:08 AM
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)
2024-09-26 03:26 AM - edited 2024-10-22 04:56 AM
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:
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.
2024-09-27 01:15 AM
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,
2024-09-27 03:41 AM
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.
2024-09-30 07:22 AM
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.
2024-10-01 01:37 AM
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.
2024-10-01 02:23 AM
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
)
2024-10-01 03:09 AM - edited 2024-10-01 03:11 AM
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.