Topic : error with the linker of RIDE7

Forum : ARM

Original Post
Post Information Post
April 2, 2008 - 4:48pm
Guest

I have an error message with RIDE7:
c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0xc): undefined reference to `_sbrk'
collect2: ld returned 1 exit status
Could you please let me know what does it mean?
Thank you.

Replies
Post Information Post
+1
0
-1
April 2, 2008 - 5:31pm
Guest

Can you precise what ARM device you are using (STR71x, STR73x, STR75x, STR91x, STM32)?
Did you use some specific functions from the standard C library (functions from stdio, stdlib, etc...)?

Lionel

+1
0
-1
April 2, 2008 - 6:25pm
Guest

>>Can you precise what ARM device you are using (STR71x, STR73x, STR75x, STR91x, STM32)?
I'm using STM32F10x
>>Did you use some specific functions from the standard C library (functions from stdio, stdlib, etc...)?
No

+1
0
-1
April 3, 2008 - 10:34am
Guest

if you can send us a project that reproduces the problem, it will be easier for us to understand where it comes from.

thanks
Lionel

+1
0
-1
April 3, 2008 - 11:34am
Guest

I'm sorry the application uses the calloc, realloc functions. I hope this will be helpful
if not I can send you the project

+1
0
-1
April 3, 2008 - 2:34pm
Guest

Indeed, I think the problem comes from here. Dynamic allocation needs a heap, and you must create and reference it in order for the library to work.
Please also note that we never tested it so it may not work correctly or may even not be implemented by this GNU standard library port, because we never use dynamic allocation ourselves on embedded cpus.

Lionel

+1
0
-1
September 18, 2008 - 10:03am
Guest

Hello,

I have read this post. I am using function calloc as well and I have some problems in execution. I mean, when the fuction calloc is used in the program it goes some strange place of the memory and the program "hangs". Well, I know how the function calloc works in theory, but I think that somethins is missing in my code. Could someone explain how to reserve some space of memory for calloc use or how I should do to use calloc. What a heap is? How can use it?

Thanks,
Santi

+1
0
-1
September 23, 2008 - 12:56am
Guest

santi_add wrote:
What a heap is? How can use it?

That is a really basic question!

If you need to ask that question, you are probably not quite ready to be using dynamic memory allocation - certainly not in an embedded system.

You might like to take a look at the following thread - even though it's a different chip & different toolchain, the principles will be similar:

http://www.luminarymicro.com/component/option,com_joomlaboard/Itemid,92>/func,view/catid,6/id,2660/#2660