cancel
Showing results for 
Search instead for 
Did you mean: 

B-U585I-IOT02A Undefined reference HAL_I2C

Nicolas_G
Associate II

Dear Experts,

I'm currently working on a project involving an STM32 board (B-U585I-IOT02A). I would like to use this board as a TCP Server. Therefore, from the STM32CUBEIDE application, I had observed that there is an example project in which it is possible to render this board as a TCP Server (Nx_TCP_Echo_Server). However, my problem was that it only returns the value returned by the TCP Client. So, I wanted to modify this program so as to be able to retrieve the temperature parameters. So, I created a program based on an example (https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Step4_Sensors_usage). I wanted to combine these two programs to retrieve the temperature data.

To sum up, the diagram is as follows:

Nicolas_G_0-1707315922146.png

Unfortunately, I've encountered errors in the program's implementation. It gives me the following errors:

Nicolas_G_2-1707315922156.png

The project architecture is as follows:

Nicolas_G_6-1707315969626.png

 

What I've noticed is that when I access the function where the error occurs (e.g. HAL_I2C_GetState), I'm able to access the .c file, as shown in the following image:

Nicolas_G_3-1707315922158.png

Other modifications include:

Nicolas_G_4-1707315922162.png

Nicolas_G_5-1707315922165.png

 

I don't really understand why I'm getting these errors, because when I ctrl + click on the function with the error, it opens the .c file with the appropriate function.

Would it be possible to help me solve this error?

Thanks for your help,

Nicolas Gnanalingam

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

In project settings -> C/C++ General -> Paths and Symbols -> Source Location, ensure that the HAL library source code file path is in there.

When you compile the project, ensure stm32_*_i2c.c is being compiled.

In your *_hal_conf.h file, ensure the I2C module is being enabled.

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

View solution in original post

2 REPLIES 2

I'm afraid your Project screenshot is too low-resolution to read.

It's best to post the build output as for source code: using the </> button - not as screenshots:

AndrewNeil_0-1707317540908.png

 

TDK
Guru

In project settings -> C/C++ General -> Paths and Symbols -> Source Location, ensure that the HAL library source code file path is in there.

When you compile the project, ensure stm32_*_i2c.c is being compiled.

In your *_hal_conf.h file, ensure the I2C module is being enabled.

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