cancel
Showing results for 
Search instead for 
Did you mean: 

Error while compiling with a new cubeIDE project(STM32F429I-DISCO)

Adel Benhamida
Associate II

I have generated a new CUBEIDE Project (STM32F429I-DISCO) with help of CUBEMX and i configured the LTDC with SPI5,CS,WR....etc, and i selected Touchgfx for designing the UI, i designed a simple UI, but when i try to compile the code i get 3 errors :

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Startup/startup_stm32f429zitx.s:113: undefined reference to `main'

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Src/stm32f4xx_it.c:205: undefined reference to `hltdc'

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Src/stm32f4xx_it.c:219: undefined reference to `hdma2d'

I DID NOT WRITE ANY CODE YET, i just wanted upload the UI to the board.

15 REPLIES 15
Markus GIRDLAND
ST Employee

Martin Kjeldsen in the TouchGFX team has a great guide to get started with CubeIDE and TouchGFX right here:

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

Adel Benhamida
Associate II

I've watched this video, but this video was for the STM32F746G-DISCO board, I tried it but it didn't work, my board is the STM32F429I-DISCO Board

What kind of issues are you looking at currently - Maybe i can add some text on how to get this board working if it has issues as well? I would expect the procedure to be somewhat similar since it's also a parallel RGB LCD. But since the project generation could be different...

Thanks!

/Martin

Adel Benhamida
Associate II

I have compiling issues, if you go check it you will find the same error, generate a project for the STM32F429I-DISCO with STM32CubeIDE and use TouchGFX for designing the UI, first of all before you add any code and you try to generate the UI using TouchGFX you will see an error within TouchGFX (Can't Generate Source Code Error) which can be resolved by changing the PostGenerate attribute..., after this, you design your UI and save it and try to compile the project without adding any code you will get 3 errors :

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Startup/startup_stm32f429zitx.s:113: undefined reference to `main'

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Src/stm32f4xx_it.c:205: undefined reference to `hltdc'

C:/Users/po4A/STM32CubeIDE/workspace_1.0.0/de/Debug/../Src/stm32f4xx_it.c:219: undefined reference to `hdma2d'

i hope you do a video guide on setting up the IDE with touchgfx for the STM32F429I-DISCO BOARD.

Thanks

You've selected a C project and not a C++ project (TouchGFX is C++ - hltdc is defined in BoardConfiguration.cpp, main from main.cpp, etc).

/Martin

The problem is when i try to create a C++ Project with STM32CubeIDE, i see a lot files have .C extension including (main.c) and that means it creates a c project instead of c++ one, what's the problem here ?

My STM32CubeIDE Version : 1.0.0, Build: 2872_20190423-2022 (UTC)

Cube firmware drivers are written in C. That won't change even when selecting a C++ project. You will still be able to compile the .c driver files, don't worry! Your CubeIDE project will configure both C and a C++ compiler when selecting C++, whereas you will only define a C compiler for C-projects - This leads to .cpp files being ommitted from compilation (no errors reported though - other than linker errors because important symbols to touchgfx reside in cpp).

/Martin

Zcj
Associate II

Hi, I met the same problem several days ago ,yesterday night I found the cause of this problem.

After “clean project�?, the directory of the project source file was missing, the file path under "/test/core " is missing.After manually adding the path "/test/core", the problem is solved. 0690X000008iOeYQAU.png  :face_with_tears_of_joy:I hope you can understand my poor english:face_with_tears_of_joy: 0690X000008iOedQAE.png

Hi @Zcj​ 

Glad you found the problem. Your english is great :)