[chbot] Most puzzling arm compilation problem [SOLVED]
Charles Manning
cdhmanning at gmail.com
Fri Oct 2 04:23:26 BST 2015
Hi Robin
In general you really do not need libc for embedded except maybe for printf
(and sprintf if you're outputting to LCD etc).
Have a look at http://pdclib.e43.eu/ and newlib-nano.
On Fri, Oct 2, 2015 at 3:54 PM, Robin Gilks <robin at gilks.org> wrote:
>
> > There are a lot of different libraries you can use with ARM.
> >
> > Newlib is supremely ugly IMHO if you use printf() it pulls in all sorts
> of
> > stuff you really don't want for smaller bare metal apps.
> >
> > printf pulls in a whole streams layer + malloc + airconditioning and hot
> > and cold running water. You just want a banana, but you get the gorilla
> it
> > comes with.
> >
> > If you get overlapping sections it means one of:
> > 1) The code has memory sections the linker script does not understand. It
> > puts them at 0 and overlaps other memory (eg. flash).
> > 2) Trying to stuff in more code/data than you have space.
> >
> > Look at the map file and other outputs from the linker step that normally
> > gives you hints.
> >
> > Another printf worth trying is
> > http://www.sparetimelabs.com/tinyprintf/tinyprintf.php
> >
> >
>
> After a lot of searching of the map file I eventually found that the
> section ".ARM.exidx" was not being allocated space! A patch to the loader
> script put it out of the way in flash.
>
> This is only used for unwinding stacks etc on exception processing in c++
> so I don't need it on my c only project:)
>
> You're right about the size of the printf family brought in from newlib
> which was a surprise - using the BeRTOS sprintf implentation my app was
> 26804 bytes but with the newlib version it was 43676 bytes once I had
> removed the overlap error.
>
> Methinks that I'll look harder for a smaller embedded libc for cortex-m3!!!
>
> Cheers
>
> --
> Robin Gilks
> Internet: robin at gilks.org http://www.gilks.org
> Tel: (+64) (3) 347 4370
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20151002/e2904087/attachment.html>
More information about the Chchrobotics
mailing list