Skip to main content
Associate III
May 15, 2025
Question

Linker errors for sensor data processing functions in STM32CubeIDE + TouchGFX

  • May 15, 2025
  • 2 replies
  • 648 views

Hello everyone,

I’m developing an STM32H750 application using STM32CubeIDE and TouchGFX, and I’m trying to integrate a sensor using I2C.

I implemented a sensor driver and added the corresponding source files, but I’m running into linker errors like:

undefined reference to `Sensor_Calc()'

I made sure the source files are included in the build and headers properly referenced, but the errors persist.

If anyone has working examples, suggestions, I’d be grateful.

Thanks for your help!

Additional Info:

  • STM32CubeIDE version: 1.17.0

  • Compiler: arm-none-eabi-gcc 12.3.1

  • Target MCU: STM32H750B-DK

  • Using C++ and TouchGFX framework

2 replies

Nathan_Xi
Associate III
May 16, 2025

Hello @Rafla 

Maybe you can present more details.

It's hard to identify your bug with the information given.

Thanks.

RaflaAuthor
Associate III
May 17, 2025

The code compiles fine on the real target, but when I try to build the TouchGFX Simulator, I get the following error repeatedly:

fatal error: i2c_data.h: No such file or directory

The i2c_data.h file is present in my project under Core/Inc.

It seems the simulator build does not include the folder containing i2c_data.h in its include paths.

MM..1
Chief III
May 16, 2025

You dont show code , but for C++ you maybe skip use right C headers...

Learn how use 

#ifdef __cplusplus
 extern "C" {
#endif
RaflaAuthor
Associate III
May 17, 2025

The code compiles fine on the real target, but when I try to build the TouchGFX Simulator, I get the following error repeatedly:

fatal error: i2c_data.h: No such file or directory

The i2c_data.h file is present in my project under Core/Inc.

It seems the simulator build does not include the folder containing i2c_data.h in its include paths.