NPEDUCATIONS, Electronic circuits development, electronics tutorials, microcontroller tutorials and projects, advanced microcontroller (ARM) based tutorials and projects, Embedded c development, Embedded c for ARM cortex M, Intel IoT based projects, IoT projects, CC3200 launch pad projects, MSP430 Launchpad tutorials and projects, Tiva C launch pad tutorials and projects, 8051 tutorials and projects, sensor interfacing with microcontroller tutorials, data communications and networking tutorials, peripheral interfacing with microcontroller, led message scrolling display, arduino based tutorials and projects, intel galileo based tutorials and project, ADC interfacing tutorials, LED Blinking, LCD interfacing, Embedded System tutorials and projects, B.tech projects, M.tech projects, online Embedded C training

Error : L6218E: Undefined symbol PCLK (referred from 2440lib.o).


Why this Error Occurred?
This error “L6218E: Undefined symbol” is occurred during the linking process of your application. The linker is reporting that your application does not include a PCLK variable.
Actually I have define a header file Option.h. In which i have written some code regarding PCLK as shown below
//use variable
#ifdef GLOBAL_CLK
            U32 FCLK;
            U32 HCLK;
            U32 PCLK;
            U32 UCLK;
#else
            extern unsigned int FCLK;
            extern unsigned int HCLK;
            extern unsigned int PCLK;
            extern unsigned int UCLK;
#endif




Now I am accessing the variable PCLK directly in the main function. When you compile your main program it would not compile this Option.h file. This is because GLOBAL_CLK is not defined in the main function. Note that the working of #ifdef - #else - #endif is similar to the ordinary if-else control instructions in C.
To clear this error in your application, just add the following code in the main program.
#define            GLOBAL_CLK                    1
Note that this should be added to main file as First Line as shown in below figure



Three common reasons for the occurrence of Error :
L6218E: Undefined symbol <symbol> (referred from <objname>).
<objname> refers to <symbol>, but <symbol> is not defined anywhere.  You must either provide a definition of <symbol> or remove the reference to <symbol>.
There are three common examples where this occurs:

            1) Undefined symbol __ARM_switch8 or __ARM_ll_<xxxx> functions
These functions have been moved and are now contained in the h_... libraries (h indicates that these are compiler helper libraries, rather than standard C library code).  Please ensure that these libraries can be found by the linker.

2) Undefined symbol __rt_embeddedalloc_init (referred from entry.o)
The function __rt_embeddedalloc_init() was used in SDT embedded projects to set up a heap.  This is no longer needed in RVCT projects, so the call to it must be removed.  You should also remove your implementation of __rt_heapdescriptor() (if there is one).

3) This error may occur when attempting to refer to a function/entity in C from a function/entity in C++. This is caused by C++ name mangling, and can be avoided by marking C functions ‘extern "C"’


0 comments :

Post a Comment

Thanks for visiting NPEDUCATIONS. We will contact you soon

0 comments :

Post a Comment

Thanks for visiting NPEDUCATIONS. We will contact you soon

If you really like this tutorial, Don't forget to give the comment or please subscribe to the RSS feed by submitting your E-mail or like our Facebook page.
Related Posts Plugin for WordPress, Blogger...

 
Powered by Blogger