Problem with LPC804 library files

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Problem with LPC804 library files

跳至解决方案
3,799 次查看
TDC1333
Contributor III

Hello,

I am using LPC804 microcontroller, I am using keli v5.36. the problem i am facing is i have made a simple project and called  only SystemInit() function in main(). The error is showing as

.\Objects\FLPG_7SEG_LPC804.axf: Error: L6218E: Undefined symbol g_Fro_Osc_Freq (referred from system_lpc804.o).

.\Objects\FLPG_7SEG_LPC804.axf: Error: L6218E: Undefined symbol g_LP_Osc_Freq (referred from system_lpc804.o).

Please help me in resolving the problem and what library file should i include in my project.

Thank you.

标签 (5)
标记 (3)
0 项奖励
回复
1 解答
3,769 次查看
frank_m
Senior Contributor III

As said, I have neither a LPC804 board nor the Keil environment.

Did you try a file search (*.c;*.h;*.asm) for the variable name g_Fro_Osc_Freq ?

Where is the variable g_LP_Osc_Freq defined, which does not cause linker errors ?

> does that mean i have to defined it?

While this is an option, this seems like working around the way Keil organizes it's BSPs to me. I would rather try to find out how the Keil IDE/environment manages this things.

Many symbols (functions, variables) are introduced via the startup file, which is usually assembler code. Are you sure you are using the right one in your project ?

在原帖中查看解决方案

0 项奖励
回复
7 回复数
3,780 次查看
TDC1333
Contributor III

Thank You @frank_m Sir for your responce.

 

/*!
* @file LPC804
* @version 1.0
* @date 2018-01-09
* @brief Device specific configuration file for LPC804 (implementation file)
*
* Provides a system configuration function and a global variable that contains
* the system frequency. It configures the device and initializes the oscillator
* (PLL) that is part of the microcontroller device.
*/

#include <stdint.h>
#include "fsl_device_registers.h"

extern volatile uint32_t g_Fro_Osc_Freq;
extern volatile uint32_t g_LP_Osc_Freq;

This is they have metioned an extern but not the original declaration.

does that mean i have to defined it?

Thank You.

0 项奖励
回复
3,770 次查看
frank_m
Senior Contributor III

As said, I have neither a LPC804 board nor the Keil environment.

Did you try a file search (*.c;*.h;*.asm) for the variable name g_Fro_Osc_Freq ?

Where is the variable g_LP_Osc_Freq defined, which does not cause linker errors ?

> does that mean i have to defined it?

While this is an option, this seems like working around the way Keil organizes it's BSPs to me. I would rather try to find out how the Keil IDE/environment manages this things.

Many symbols (functions, variables) are introduced via the startup file, which is usually assembler code. Are you sure you are using the right one in your project ?

0 项奖励
回复
3,764 次查看
TDC1333
Contributor III

Thank You sir for your response

now i am getting this error 

.\Objects\test.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.

0 项奖励
回复
3,754 次查看
frank_m
Senior Contributor III

"SCT" are so-called scatter files, which are the link scripts of Keil's toolchain. I don't have experience with those.

I am not sure what you are trying to achieve, and where your project comes from. Usually, a project created by or for an IDE contains the proper sources, includes, startup code and linker files for the selected MCU (or board).

Linker errors and linker script / SCT errors suggest you took an example for another MCU, or even another toolchain. Such an approach proves very difficult with most toolchains.

The best option is either to use an existing example for the exact MCU (or board) and toolchain, or create a new project for the proper MCU. This will setup a proper project, often with an empty main() function.

You can add your specific code from here on.

0 项奖励
回复
3,748 次查看
TDC1333
Contributor III

Thank You sir for your response, I found my mistake, i was using wrong software package.

Thank You.

0 项奖励
回复
3,745 次查看
frank_m
Senior Contributor III

As said, Keil has a good forum as well, dedicated to it's uVision toolchain. For very specific issues, they are probably the better option. I would even consider them the better toolchain, with a quite commercial price tag, though...

 

 

0 项奖励
回复
3,785 次查看
frank_m
Senior Contributor III

I neither have a LPC804 board, nor do I use the Keil toolchain. The methodology is the same, though.

> L6218E: Undefined symbol g_Fro_Osc_Freq (referred from system_lpc804.o).

Check where a variable named g_Fro_Osc_Freq is referenced in this source (system_lpc804.c). There are probably comments describing how and where it is defined, or supposed to come from. For many BSPs, the source is a board-specific header. Perhaps you forgot an include.

While it would be easy to define and set this variable in your own code, I would try to find out how the Keil environment organizes such board-specific settings.

Keil has a good and active forum as well, by the way.

0 项奖励
回复