cancel
Showing results for 
Search instead for 
Did you mean: 

"No such file or directory" error: STM32F429I-DISC1

LNdungane
Associate II

Greetings All

I am implementing an ADC-based GUI on my board and my code is not building due to the abovementioned error (even when the file exists. I am using STMCubeMX(6.3.0), STM32CubeIDE (1.7.0) and TouchGFX(4.17.0) to develop my GUI. Most of these files are in the simulator folder so I figure there must be a way to omit them as I suspect that they may be giving me problems. This is for my final-year project and I am pressed for a solution. Any assistance will be greatly appreciated.

15 REPLIES 15

How do I solve this problem?

You're going to need to take some ownership of the project and figure out what files should be included and which should not. Exclude or delete files which should not be part of the project.
How did you end up with two main.c files in the first place? How did you generate the project structure?
If you feel a post has answered your question, please click "Accept as Solution".

Hi TDK

I used STMCube​MX and TouhGFX to set the GUI and ADC up so they both compiled codes which are not congruent. Alluding to me taking accountability, it's all I have done (frustratingly) for the past 3 weeks so I asked the question in a suggestive manner. Thank you for the suggestion.

@TDK​  "You have multiple source files redefining functions. Having two main.c files within a project should not happen"

indeed.

Another common cause is to have definitions in headers

The messages tell you where all the multiple definitions are; eg,

c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/main.o: in function `StartDefaultTask':

C:/ST/System/System/STM32CubeIDE/Debug/../Core/Src/main.c:1086: multiple definition of `StartDefaultTask'; ./Application/User/main.o:C:/ST/System/System/Core/Src/main.c:1086: first defined here

So you need to look at those definitions, and decide which one to keep, and which one(s) to get rid of.

@TDK​  "two main.c files"

Ah yes - that does, indeed, seem to be the case:

"c:\st\stm32cubeide_1.6.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/main.o: in function `StartDefaultTask':

C:/ST/System/System/STM32CubeIDE/Debug/../Core/Src/main.c:1086: multiple definition of `StartDefaultTask'; ./Application/User/main.o:C:/ST/System/System/Core/Src/main.c:1086: first defined here

So you have a main.c in ./Application/User/

and another main.c in ./Core/Src/

So you need to look at the two and decide which to keep, and which to get rid of ...

As noted previously, that one change will fix all of those errors