<div dir="ltr"><div><div>Hi Robin<br><br></div>In general you really do not need libc for embedded except maybe for printf (and sprintf if you're outputting to LCD etc).<br><br></div>Have a look at <a href="http://pdclib.e43.eu/">http://pdclib.e43.eu/</a> and newlib-nano.<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 3:54 PM, Robin Gilks <span dir="ltr"><<a href="mailto:robin@gilks.org" target="_blank">robin@gilks.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> There are a lot of different libraries you can use with ARM.<br>
><br>
> Newlib is supremely ugly IMHO if you use printf() it pulls in all sorts of<br>
> stuff you really don't want for smaller bare metal apps.<br>
><br>
> printf pulls in a whole streams layer + malloc + airconditioning and hot<br>
> and cold running water. You just want a banana, but you get the gorilla it<br>
> comes with.<br>
><br>
> If you get overlapping sections it means one of:<br>
> 1) The code has memory sections the linker script does not understand. It<br>
> puts them at 0 and overlaps other memory (eg. flash).<br>
> 2) Trying to stuff in more code/data than you have space.<br>
><br>
> Look at the map file and other outputs from the linker step that normally<br>
> gives you hints.<br>
><br>
> Another printf worth trying is<br>
> <a href="http://www.sparetimelabs.com/tinyprintf/tinyprintf.php" rel="noreferrer" target="_blank">http://www.sparetimelabs.com/tinyprintf/tinyprintf.php</a><br>
><br>
><br>
<br>
</span>After a lot of searching of the map file I eventually found that the<br>
section ".ARM.exidx" was not being allocated space! A patch to the loader<br>
script put it out of the way in flash.<br>
<br>
This is only used for unwinding stacks etc on exception processing in c++<br>
so I don't need it on my c only project:)<br>
<br>
You're right about the size of the printf family brought in from newlib<br>
which was a surprise - using the BeRTOS sprintf implentation my app was<br>
26804 bytes but with the newlib version it was 43676 bytes once I had<br>
removed the overlap error.<br>
<br>
Methinks that I'll look harder for a smaller embedded libc for cortex-m3!!!<br>
<br>
Cheers<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Robin Gilks<br>
Internet: <a href="mailto:robin@gilks.org">robin@gilks.org</a>    <a href="http://www.gilks.org" rel="noreferrer" target="_blank">http://www.gilks.org</a><br>
Tel:      <a href="tel:%28%2B64%29%20%283%29%20347%204370" value="+6433474370">(+64) (3) 347 4370</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>