This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

L6218E Error exported functions

Hi Everyone,
I'm newbie about keil and ARM tools. I have STM32 discovery board and I want to build RTC clock with calendar which is controlled by RS232.

I have a problem when use exported functions which are defined in stm32f10x_XXX.h.

I prapare configration wizard to create STM32_Init.c. Enabled USART and RTC.

I got error message from compiler. "Error: L6218E: Undefined symbol RTC_EnterConfigMode (referred from main.o)."
I search L6218E error code on form and everone said its about defination and library manegment.

I checked project explorer window and check "stm32f10x_rtc.h" file connected to main.c . I can't use any other stm32f10x_XXX.h libraries exported functions too.

This is code which I worked on it. Why I got L6218E ? Could u guide to me for this.

Best regards

/******************************************************************************************/
#include <stm32f10x_lib.h>                        // STM32F10x Library Definitions
#include "STM32_Init.h"                           // STM32 Initialization
#include "stdio.h"
#include "string.h"

int saniye=0;
int dakika=59;
int saat=11;                                     // Time variable saniye-second dakika-minute saat-hour


void SendChar (char text[]) ;    // Send Char to RS232
void SendByte (int byte);                // Send byte to RS232

char aName[] = "RTC over RS232\n\r";
char aTime[] = "Timer \n\r";
char buffer[] = "24 : 59 : 59\n\r";

/*----------------------------------------------------------------------------
  MAIN function
 *----------------------------------------------------------------------------*/
int main (void) {
        stm32_Init ();                                                          // STM32 init
        while (1){
             RTC_EnterConfigMode();  // PROBLEM is HERE. Without this line, Code Worked
                RTC_ExitConfigMode();   // PROBLEM is HERE  Without this line, Code Worked
             
                if(GPIOA->IDR & (u32)(1<<0))                       // Led 4 blink When push Button
                {
                        GPIOC->BSRR=(u32)(1<<8);
                }
                else
                {
                GPIOC->BRR=(u32)(1<<8);
                }
        }
}                                                                                               // end main


void RTC_IRQHandler(void)       //RTC interreupt handler to send Time data RS232 port every second
{
        sprintf (buffer, "%d : %d : %d\n\r", saat,dakika,saniye); // Write Time variable to Buffer
        SendChar(aName);
        SendChar(buffer);

 if (RTC->CRL & (1<<0) ) {                       // check second flag
    RTC->CRL &= ~(1<<0);                         // clear second flag

        if(++saniye>=60){                    // create time value with RTC interrupt and count                            time variale
        saniye=0;
        if(++dakika>=60){
        dakika=0;
        if(++saat>=24)
        saat=0;}
        }
        if(GPIOC->IDR & (u32)(1<<9)){                      //Toggle every  sec LED3
                GPIOC->BRR=(u32)(1<<9);
        }
        else
        GPIOC->BSRR=(u32)(1<<9);
    }
} // end RTC_IRQHandler

void SendChar ( char text[] )
{
         unsigned int  i, len;
         len = strlen(text);
         for(i=0; i<len; i++)
         {
        SendByte(text[i]);
         }

}
void SendByte (int byte)
{
        while (!(USART1->SR & USART_FLAG_TXE));   //Wait for the uart to finish sending the byte.
        USART1->DR = byte;
}


.

Parents
  • "...almost certainly not the latest version; therefore it will not work with current examples on the ST site."

    There has been a great deal of grief discussed in a great many threads on both this & the ST forum about the problems due to trying to use code written for one version of the ST Standard Peripheral Library with a different version.

    I have also suffered this myself.

    For example:

    http://www.keil.com/forum/19540/

    http://www.keil.com/forum/docs/thread19482.asp

    AFAIK, ST only provide their "library" as source - not as a true, ready-built Library.

    Therefore, my recommendation is that you include the necessary source files from the appropriate "library" version in your Project, and build them as part of the project.

    If you wish, you could make a separate Group for the ST files:
    www.keil.com/.../uv4_ca_create_file_groups.htm

    This also has the advantage of giving you source-level debugging in the "library" functions.

    To avoid any risk of confusion, I would delete the ready-built Library & sources from the Keil installation.

Reply
  • "...almost certainly not the latest version; therefore it will not work with current examples on the ST site."

    There has been a great deal of grief discussed in a great many threads on both this & the ST forum about the problems due to trying to use code written for one version of the ST Standard Peripheral Library with a different version.

    I have also suffered this myself.

    For example:

    http://www.keil.com/forum/19540/

    http://www.keil.com/forum/docs/thread19482.asp

    AFAIK, ST only provide their "library" as source - not as a true, ready-built Library.

    Therefore, my recommendation is that you include the necessary source files from the appropriate "library" version in your Project, and build them as part of the project.

    If you wish, you could make a separate Group for the ST files:
    www.keil.com/.../uv4_ca_create_file_groups.htm

    This also has the advantage of giving you source-level debugging in the "library" functions.

    To avoid any risk of confusion, I would delete the ready-built Library & sources from the Keil installation.

Children