Forum: ARM programming with GCC/GNU tools Error while using the FreeRTOS Demo for LPC2106

von Rushikesh (Guest)

Rate this post
0 useful
not useful

I was testing the WinARM samples.
I was able to compile the FreeRTOS demo.

After building successfully, I added following lines to main.c file of

float f;
f = atof("1.12");

And now make does give following error:

mallocr.o): In function `_malloc_r':
mallocr.c:(.text+0x40c): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x4b4): undefined reference to `_sbrk_r'
freer.o): In function `_malloc_trim_r':
mallocr.c:(.text+0x48): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x64): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x84): undefined reference to `_sbrk_r'
collect2: ld returned 1 exit status
make: *** [rtosdemo.elf] Error 1

I have to use the atof function in my code, so I was testing it.

What should I do to remove this error.


Rushikesh Shingnapurkar

von Jim K. (ancaritha)

Rate this post
0 useful
not useful
Rushikesh wrote:
> mallocr.c:(.text+0x84): undefined reference to `_sbrk_r'

You have to include a file for newlib that provides the definition for
_sbrk_r.  If you do a search on these forums you should find your
answer.  I'd post the exact thread if I could find it.  You can also
check the examples in the WinARM folder for syscalls.c.  Thats the file
you'll need (at least thats what it was on the AT91 series, but I don't
think it should be any different for LPC).


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.