<div dir="ltr"><div><div>There are a lot of different libraries you can use with ARM.<br><br></div>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.<br><br></div><div>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.<br><br></div><div>If you get overlapping sections it means one of:<br></div><div>1) The code has memory sections the linker script does not understand. It puts them at 0 and overlaps other memory (eg. flash).<br></div><div>2) Trying to stuff in more code/data than you have space.<br><br></div><div>Look at the map file and other outputs from the linker step that normally gives you hints.<br></div><div><br>Another printf worth trying is <a href="http://www.sparetimelabs.com/tinyprintf/tinyprintf.php">http://www.sparetimelabs.com/tinyprintf/tinyprintf.php</a><br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 11:58 AM, 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"><br>
> All this works fine when compiled for the AVR but on the ARM I get the<br>
> following problem. No idea what the overlap means but the '_sbrk' error<br>
> implies that malloc is being invoked somewhere - I'm using newlib which<br>
> expects you to define system calls. If I turn off the callback then it<br>
> compiles cleanly.<br>
<br>
Its more wrapped up with malloc than I thought!! The linker script<br>
requires tweeking if using malloc (which the newlib sprintf uses) hence<br>
the overlap and the _sbrk missing issue.<br>
<br>
Fixed by using the BeRTOS version of sprintf (the avrlibc version doesn't<br>
do strange things!!)<br>
<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>
<br>
_______________________________________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.<br>
</blockquote></div><br></div>