2024-04-17 02:21 AM - edited 2024-04-17 02:27 AM
I can build using
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\headless-build.bat -import ./.. -cleanBuild PROJECTNAME/Debug
or
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\headless-build.bat -import ./.. -build PROJECTNAME/Debug
In PowerShell or older command prompt running from the Source/TouchGFX folder in my project.
However if I copy the exact line into "Compile Target Command" in TouchGFX Designer I get the following error:
URI: file:/C:/source/CUSTOMER_NAME/PROJECTNAME/Source is not valid in the workspace!
I tried the following:
Batch file:
OFF
echo incrementally building...
SET var=%cd%
ECHO %var%
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\headless-build.bat -import ./.. -build PROJECTNAME/Debug
It does run the batch file and I had it print the current directory, which was the Source/TouchGFX folder in my project. But I get the same error.
I don't know what magic TouchGFX Designer does with the command area, but there must be a difference. Environment variables perhaps?
Can someone help me with this?
Solved! Go to Solution.
2024-04-22 03:34 AM - edited 2024-04-24 08:51 AM
Incremental build doesn't work if I use a temporary folder that I delete later. Eclipse apparently doesn't look into the build folder alone to check the build state. So for incremental build I don't bother deleting the folder or trying to get a unique folder. I've got it to work:
@Echo off
echo incrementally building...
set PROJECT_DIR=%cd%\..
set PROJECT_NAME=MY_PROJECT_NAME
set BUILD_TYPE=Debug
set workspace_folder=%temp%\%PROJECT_NAME%_workspace
mkdir %workspace_folder%
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\headless-build.bat -no-indexer -data %workspace_folder% -import %PROJECT_DIR% -build %PROJECT_NAME%/%BUILD_TYPE%
exit /b %ERRORLEVEL%
I did have a problem with the script sometimes freezing, but I created another topic for this and solved it there: https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-1-11-2-headless-build-freezes-for-20-seconds-after/m-p/665855#M26609
2024-04-17 08:36 AM
Hello @unsigned_char_array ,
To build and compile from within Designer you have to use a Makefile.
Here is an example from a project I am working on :
A good starting point for you could be to create a new project by selecting a discovery or evaluation board with the same MCU that you are using (if there is one) and look for the Makefile in the GCC folder to get inspired (copying it completely could work but I am not sure).
If this answer you issue, I invite you to select this comment as "best answer".
Regards,
2024-04-17 08:47 AM - edited 2024-04-17 08:56 AM
i use this
cd c:\\ST\\STM32CubeIDE_1.?.0\\STM32CubeIDE && c: && headless-build.bat -project PROJNAMEinIDE/Debug -workspace C:\\Users\\Public\\CubeWorkspace -build -console
change to your paths use only one \ in designer or replace in touchgfx file in editor as here
2024-04-19 12:57 AM - edited 2024-04-19 02:20 AM
Your command doesn't even work in the regular terminal.
Error: Unknown argument: -project
The paths already have one \. And in the file it already has escaped the backslashes.
I use TouchGFX 4.23.2 and STM32CubeIDE 1.11.2
depending on how I enter my paths I get one of these errors:
URI: file:/C:/source/PROJECT/Source is not valid in the workspace!
or
org.eclipse.core.runtime.CoreException: No file system is defined for scheme: C
2024-04-19 06:45 AM
Sorry i use this on old IDE version. Now syntax little diff, and i cant locate where i store new one. I dont use compile in TGFX often.
2024-04-19 12:37 PM - edited 2024-04-19 12:42 PM
I've got it to work. Eclipse doesn't like being called from inside a project folder. I CDed to a different folder (after saving the current folder path in a variable) and then called headless build and now it works. It will create a workspace folder there. I want to avoid that and want to use a temporary folder for the workspace and delete that one. I don't want to use an existing workspace, because eclipse will complain if I have STM32CubeIDE open during build, so I'm glad it creates a new one. Now I just need to figure out how to create a temporary folder in the batch file and cleaning up afterwards. Once I got that to work I will post a solution.
2024-04-22 03:34 AM - edited 2024-04-24 08:51 AM
Incremental build doesn't work if I use a temporary folder that I delete later. Eclipse apparently doesn't look into the build folder alone to check the build state. So for incremental build I don't bother deleting the folder or trying to get a unique folder. I've got it to work:
@Echo off
echo incrementally building...
set PROJECT_DIR=%cd%\..
set PROJECT_NAME=MY_PROJECT_NAME
set BUILD_TYPE=Debug
set workspace_folder=%temp%\%PROJECT_NAME%_workspace
mkdir %workspace_folder%
C:\ST\STM32CubeIDE_1.11.2\STM32CubeIDE\headless-build.bat -no-indexer -data %workspace_folder% -import %PROJECT_DIR% -build %PROJECT_NAME%/%BUILD_TYPE%
exit /b %ERRORLEVEL%
I did have a problem with the script sometimes freezing, but I created another topic for this and solved it there: https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-1-11-2-headless-build-freezes-for-20-seconds-after/m-p/665855#M26609