Problem with LPC804 library files

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with LPC804 library files

Jump to solution
2,196 Views
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.

Labels (5)
Tags (3)
0 Kudos
1 Solution
2,166 Views
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 ?

View solution in original post

0 Kudos
7 Replies
2,177 Views
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 Kudos
2,167 Views
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 Kudos
2,161 Views
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 Kudos
2,151 Views
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 Kudos
2,145 Views
TDC1333
Contributor III

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

Thank You.

0 Kudos
2,142 Views
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 Kudos
2,182 Views
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 Kudos