cancel
Showing results for 
Search instead for 
Did you mean: 

How to compile a project using touchGfx for target, not simulator ?

LVers.1
Associate III

I'm working on a project using touchGfx and expected to be running on a WB55 processor (this is not important, except for that there is no WB55 based existing demo for touchGfx).

So i used STM32MX to configure some basic items, amongst which the fact i'm using Touchgfx.

Then i went into TouchGfx Designer to design the UI interface and flow.

The code compile and works perfectly as long as i was building for the simulator.

Now that i"m happy with the result in the simulator, next step is to compile and run for the hardware target based on WB55.

I know i'll soon or later have to write some low level code for instance for the LCD display and the TouchScreen, but i wanted to already get a first compile ( even not working or even with some errors) from STM32IDE. So i went into STM32MX and generate code (again, just in case).

Then i launch STM32IDE, import the project. I can see all the files (core, drivers, middleware, touchGfx) and inside TouchGfx i see all the files i wrote that are running fine with the simulator.

The problem is when i start compiling, almost no files from TouchGfx are being compiled. The drivers compile, the Core compiles, the touchGfx/App/app_toucgfx.c is being compiled. But none of the files inside TouchGfx/generated or TouchGfx/gui or TouchGfx/target are beling build/compiled and of course the build process fails because of undefined references.

So my question is how can i build my project (using touchgfx) from STM32IDE ?

Btw, i also tried to generate the code for IAR (>8.20) and there also all the TouchGfx related files are not compiled (they even don't appear in the project view.

Thanks for any pointers toward a solution.

1 ACCEPTED SOLUTION

Accepted Solutions
LVers.1
Associate III

Sara,

I think i could solve my issue, thanks to you.

As suggested i started a new minimal project to demonstrate the issue and, o suprise, there it works.

So i started to compare that project with my project having the issue and i saw that there were actually 2 .project and 2 .cproject file .

One set of file is located in project/STM32CubeIDE and i believe this is the right place and there was another set of files in project/ (project top level directory). I deleted those 2 files and suddenly it compiles fine from inside STM32IDE !

Thanks for the support. I must admit i was probably too lazy to make the new project by myself, so thanks for pushing me doing it :)

Stay tuned, i'll probably come back very soon with new questions,

Laurent

View solution in original post

11 REPLIES 11
MM..1
Chief III

You dont explain how in MX you add TouchGFX, but cleaner way is create project in IDE , add software pack TouchGFX to project and configure in ioc IDE plugin .

LVers.1
Associate III

thanks for your reply.

> explain how in MX you add TouchGFX

in "pinouts&configuration", under "software packs" categories, i checked X-CUBE-TOUCHGFX 4.17.0

I supose this is what you meant by "add software pack TouchGFX to project and configure in ioc IDE plugin ."

But if i understand correctly, you suggest to first create a project in IDE and then configure it inside MX. I thought the correct way was to create a project in MX and then edit sources in IDE (and create UI in designer).

I must admit i'm still a bit lost in all those configuration tools and files.

To come back to my current issue. Here is the output of the build console (cleaned up and shortened to fit in this post):

17:06:49 **** Build of configuration Debug for project POC_NextGen_Model1 ****

make -j8 all 

arm-none-eabi-gcc "../TouchGFX/App/app_touchgfx.c"

arm-none-eabi-gcc "../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal.c"

arm-none-eabi-gcc "../Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_crc.c"

.... more ../Drivers/... compiles

arm-none-eabi-gcc "../Core/Src/crc.c"

.... more ../Cores/... compiles

arm-none-eabi-gcc -o "POC.elf" @"objects.list"  -mcpu=cortex-m4 -T"C:\projects\STM32Cube\projects\POC\STM32WB55RGVX_FLASH.ld" --specs=nosys.specs -Wl,-Map="POC.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

c:\tools\st\stm32cubeide_1.7.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./TouchGFX/App/app_touchgfx.o: in function `MX_TouchGFX_Init':

C:/projects/STM32Cube/projects/POC/Debug/../TouchGFX/App/app_touchgfx.c:29: undefined reference to `touchgfx_init'

c:\tools\st\stm32cubeide_1.7.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./TouchGFX/App/app_touchgfx.o: in function `MX_TouchGFX_Process':

C:/projects/STM32Cube/projects/POC/Debug/../TouchGFX/App/app_touchgfx.c:38: undefined reference to `touchgfx_taskEntry'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:106: POC.elf] Error 1

"make -j8 all" terminated with exit code 2. Build might be incomplete.

17:06:59 Build Failed. 5 errors, 0 warnings. (took 9s.249ms)

As you can see some Drivers are compiled, as well as some "Cores" stuffs and the file ../TouchGFX/App/app_touchgfx.c But none of the other touchgfx related files gets compiled, although they exists (there are lots of cpp files in TouchGfx/generated, TouchGfx/gui, ... that are not compiled):

0693W00000GYLboQAH.png 

I supose i could try to understand what's missing in the makefiles but i'm pretty there must be some action i should do so that the ecosystem takes cares of this for me. I just can't figure out what i do wrong.

Laurent

MM..1
Chief III

Yes all this tools... IDE have MX plugin inside, then you dont need MX.exe and is more simple dont use it.

Seems as your generated MX project isnt good imported to IDE...

Sara BEN HADJ YAHYA
ST Employee

Hello @LVers.1​ ,

Which CubeMX ( and CubeIDE) version are you using and Could you please share your .ioc file ?

Regards,

Sara.

LVers.1
Associate III

Dear Sara,

i'm using CubeMX 6.30, CubeIDE 1.7.0 ( build 10852_20210715_0634 (UTC)) and TouchGFX designer 4.17.0

Since my last post, i could slightly progress in the sense that it now appears to work when generating for IAR. What i did (i think; i tried so many things) is to

  1. launch MX, configure to generate for IAR,
  2. Generate code from inside MX
  3. open designer
  4. generate code from inside designer (i think this is the important point)
  5. open IAR project
  6. Then all files compiles

I tried the exact same sequence, but with CubeIDE instead of IAR and still no luck, most touchgfx files are simply not compiled from CubeIDE (although they all appear in the project explorer)

Thanks for your support,

Laurent

Sara BEN HADJ YAHYA
ST Employee

Hello @LVers.1​ ,

Did you open TouchGFX Designer with the .part file ?

Regards,

Sara.

LVers.1
Associate III

In the touchGfx folder i have actually 2 touchgfx "designer" files:

  • ApplicationTemplate.touchgfx.part
  • POC_NextGen_Model1.touchgfx

As i was not sure which one to open i tried with both.

Which one should i use ? and what is the purpose of the other one ?

Sara BEN HADJ YAHYA
ST Employee

Hello @LVers.1​ ,

You can use either of them, the .part file is generated by CubeMX and the .touchgfx file is generated by TouchGFX Designer but they are interconnected, you can find more details in the TouchGFX Documentation.

Did you uncheck the "Generate under root" before generating your code with CubeIDE. If not, please try to do so.

If the issue is still there even with the "Generate under root" option is unchecked, please share your project both in IAR and IDE? it will be easier for me to see the issue.

Thanks,

Sara.

LVers.1
Associate III

Sara,

"Generate under root" is not checked.

By sharing my project, you mean sharing the whole directories, including code ?

I don't think this will be allowed by the company. Is it possible to send it to you in private ?

Laurent