Skip to main content
ksjfhasiudfhask;dfhas
Associate
January 30, 2023
Question

Having trouble compiling shared code

  • January 30, 2023
  • 1 reply
  • 1213 views

I am working with one other engineer on a project. He will send me his entire directory where the project files are stored. I copy those files into identically named directory structure on my computer so I don't need to change the include paths. Sometimes I am able to compile them, sometimes I get hundreds of compile errors. Eventually, the IDE will just compile them correctly. I have no idea what is changing or why it suddenly works. I am thinking that the way we are sharing files causes something to think it is compiled correctly and is current, but it isn't and I get errors and eventually I tinker with it enough that it decides it needs to recompile the file that isn't working. Cleaning, refreshing, update with modified files doesn't work.

Here's the tail end of the errors (I didn't think every needed to see all 200; it seems to be mostly if not exclusive the HAL includes from what I can tell)

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:57: undefined reference to `HAL_UARTEx_SetTxFifoThreshold'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:61: undefined reference to `HAL_UARTEx_SetRxFifoThreshold'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:65: undefined reference to `HAL_UARTEx_DisableFifoMode'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: ./Application/User/Core/usart.o: in function `MX_USART1_UART_Init':

C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:113: undefined reference to `HAL_UART_Init'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:117: undefined reference to `HAL_UARTEx_SetTxFifoThreshold'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:121: undefined reference to `HAL_UARTEx_SetRxFifoThreshold'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usart.c:125: undefined reference to `HAL_UARTEx_DisableFifoMode'

c:\st\stm32cubeide_1.11.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\arm-none-eabi\bin\ld.exe: ./Application/User/Core/usb_otg.o: in function `MX_USB_OTG_HS_PCD_Init':

C:/TouchGFXProjects/PS_8000_CM7/CM7/Core/Src/usb_otg.c:52: undefined reference to `HAL_PCD_Init'

collect2.exe: error: ld returned 1 exit status

make[1]: *** [makefile:87: Riverdi_70STM32H7_CM7.elf] Error 1

make: *** [makefile:80: all] Error 2

"make -j4 all" terminated with exit code 2. Build might be incomplete.

13:51:14 Build Failed. 200 errors, 3 warnings. (took 8s.548ms)

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
January 30, 2023

Linker side errors

Those look like it is not building the UARTEX file (stm32h7xx_hal_uart_ex.c), check what's in the stm32h7xx_hal_conf.h

Or it is built in a CM4 fork rather than the CM7 one

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..