AnsweredAssumed Answered

Compilation problems for stm32

Question asked by ru.r on Jan 18, 2012
Latest reply on Jan 18, 2012 by ru.r
I have set up my toolchain under WinXP like that:

1. downloaded codesourcery LITE g++, installed it
2. downloaded Eclipse with C/C++ support
3. downloaded GNU ARM PLUGIN for Eclipse, and installed it from Eclipse directly

after that i could see the code sourcery toolchain in my settings file, i.e. all set up fine.

now i do the following:

1. i create the empty project with some very simple main.c which adds numbers.

2. i download the version 3.5.0 peripheral access library from  st.

3. i copy the following files from that library to my project folder:

stm32f10x.h
system_stm32f10x.h
core_cm3.h

and then i of course include them in project, as well as include "stm32f10x.h" file from the main.c file.

then i copy the following startup file from that peripheral library:
startup_stm32f10x_hd.s

i also include the basic linker script with memory mapping for HD devices.

the linker script looks like this:
MEMORY
{
    sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 64k
    flash (RX) : ORIGIN = 0x08000000, LENGTH = 512k
}
 
SECTIONS
    .text :
    {
        . = ALIGN(4);
        _text = .;
        PROVIDE(stext = .);
        KEEP(*(.isr_vector))
        KEEP(*(.init))
        *(.text .text.*)       
        *(.rodata .rodata.*)       
        *(.gnu.linkonce.t.*)
        *(.glue_7)
        *(.glue_7t)
        *(.gcc_except_table)
        *(.gnu.linkonce.r.*)
        . = ALIGN(4);
        _etext = .;
        _sidata = _etext;
        PROVIDE(etext = .);  
            _fini = . ;
                *(.fini)
 
    } >flash
 
    .data : AT (_etext)
    {
        . = ALIGN(4);
        _sdata = .;
        *(.ramfunc .ramfunc.* .fastrun .fastrun.*)
        *(.data .data.*)
        *(.gnu.linkonce.d.*)
        . = ALIGN(4);
        _edata = .;
    } >sram
         
        .ARM.extab :
        {
            *(.ARM.extab*)
        } >sram
         
        __exidx_start = .;
        .ARM.exidx :
        {
            *(.ARM.exidx*)
        } >sram
        __exidx_end = .;
         
    .bss (NOLOAD) : {
        . = ALIGN(4);
        /* This is used by the startup in order to initialize the .bss secion */
        _sbss = .;
        *(.bss .bss.*)
        *(.gnu.linkonce.b.*)
        *(COMMON)
        . = ALIGN(4);       
        _ebss = .;
    } >sram
     
    end = .;
    PROVIDE( _estack = 0x20010000 );
}


but during compile it gives me errors like:
undefined reference to _fstat etc...

in the project properties i did browse and pointed it to the .ld linker script shown above...

so what could be a problem?

Outcomes