Skip to main content
zak83
Associate
June 17, 2019
Question

TouchGFX + CubeMX + CubeIDE integration problems - please help

  • June 17, 2019
  • 26 replies
  • 4682 views

Hi everyone,

I would be extremely grateful if someone help me to move forward.

I have a STM32F469I-DISCO board and I want to make a simple HMI with few screens. Problem I am having is that I am unable to create project that allows me to use three pieces of software (in topic).

I tried to follow Martin KJELDSEN video on 746G-DISCO but since I don't know what are correct MX settings for 469I board I get stuck.

I have already spent like month trying to move forward and I only managed to use Visual Studio to edit gui files and be able to run simulator to see the HMI. But if I wanted to edit back-end of the application I need the CubeIDE.

I am brand new to STM / ARMs, Eclipse and Touch GFX so this definitely doesn't help.

Is there a step by step guide on how to create project?

Or maybe someone has a template project created in CubeIDE for 469I-DISCO board?

Thank you very much in advance.

Zak83

This topic has been closed for replies.

26 replies

Martin KJELDSEN
Principal III
June 17, 2019

Hi Zak,

If you want to get started quick, choose the STM32F469-DISCO Application Template from the TouchGFX designer. It works, but does not have a CubeMX .ioc file. It is based on Cube Firmware drivers, of course, but any change you make is by hand. We've prioritized working on the current issues with integration between touchgfx and cubemx (And now CubeIDE too) rather than creating .ioc files for all boards - That'll come, though.

Hope that helps.

/Martin

ScubaBoy
Associate
June 18, 2019

Hi Zak, Martin,

I've also been trying to setup a working CubeIDE configuration for the STM32F469-DISCO board and encountered similar problems. Being a novice in this area I was making little to no progress so decided to try the suggestion in this tread. I appreciate this is probably any easy task for most but I'm still struggling to get a working build, let me explain what I have done:

1) Used the STM32F469-DISCO application target from the TouchGfx designer.

2) Created an empty project in CubeIDE from (makefile project from existing code) that points to the projected created in step 1.

3) Selected 'Build project' but get the following errors

'wc' is not recognized as an internal or external command,
operable program or batch file.
'wc' is not recognized as an internal or external command,
operable program or batch file.
Converting images
'wc' is not recognized as an internal or external command,
operable program or batch file.
Compiling gui/src/screen1_screen/Screen1Presenter.cpp
The syntax of the command is incorrect.
target/gcc/Makefile:333: recipe for target 'build/ST/STM32469IDISCO/gui/src/screen1_screen/Screen1Presenter.o' failed
make[2]: *** [build/ST/STM32469IDISCO/gui/src/screen1_screen/Screen1Presenter.o] Error 1
target/gcc/Makefile:300: recipe for target 'generate_assets' failed
make[1]: *** [generate_assets] Error 2
target/gcc/Makefile:42: recipe for target 'all' failed
make: *** [all] Error 2

This is the build settings for the project

0690X000008iqwuQAA.png

Have I missed a step?

Also will I be able to use the debug option to step through the code when deployed on the target?

Thanks

Robin

ScubaBoy
Associate
June 18, 2019

OK Resolved make errors just need to update the version of make used by CubeIDE but not sure how to setup debug settings?

ScubaBoy
Associate
June 21, 2019

@Martin KJELDSEN​  I've attached the files hopefully it will be helpful, unfortunately I can't remember the exact line numbers of the differences but I'm sure you will spot them or be able to compare to CubeIDE generated file.

Martin KJELDSEN
Principal III
June 21, 2019

Thanks for the input, Scuba!

Mon2
Senior III
June 25, 2019

@zak83​, hope that you are operational by now but if not...

do you have to use the STM32F469I-DISCO kit? Can your project make use of the STM32F429I-DISCO kit instead?

Please do review this document we wrote after investing similar hours (may be a bit dated but do review):

https://s3.amazonaws.com/axxonshare/my_combo_tutorial.zip

senthil
Associate III
July 2, 2019

When Compile STMF4DISCOCubeIDE in github

i got the Error

How can i solve that ?

20:11:45 **** Incremental Build of configuration Debug for project F4DISCOCubeIDE ****

make -j4 all 

arm-none-eabi-g++ "../Src/OTM8009TouchController.cpp" -mcpu=cortex-m4 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F469xx -DDEBUG -c -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/BSP/Components/ts3510 -I../TouchGFX/generated/texts/include -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Drivers/BSP/Components/exc7200 -I../Drivers/BSP/Components/stmpe811 -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Src -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/BSP/Components/otm8009a -I../Drivers/BSP/Components/Common -I../Middlewares/Third_Party/FatFs/src -I../Drivers/BSP/Components/ampire480272 -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/STM32469I-Discovery" -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/Drivers/BSP/Components/ft6x06" -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/OTM8009TouchController.d" -MT"Src/OTM8009TouchController.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/OTM8009TouchController.o"

arm-none-eabi-g++ "../Src/STM32F4DMA.cpp" -mcpu=cortex-m4 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F469xx -DDEBUG -c -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/BSP/Components/ts3510 -I../TouchGFX/generated/texts/include -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Drivers/BSP/Components/exc7200 -I../Drivers/BSP/Components/stmpe811 -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Src -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/BSP/Components/otm8009a -I../Drivers/BSP/Components/Common -I../Middlewares/Third_Party/FatFs/src -I../Drivers/BSP/Components/ampire480272 -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/STM32469I-Discovery" -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/Drivers/BSP/Components/ft6x06" -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/STM32F4DMA.d" -MT"Src/STM32F4DMA.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/STM32F4DMA.o"

arm-none-eabi-g++ "../Src/STM32F4HAL_DSI.cpp" -mcpu=cortex-m4 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F469xx -DDEBUG -c -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/BSP/Components/ts3510 -I../TouchGFX/generated/texts/include -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Drivers/BSP/Components/exc7200 -I../Drivers/BSP/Components/stmpe811 -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Src -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/BSP/Components/otm8009a -I../Drivers/BSP/Components/Common -I../Middlewares/Third_Party/FatFs/src -I../Drivers/BSP/Components/ampire480272 -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/STM32469I-Discovery" -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/Drivers/BSP/Components/ft6x06" -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/STM32F4HAL_DSI.d" -MT"Src/STM32F4HAL_DSI.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/STM32F4HAL_DSI.o"

arm-none-eabi-g++ "../Src/STM32F4Instrumentation.cpp" -mcpu=cortex-m4 -std=gnu++14 -g3 -DUSE_HAL_DRIVER -DSTM32F469xx -DDEBUG -c -I../TouchGFX/gui/include -I../TouchGFX/generated/fonts/include -I../Drivers/BSP/Components/ts3510 -I../TouchGFX/generated/texts/include -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../TouchGFX/generated/images/include -I../Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/ST/TouchGFX/touchgfx/framework/include -I../TouchGFX/generated/gui_generated/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Drivers/BSP/Components/exc7200 -I../Drivers/BSP/Components/stmpe811 -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Src -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../Inc -I../Drivers/CMSIS/Include -I../Drivers/BSP/Components/otm8009a -I../Drivers/BSP/Components/Common -I../Middlewares/Third_Party/FatFs/src -I../Drivers/BSP/Components/ampire480272 -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/STM32469I-Discovery" -I"D:/Work/STM32CUBEIDE/SMT32F7LCDDisco-master/STMF4DISCOCubeIDE/Drivers/BSP/Components/ft6x06" -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-use-cxa-atexit -Wall -fstack-usage -MMD -MP -MF"Src/STM32F4Instrumentation.d" -MT"Src/STM32F4Instrumentation.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/STM32F4Instrumentation.o"

../Src/OTM8009TouchController.cpp: In member function 'virtual void OTM8009TouchController::init()':

../Src/OTM8009TouchController.cpp:19:5: error: 'BSP_TS_Init' was not declared in this scope

   BSP_TS_Init(LCD_GetXSize(), LCD_GetYSize());

   ^~~~~~~~~~~

../Src/OTM8009TouchController.cpp: In member function 'virtual bool OTM8009TouchController::sampleTouch(int32_t&, int32_t&)':

../Src/OTM8009TouchController.cpp:27:5: error: 'TS_StateTypeDef' was not declared in this scope

   TS_StateTypeDef state;

   ^~~~~~~~~~~~~~~

../Src/OTM8009TouchController.cpp:28:24: error: 'state' was not declared in this scope

    BSP_TS_GetState(&state);

            ^~~~~

../Src/OTM8009TouchController.cpp:28:24: note: suggested alternative: 'static'

    BSP_TS_GetState(&state);

            ^~~~~

            static

../Src/OTM8009TouchController.cpp:28:7: error: 'BSP_TS_GetState' was not declared in this scope

    BSP_TS_GetState(&state);

    ^~~~~~~~~~~~~~~

make: *** [Src/subdir.mk:91: Src/OTM8009TouchController.o] Error 1

make: *** Waiting for unfinished jobs....

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

20:12:01 Build Failed. 6 errors, 0 warnings. (took 15s.552ms)

Martin KJELDSEN
Principal III
July 2, 2019

You have to include touch related .c files in your project for compilation. _discovery.c, _ts.c, i believe, from the cube firmware pack.

/Martin

senthil
Associate III
July 3, 2019

Already Included

Here i enclosed the Image

0690X000009YKmnQAG.jpg

zak83
zak83Author
Associate
August 20, 2019

Hi everyone,

Sorry for no reply from myself but I got sidetracked and was extremely busy.

I have made some progress. It wasn't easy but I managed to get some results.

So:

I created project using CubeMX as per Martin's video (for 746G-DISCO) -> Created some screens in Touch GFX (from within the CubeMX) -> then used ScubaBoy's "modified files" to fix the settings (changed mine to 16-bit colour depth) -> fought with some function visibility in main.cpp -> couple of hours later I had a working display.

But:

Touchscreen wasn't working so I fixed it by using files recommended by Martin (_discovery.c and _ts.c etc.). At this point I was quite happy, however, once I added few more screens it turned out that all images were getting stored in internal flash rather than external. I have tried to edit STM32F469NIHX_FLASH.ld, I added new memory area QUADSPI:

MEMORY
{
 CCMRAM	(xrw)	: ORIGIN = 0x10000000,	LENGTH = 64K
 RAM	(xrw)	: ORIGIN = 0x20000000,	LENGTH = 320K
 FLASH	(rx)	: ORIGIN = 0x8000000,	LENGTH = 2048K
 QUADSPI (r) : ORIGIN = 0x90000000, LENGTH = 16M
}

And also:

ExtFlashSection :	 
	{
	 *(ExtFlashSection ExtFlashSection.*)
 *(.gnu.linkonce.r.*)
 . = ALIGN(0x4);
	} >QUADSPI

Please bear in mind this is my first attempt to edit linker files in my entire life, so I had little if absolutely no idea what I was doing.

After this edit the error that Flash area is to small for the code (something along those lines) disappeared, but also my display stopped working and now it looks like old TV with no antenna attached.

Can someone shed some light on it please? I hope I am quite close to have a working template which could also benefit someone out there!

I would be grateful for any help.

Regards

Zak_83

zak83
zak83Author
Associate
August 21, 2019

Hi,

last night I read through some posts in this forum and got my screen fixed. Problem was a bad configuration settings for QUADSPI external flash memory.

These posts helped me a lot:

https://community.st.com/s/question/0D50X0000AqD8zPSQS/stm32cubeide-and-touchgfx-4100-resolving-compilation-issues

https://touchgfx.zendesk.com/hc/en-us/articles/360019884752-Configuring-STM32F746G-DISCO

Thanks to @Martin KJELDSEN​ and all contributors in above mentioned posts, without you I would still be lost 8).

I have noticed some issues yesterday before I implemented External Flash fix, slide animations (when changing screens) were either not working or working so fast I couldn't see them. I will try again and post results.

Regards

Zak_83

Martin KJELDSEN
Principal III
August 21, 2019

Hi @zak83​,

That's great news! Part of it, anyway :D How does the rest of your application run? If animations seem way too fast there probably is some issues with timing - Maybe the signal from your display is not getting signaled to TouchGFX properly. In this case, you should also see some tearing probably.

/Martin