cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX + CubeMX + CubeIDE integration problems - please help

zak83
Associate II

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

26 REPLIES 26
ScubaBoy
Associate II

@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.

Thanks for the input, Scuba!

Mon2
Senior III

@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 II

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)

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

Already Included

Here i enclosed the Image

0690X000009YKmnQAG.jpg

Yeah, those methods are a part of the Discovery Firmware pack. You need to add it manually ( _discovery.c and _ts.c). Also the include path, of course.

/Martin

zak83
Associate II

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

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

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