Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

tiny libc?

2004-08-21 by Shannon Holland

Hello all,

I'm starting to bump up against the 128KB flash limit in my LPC2106 and 
am looking for ways to make things smaller. Switching to the gnuarm.org 
gcc 3.4.1 and thumb mode (along with adding -Os to my CFLAGS) made 
things more then small enough but the code didn't work. Found a pretty 
explicit codegen bug in some of the FreeRTOS code (definitely NOT a bug 
in FreeRTOS) - yes, I will isolate this some more and report it. If I 
turn off -Os then the code get's big enough (around 20KB larger!) and 
so I don't fit.

Needing to move forward, I went back to gcc 3.3.3 but there with thumb 
mode on I was still way over 128KB (3.4.1's code was much smaller).

I don't need a whole lot from libc, but am including some code that 
does expect reasonable support, at least strings and sprintf. newlib 
looks to be taking around 40-50KB so it's a prime target for reduction. 
I'm rebuilding it now with some options turned on to reduce size, but I 
doubt it will be enough. The reality is that I really don't need fileio 
support, etc for my app.

So, a couple of questions:

1. Has anyone looked at really trimming down newlib?
2. Are there any other c libraries out there that are smaller and 
arm/gcc compatible?

I've found many very small libc's, but they are typically an explicit 
port to a processor (AVR, MSP430, etc). That could certainly be a 
starting point, but I'd rather avoid that much work if I don't need to 
do it!

Thanks for any help!

Shannon

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.