EmbDev.net

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


von Rushikesh (Guest)


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

von Jim K. (ancaritha)


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).

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.