Reducing RTEMS size to <32KB to fit in Epiphany local memories

Hesham Moustafa heshamelmatary at gmail.com
Fri Dec 19 16:28:10 UTC 2014


Hi,

Thanks all for your replies. I managed to get ~25KB ticker/"nanoRTEMS"
(with the remaining space left for the workspace), but that came with the
requirement to delete printk and all output. I verified ticker runs till
the end using GDB and some memory footprints.

Best,
Hesham

On Thu, Dec 18, 2014 at 6:40 PM, Marcos Díaz <
marcos.diaz at tallertechnologies.com> wrote:
>
>
>
> On Thu, Dec 18, 2014 at 6:34 AM, Hesham Moustafa <heshamelmatary at gmail.com
> > wrote:
>>
>> 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?
>
>
> My bad, since we were having problems with using RTEMS in an environment
> with 32kb of RAM but with much more ROM, I though you had the same problem.
> That size was of the used RAM (data, vector and bss sections) not of the
> total used space.
> Sorry about that.
>
>>
>
>
>> 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.
>> >
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>
>
> --
>
> ______________________________
>
> <http://www.tallertechnologies.com>
>
>
> Marcos Díaz
>
> Software Engineer
>
>
> San Lorenzo 47, 3rd Floor, Office 5
>
> Córdoba, Argentina
>
>
> Phone: +54 351 4217888 / +54 351 4218211/ +54 351 7617452
>
> Skype: markdiaz22
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20141219/f5e33888/attachment-0001.html>


More information about the devel mailing list