1

I have been following along with this documentation for interfacing a digital camera module with an stm32f746g-disco board:

Link to documentation

The part I am following specifically is pgs 60-74.

Everything ran fine up until page 68, after completing the steps shown on 68-74 when I compiled I got the following errors:

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:C:/Users/Garrett/STM32CubeIDE/workspace_1.6.2/DCMI_Project/Debug/../Core/Src/font24.c:85: multiple definition of `Font24_Table'; ./Core/Src/font24.o:C:/Users/Garrett/STM32CubeIDE/workspace_1.6.2/DCMI_Project/Debug/../Core/Src/font24.c:85: first defined here

and

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:(.data.Font24+0x0): multiple definition of `Font24'; ./Core/Src/font24.o:(.data.Font24+0x0): first defined here

and

collect2.exe: error: ld returned 1 exit status
make: *** [makefile:74: DCMI_Project.elf] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.

I am not sure that this is a linker error, as the Font24_Table and Font24 are declared in the header file and defined in the c file.

Here are the only mentions of the table and font24 in the header

This is the definition of the table in the c file and This is the definition of the font24 in the c file

So I tried to debug as a makefile error, and navigated to the makefile. Multiple sources online said that in the C_SRCS I would probably see the same thing twice, and deleting that would solve my problem. However, I do not see anything repeated.

The makefile I am looking at

Lastly, I thought I would show the project directory, since there are no visible indicators as to where the error is in the project.

Project directory

Sorry if this question was really dense, I have been troubleshooting this problem for a while now, but I am no expert at C or stm32CubeIDE. I would appreciate any help/input, thanks!

beyonson
  • 23
  • 1
  • 8

2 Answers2

0

c:\st\stm32cubeide_1.8.0\stm32cubeide\plugins\xxx\tools\arm-none-eabi\bin\ld.exe: ./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o: in function HAL_UART_Init': C:/xxx/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c:353: multiple definition of HAL_UART_Init'; ./Core/Src/stm32f1xx_hal_uart.o:C:/xxx/Core/Src/stm32f1xx_hal_uart.c:353: first defined here

"multiple definition of 'HAL_UART_Init'" appears when I compile,

The reason I have this problem is that I did define two "HAL_UART_Init"(I accidentally made a copy of a xxx.c file)

I think your main.c and font24.c maybe all define "Font24_Table" function.

hrdom
  • 83
  • 1
  • 7
0

please go through https://gcc.gnu.org/gcc-10/porting_to.html

In STM32CubeIDE, Goto Project Properties-> --> C/C++ Build -->Settings MCU GCC Compiler--> Miscellaneous--> other flags --> Add -fcommon Apply and Close.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 11 '23 at 20:50