Reducing RTEMS size to <32KB to fit in Epiphany local memories
Hesham Moustafa
heshamelmatary at gmail.com
Thu Dec 18 09:34:08 UTC 2014
Hi all,
Thanks for all your helpful replies. I actually tried all the solution
you mentioned: used printk, low-ticker (from example-v2), disabled
newlib reentrancy (part of low-ticker configuration). I managed to get
<32KB ticker with GCC optimization enabled (-Os), but I got some
exceptions during initialization, however, the same code built without
optimization (-O0) runs OK, but it's about 80KB.
Marcos and Daniel, it's surprising that you got 9KB RTEMS, how did you
do this (without the application optimizations and stacks) what APIs,
managers, and CPUKIT code did you use, and what others did you give
up?
Sebastian, the 32KB is for both code and data. Although there is 32MB
external memory, it's very slow compared with local memories. The idea
of getting rid of workspace appeals to me. Does this include
discarding malloc, heap stuff? And how can this be done?
Thanks,
Hesham
On Thu, Dec 18, 2014 at 7:58 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> Hello,
>
> is this 32KiB for code and data?
>
> You should also disable the Newlib reentrancy:
>
> #define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
>
> Try to add:
>
> CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
>
> LDFLAGS = -Wl,--gc-sections
>
> to the *.cfg file of the BSP. You need a proper linker command file to use
> these options.
>
> Avoid printf() and instead use printk() or no output.
>
> For a really small RTEMS we need the constructor based initialization. We
> should probably also get rid of the workspace and use static initialization
> only.
>
>
> On 17/12/14 17:00, Hesham Moustafa wrote:
>>
>> Hi all,
>>
>> I am working on reducing RTEMS size to fit into <32KB as every Epiphay
>> core has only 32KB of local memory. I was able to get hello and
>> minimum samples with aggressive size reduction by manually removing
>> un-needed code. Currently I only use libcsupport, sapi, score, rtems
>> built for cpukit only, and for each, some source code files were
>> removed. No IO, no FS, no barrier, event, managers are included. And I
>> added -Os flag. However when building ticker, the .text area overflows
>> the 32KB local memory by about 8KB.
>>
>> The question is, what are the very basic mandatory sources/libraries
>> and/or managers that are enough to build ticker?
>>
>> Regards,
>> Hesham
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail : sebastian.huber at embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
More information about the devel
mailing list