Skip to main content
DPark.2
Associate III
October 26, 2020
Solved

have a problem on linker

  • October 26, 2020
  • 2 replies
  • 1615 views

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")

This topic has been closed for replies.
Best answer by Imen.D

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

2 replies

Imen.DBest answer
Technical Moderator
October 26, 2020

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
DPark.2
DPark.2Author
Associate III
October 27, 2020

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.

Technical Moderator
November 4, 2020

Hi @DPark.2​ 

Do you have still this problem to solve?

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
TDK
Super User
October 26, 2020

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""."
DPark.2
DPark.2Author
Associate III
October 27, 2020

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.