cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined reference in EEPROM emulation package

WSpar.1
Associate III

Hi all,

I'm trying to implement manually the ST EEPROM emulation package.

But I got stuck at a undefined reference:

0693W00000Dq7pRQAR.png 

I included in the right build paths and in the IDE I can perfectly jump to the EE_Init() function.

So the IDE does know where to look, but my compiler doesn't

What can be the problem here?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You need to add all directories with source files in them to the source folders.

Project properties -> C/C++ General -> Paths and Symbols -> Source Location

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

View solution in original post

13 REPLIES 13

What's complaining? The Compiler or the Linker?

The include file tells the compiler what the interface expectations are.

The Linker expects the source files or the libraries containing the actual functions to be part of the project.

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

Ensure the header file declaring EE_Init is included in the include path, and also included prior to using the function in each source file it's used.

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

collect2.exe: error: ld returned 1 exit status

this is the linker right?

ld is the linker yes, still don't see the complete messaging

But, if the linker is complaining you need to add the Eeprom Emulation source code into the project, or the precompiled library.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
WSpar.1
Associate III

0693W00000Dq9a9QAB.png 

This is the current situation.

Included paths top of the list

Included the header file where EE_Init() is in in the main file

Maybe HAL_init doesn't know yet some parts that er needed?

The EEPROM emulator examples ST provided are not made with an .ioc file for CubeIDE Device configuration tool

Yes. But not the whole error message.
If you feel a post has answered your question, please click "Accept as Solution".
WSpar.1
Associate III

Is there maybe an easy way to implement the x-cube-eeprom package?

https://www.st.com/en/embedded-software/x-cube-eeprom.html

It seems that it is not importable into the CubeIDE as a package.

I tried to import the package zip file, but it is missing files.

Maybe it is for an old CubeIDE?

Grant Bt
Senior

That eeprom_emul.c doesn't appear to be part of the build. The folder and/or C file need to have an icon with a little blue thing or else it's ignored. Right->click -> Resource Configurations -> make sure it's not excluded from the build (which it is).

WSpar.1
Associate III

So the C and H in the icon should be a blue solid letter?

I pasted the whole Middlewares folder into my project

When I build the project, the IDE showed the Middlewares folder in the project tree.

When I right click on eeprom_emul.c > Resource Configurations there is no marking in front of Exclude build