Skip to main content
Visitor II
May 11, 2025
Solved

Error in build about MX_Init gpio and icache

  • May 11, 2025
  • 2 replies
  • 436 views

Hello!

When I build my project, I get these errors. I should note that the header files are in the driver folder, and I have added all the necessary include paths.

"C:/Users/helat/STM32CubeIDE/workspace_1.18.1/PFA-SecureM/Core/Src/main.c:90:(.text.main+0xc): undefined reference to `MX_GPIO_Init'

C:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.0.202411081344/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/Users/helat/STM32CubeIDE/workspace_1.18.1/PFA-SecureM/Core/Src/main.c:91:(.text.main+0x10): undefined reference to `MX_ICACHE_Init'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:70: PFA-SecureM.elf] Error 1

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

Best answer by TDK

> undefined reference to `MX_ICACHE_Init'

This means that MX_ICACHE_Init has been used prior to its definition. Ensure it is being defined before used.

If this code is directly generated from an IOC, please include that IOC. Otherwise please include your project code files.

2 replies

KnarfB
Super User
May 11, 2025

those are linker errors. check the source folders/files that will be linked. C++ issues?

When I build my project, 

Nobody here knows your project. 

How to write your question to maximize your chance... - STMicroelectronics Community

hth

KnarfB

TDK
TDKBest answer
Super User
May 11, 2025

> undefined reference to `MX_ICACHE_Init'

This means that MX_ICACHE_Init has been used prior to its definition. Ensure it is being defined before used.

If this code is directly generated from an IOC, please include that IOC. Otherwise please include your project code files.

"If you feel a post has answered your question, please click ""Accept as Solution""."