2023-01-09 02:01 AM
Hello
I'm working on a F412G-Disco board, with a TouchGFX application. When generating the initialisation code with MX, in the Core inc directory, MX generate a nema_hal.c file
It contain only a file header. So, this is not a big problem but it is annoying. I tried to find what component was generating this file with no success.
What can I do to avoid this file to be generated?
My configuration:
STM32CubeMX version 6.7.1
F4 Firmware version 1.27.1
TouchGFX version 4.21.0
I tried to find out with the log of the MX, STM32CubeMX.log what component was creating the file. But there is not enough information. How to change the log level generated by MX?
Thank you.
Solved! Go to Solution.
2023-01-10 12:46 AM
Hello,
The STMicroelectronics.X-CUBE-TOUCHGFX.4.21.0_Configs.xml file contains the config of what we call the TouchGFX Generator, which is a pack of CubeMX.
In the line you highlighted, you can see that there is a condition : "sem_gpu2d_enabled & oswrapper_threadx". That means that, to generate the nema_hal.c file inside the target/generated/nema_hal.c, you need to enable GPU2D (sem_gpu2d_enabled) and ThreadX (oswrapper_threadx), inside CubeMX.
So if this condition is not true, CubeMX will never generate this file in this directory.
The fact that nema_hal.c exists inside your Core directory is because it is integrated by default in our TBS, so every time you create a project on F412-G starting from TouchGFXDesigner, this file will be included there.
To be honest, I don't really understand why that is an issue for you, and why you want to put this file in target/generated, if you are not using GPU2D and ThreadX.
/Yoann
2023-01-09 04:14 AM
Hello @ANauz.1,
This file is generated when you enable GPU2D with ThreadX or NoOS, but that is not enabled in the CubeMX project of the F412G TBS project in TouchGFXDesigner, so it should not appear in your project.
Did you create your project starting from TouchGFXDesigner and selected the F412G-Disco TouchGFX Board Setup from there ? Or did you create your project from CubeMX ?
/Yoann
2023-01-09 06:02 AM
Hello Yoann,
The ioc file was created using TouchGFX and the default template for the board.
Is there an option I can swith on and off so that MX remove it from the ioc file to avoid generating the file? What can I do to have it generated in the "correct" directory and not in my "core/inc"?
Thank you
2023-01-09 06:53 AM
Hello again,
My bad, I checked in the TBS and those files are indeed included by default in the project, in Core/Inc, like you said.
CubeMX will not remove those files even if you disable GPU2D and generate code, because it can only add references to files but not remove them unfortunately.
I recommend you to simply delete this file if it bothers you.
/Yoann
2023-01-09 08:38 AM
Ok
Is it possible to "correct" on of the X-CUBE-TOUCHGFX package to make a least copy it to a touchGFX source directory?
In the STMicroelectronics.X-CUBE-TOUCHGFX.4.21.0_Configs.xml, last block, i'm able to change the name, but not the directory.
Line 390:
<File Category="source" Condition="sem_gpu2d_enabled & oswrapper_threadx" Name="target/generated/nema_hal.c" Version="4.21.0"/>
Changing the "Name" indeed change the name generated, but the directory is ignored!
2023-01-10 12:46 AM
Hello,
The STMicroelectronics.X-CUBE-TOUCHGFX.4.21.0_Configs.xml file contains the config of what we call the TouchGFX Generator, which is a pack of CubeMX.
In the line you highlighted, you can see that there is a condition : "sem_gpu2d_enabled & oswrapper_threadx". That means that, to generate the nema_hal.c file inside the target/generated/nema_hal.c, you need to enable GPU2D (sem_gpu2d_enabled) and ThreadX (oswrapper_threadx), inside CubeMX.
So if this condition is not true, CubeMX will never generate this file in this directory.
The fact that nema_hal.c exists inside your Core directory is because it is integrated by default in our TBS, so every time you create a project on F412-G starting from TouchGFXDesigner, this file will be included there.
To be honest, I don't really understand why that is an issue for you, and why you want to put this file in target/generated, if you are not using GPU2D and ThreadX.
/Yoann
2023-01-10 01:12 AM
It is not a issue. It is just that I do not like to have a source file, in a header directory. Moreover when the source file is not used at all. So I was wondering if it was possible to avoid this. Putting it in the directory it would be use seems a solution.
But indeed, it is not a major problem
2023-01-10 04:13 AM
Then, you can simply move those files to the folder manually, or delete them.
That is the best solution for your case.
/Yoann