Error while using the FreeRTOS Demo for LPC2106

Guest #1172259
Rate this post
• ▲ useful
▼ not useful
Hello,

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
\FreeRTOS_4_0_2\Demo\ARM7_LPC2106_GCC\

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

And now make does give following error:

c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/interwork 
\libc.a(
mallocr.o): In function `_malloc_r':
mallocr.c:(.text+0x40c): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x4b4): undefined reference to `_sbrk_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/interwork 
\libc.a(
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.

Thanks,

Rushikesh Shingnapurkar
#1172260
Rate this post
• ▲ 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).

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.