/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / add_to_Circle error

Username:     
Password:     
             

Forum

# 1   2010-01-18 14:09:58 add_to_Circle error

logictechs
Member
Registered: 2009-05-07
Posts: 68

add_to_Circle error

Hi,

I'm receiving the following error when I run the add_to_Circle.bat file in my release folder of a project that says it compiled correctly:

Linking file Application.o...
Link Failed (file: 'Application.o')d:/program files/raisonance/ride/arm-gcc/bin/
../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a
-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x12): undefined reference to `_sbrk'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-gettimeofdayr.o): In function `_ge
ttimeofday_r':
gettimeofdayr.c:(.text+0x14): undefined reference to `_gettimeofday'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r':

writer.c:(.text+0x16): undefined reference to `_write'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':

closer.c:(.text+0x12): undefined reference to `_close'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':

fstatr.c:(.text+0x14): undefined reference to `_fstat'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r
':
isattyr.c:(.text+0x12): undefined reference to `_isatty'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r':

lseekr.c:(.text+0x16): undefined reference to `_lseek'
d:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../.
./../../arm-none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x16): undefined reference to `_read'
collect2: ld returned 1 exit status

         !!! Error 103: Fatal error detected. Terminating program.
Press any key to continue . . .

Offline

 

# 2   2010-01-18 16:44:00 add_to_Circle error

matloub
Member
Registered: 2008-02-21
Posts: 98

Re: add_to_Circle error

Hi

Even if your application compiled without problem, you can still have an error when
adding the appliaction to circleos because there it is needed make a link.
In such case you have to verify you are working with latest version of tools
Ride7 RKit-ARM and CircleoS.
Then verify that the application is compatible with these latest tools.

Also this error can appears in some case because of estdio library mismatch.
The problem has been fixed but is not released yet.
When this is the case changing LD linker librairies: putchar option and or printf
can solve the conflict.

Regards
Matloub

Offline

 

# 3   2010-01-18 18:16:56 add_to_Circle error

logictechs
Member
Registered: 2009-05-07
Posts: 68

Re: add_to_Circle error

I have the latest Ride and CircleOS.

When is the fix going to be released?

Are you saying to disable the putchar and printf options?  My program is in need of them.  It won't compile correctly with them not set to yes.

Offline

 

# 4   2010-01-19 10:27:24 add_to_Circle error

matloub
Member
Registered: 2008-02-21
Posts: 98

Re: add_to_Circle error

Hi

I do not know if the problem you have is the one I am thinking about.
I was just saying that it looks pretty like it could be.

This problem is not easy to identify because it depends on the library you are using or not
but also on the function you are calling in your program and even on the order which
functions are called.

I was not clear on what I would like you to try,
can you test to use putchar option with different value of printf option.
In some case it was enough to solve the issue.

Regards
Matloub

Offline

 

# 5   2010-01-19 12:22:38 add_to_Circle error

logictechs
Member
Registered: 2009-05-07
Posts: 68

Re: add_to_Circle error

I have tried all three options already and had the same result.  I use the option to use the old precompiled library.  If I do not, it generates the incompatible header error.  I cannot find all the files I need to put in my project directory though.

Offline

 

# 6   2010-02-22 07:27:08 add_to_Circle error

perg
New member
From: Umea
Registered: 2010-01-26
Posts: 1

Re: add_to_Circle error

Hello,

I had exactly the same problem. The problem is very easy to reproduce. I use a complete clean RIDE7 installation BN28, CD_STM32-Primer_BN28.zip.

Start a new primer2 application. Call the function "sprintf" as an example.  (uart0_putchar and small printf option selected)

The application will work fine in debug mode, i.e when loaded in Primer2 from RIDE7. but when called from add_to_Circle.bat the linking will fail.

The function needed are included in syscalls.c,, but the strange part is that if I compile syscalls.c together with my application and make a lib of them the linking still fails. It seems that the Circle_mgr program only link the functions that are part of the application.o  (though it is in a .lib file with both Appplication.o and syscalls.o)

I tested to move the missing function in linking from syscalls.c, _sbrk into Application.c and then the linking works fine.

When using a lib, It seems that only functions that is implicit called from with within Application.o are linked. To prove this I tested to call one of the functions that couldn't be linked (_ttyisa) from within Application.c  and the linking works for that function.

It seems that there is some strange behavior of the linking performed by circle_mgr.exe that makes the linking fail if the functions needed are not called from within Application.o.

(My guess is the above problem has something to do that the sbrk has been moved to a separate library and the circle_mgr don't include that if needed.)

(An easy way to make a workaround is in the beginning of the Application.c call
syscalls.c; #include "syscalls.c". This will make the linking work. To add the syscall.o in in a lib didn't work for me. Note the difference)

Per

Offline

 

Board footer