[STM32L496G-DISC0] Project generated from Touch GFX Designer not compileable in CubeIDE (undefined reference to 'LCD_IO_***')
I'm trying to build a Touch Application using the STML496G-DISC0 Board.
I try to create my project using the TouchGFX Designer App, selecting my Board and either a blank or the one matching Template (doesn't make a difference in this case). I can than Generate Code, Run Simulator or Run Target (which also works btw, the Application is successfully flashed onto my Board and i can see whatever i have made inside of the Designer).
However i want to open and edit the Project and write Code and Logic for the GUI with an IDE (STM Cube IDE in my Case). So after i Generate Code from the Touch GFX Designer i open the Project with STM CubeMX to generate a project with STM Cube IDE as target IDE and check the box with 'Generate Under Root'.
The first problem here is that CubeMX is showing me an Error in the Pinout & Configurations tab under Software Packs -> STM X-Cube TouchGFX (i'm using version 4.16.0, since 4.16.1 doesn't seem to be supported by TouchGFX Designer) -> TouchGFX Generator -> Display -> Interface is set to disp_fmc and marked with a pink 'X' (see image below) the only other Option i can choose for this is Custom, which will lead to the same compiling errors in CubeIDE.
Once i have generated my code from CubeMX and open the project in the Cube IDE and try to Build the project it fails with this output:
make -j8 all
arm-none-eabi-g++ -o "STM32L496G-DISCO.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -mcpu=cortex-m4 -T"C:\TouchGFXProjects\L496_Test\STM32L496AGIX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STM32L496G-DISCO.map" -Wl,--gc-sections -static -Wl,--start-group -l:libtouchgfx-float-abi-hard.a -Wl,--end-group -L"C:\TouchGFXProjects\L496_Test\Middlewares\ST\touchgfx\lib\core\cortex_m4f\gcc" -L"C:\TouchGFXProjects\L496_Test\Middlewares\ST\touchgfx\framework\include\touchgfx" -L"C:\TouchGFXProjects\L496_Test\Drivers" -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: Drivers/BSP/Components/st7789h2/st7789h2.o: in function `ST7789H2_Init':
C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:119: undefined reference to `LCD_IO_Init'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:123: undefined reference to `LCD_IO_Delay'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:128: undefined reference to `LCD_IO_Delay'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:133: undefined reference to `LCD_IO_Delay'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: Drivers/BSP/Components/st7789h2/st7789h2.o: in function `ST7789H2_ReadID':
C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:344: undefined reference to `LCD_IO_Init'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: Drivers/BSP/Components/st7789h2/st7789h2.o: in function `ST7789H2_WriteReg':
C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:431: undefined reference to `LCD_IO_WriteReg'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:436: undefined reference to `LCD_IO_WriteData'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: Drivers/BSP/Components/st7789h2/st7789h2.o: in function `ST7789H2_ReadReg':
C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:448: undefined reference to `LCD_IO_WriteReg'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:451: undefined reference to `LCD_IO_ReadData'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:454: undefined reference to `LCD_IO_ReadData'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: Drivers/BSP/Components/st7789h2/st7789h2.o: in function `ST7789H2_DrawHLine':
C:/TouchGFXProjects/L496_Test/Debug/../Drivers/BSP/Components/st7789h2/st7789h2.c:525: undefined reference to `LCD_IO_WriteData'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: TouchGFX/target/TouchGFXHAL.o: in function `TouchGFXHAL::flushFrameBuffer(touchgfx::Rect const&)':
C:/TouchGFXProjects/L496_Test/Debug/../TouchGFX/target/TouchGFXHAL.cpp:183: undefined reference to `LCD_IO_ReadData'
C:\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\bin\arm-none-eabi-ld.exe: TouchGFX/target/TouchGFXHAL.o: in function `TouchGFXHAL::copyFrameBufferBlockToLCD(touchgfx::Rect)':
C:/TouchGFXProjects/L496_Test/Debug/../TouchGFX/target/TouchGFXHAL.cpp:199: undefined reference to `LCD_IO_WriteMultipleData'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:135: STM32L496G-DISCO.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.all the LCD_IO_* functions are declared extern in the st7789h2.h, but aren't defined anywhere i can find.
Once i have Generated the Code from inside CubeMX 'Run Target' from TouchGFX Designer also fails with the same output as Cube IDE.
So how can i resolve this issue? I assume it's some problem with the Linker that doesn't know where to get the LCD_IO_* functions from, but i'm fairly new to the STM Boards and the Cube Apps, so i'm not too sure here.

