cancel
Showing results for 
Search instead for 
Did you mean: 

have a problem on linker

DPark.2
Associate II

I built the project using the STM32CubeExpansion_LRWAN_V1.1.2 example, and I want to use the EEPROM function in LoRa Application.

I am trying to declare eeprom related code in a separate file, but the linker cannot import HAL functions.

.\mlm32l07x01\Lora.axf: Error: L6218E: Undefined symbol HAL_FLASHEx_DATAEEPROM_Erase (referred from eeprom.o).

.\mlm32l07x01\Lora.axf: Error: L6218E: Undefined symbol HAL_FLASHEx_DATAEEPROM_Lock (referred from eeprom.o).

.\mlm32l07x01\Lora.axf: Error: L6218E: Undefined symbol HAL_FLASHEx_DATAEEPROM_Program (referred from eeprom.o).

.\mlm32l07x01\Lora.axf: Error: L6218E: Undefined symbol HAL_FLASHEx_DATAEEPROM_Unlock (referred from eeprom.o).

// eeprom.h
 
#ifndef __USER_EEPROM_H__
#define __USER_EEPROM_H__
 
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
 
// #include "stm32l0xx_hal.h"
// #include "stm32l0xx_hal_def.h"
// #include "stm32l0xx_hal_conf.h"
// #include "stm32l0xx_hal_flash.h"
#include "stm32l0xx_hal_flash_ex.h"
#include "tools.h"
#include "tiny_sscanf.h"
 
// eeprom.c
include "eeprom.h"

​Also, if use "include" the hal.h file or other file to use HAL_Delay, the following warring occurs.

Where am I doing stupid things?

..\..\inc\hw_conf.h(93): warning:  #47-D: incompatible redefinition of macro "assert_param"  (declared at line 312 of "..\..\inc\stm32l0xx_hal_conf.h")

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @DPark.2​ 

The "Undefined symbol" error means that your application does not include object, source or libraries including this function.

You should review the configuration of your project, and the files included. Make sure that your project contains all the required library source files.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

6 REPLIES 6
Imen.D
ST Employee

Hello @DPark.2​ 

The "Undefined symbol" error means that your application does not include object, source or libraries including this function.

You should review the configuration of your project, and the files included. Make sure that your project contains all the required library source files.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
TDK
Guru

Generally you do not include individual HAL files, you only include the top-level file, which in this case would be "stm32l0xx_hal.h". That file will include others as needed, as long as your "stm32l0xx_hal_conf.h" file is correctly configured.

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

Thanks for the answer. Since en.i-cube_lrwan_v1.1.2 does not solve well, the latest version, en.i-cube_lrwan_v1.3.1, is in progress.

I think en.i-cube_lrwan_v1.3.1 also includes the stm32l0xx_hal library, but I'm not sure what the problem is. Let me look for more.

While including the headers commented out in version 1.2.1 one by one, an error that assert_param was declared redundantly appeared, and I thought that the least error was to include that header file, so I did that. As mentioned in 1.3.1, I only included the _hal.h file.

Hi @DPark.2​ 

Do you have still this problem to solve?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Just I use 1.3.1 Library..