Showing results for 
Search instead for 
Did you mean: 

TouchGFX STM32CubeIDE and USB Device Configuration Error

Associate II


I'm using STM32F429I-DISCO board and I'm newbie in TouchGFX Designer. I created an app that contains graph and when the graph is clicked, i want to send data through usb virtual com port. I followed these steps:

1- Started TouchGFX Designer, created the design and added click interaction to the graph with virtual function action.

2- Generated the code and included the project to STM32CubeIDE by double clicking ".project" file in the STM32CubeIDE directory

3- Dragged and dropped the relevant ".ioc" file to the workspace by linking them relative to project location.

4- Renamed the ".ioc" file with the workspace name since STM32CubeIDE expects the same name with the workspace folder. I renamed it from STM32CubeIDE by right-clicking on it, not directly from the filesystem. Original name of the ".ioc" file was "STM32F429I_DISCO_REV_E01.ioc", I renamed it to "STM32F429I-DISCO.ioc"

5- I opened the ".ioc" file and enabled freertos reentrant then generated the code and uploaded.

So far so good, I was able to see the graph on my TFT screen. Then to enable USB Virtual COM, I followed these steps:

1- Enabled Connectivity > USB_OTG_HS from Internal FS PHY with Device Only mode.

2- Selected Communicaton Device Class from Middlewares > USB_DEVICE

3- Generated the code

After all that, code generation was fine but IDE was not able to find USB files. Related files are created 1 level up from the workspace folder. So I added these paths to Project > Properties > C/C++ General > Paths and Symbols





After all that, I built the project and get these errors:

c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: ./Application/User/main.o: in function `StartDefaultTask':

C:/TouchGFXProjects/Graph/Core/Src/main.c:946: undefined reference to `MX_USB_DEVICE_Init'

c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: ./Application/User/stm32f4xx_it.o: in function `OTG_HS_IRQHandler':

C:/TouchGFXProjects/Graph/Core/Src/stm32f4xx_it.c:186: undefined reference to `hpcd_USB_OTG_HS'

c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/Graph/Core/Src/stm32f4xx_it.c:186: undefined reference to `HAL_PCD_IRQHandler'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:90: STM32F429I-DISCO.elf] Error 1

I read this thread but it was no good for me.

I use TouchGFX 4.21.1 and STM32CubeIDE 1.12.0. How can I implement different peripherals using STM32CubeIDE and TouchGFX interchangeably?