Re: How to reduce footprint and size of applications in Zephyr


Yie
 

I see. That makes a lot of sense. Thank you Maciek! 

I have another question, if you dont mind. 

I have an app that's taking about ~5MB of RAM and ~5.6MB of ROM judging from the 'ram_report' and 'rom_report'. Is there a way to reduce the size of those? It is much bigger because I've included other functionalities such as multi-threading and networking. Do I remove functionalities I don't need using 'make menuconfig'?

Cheers,
Yie

On 21 September 2017 at 18:28, Maciek Borzecki <maciek.borzecki@...> wrote:
On Thu, Sep 21, 2017 at 7:57 AM, Hui Yie Teh <hteh703@...> wrote:
>
> Hi Thiago,
>
> Thank you so much for the reply. I am running Zephyr on Linux and building the hello_world app on ARM using qemu_cortex_m3.
>
> I've got the numbers from the following:
>
> The 8MB of memory is measured using the system monitor
>
>
> The 3.8MB is seen by clicking properties of the folder created after building the hello_world app. I am assuming that the folder in ../outdir/BOARD will be the folder that is going to be installed on the board itself. Am I understanding this correctly?
>
>
> I'm not sure if those are the right numbers to get, sorry if this is a stupid question.
>
>
> Also, may I know what these numbers from' make ram_report' and 'make rom_report' mean?
>
> ram_report
>
>
> rom_report
>
> Any help would be really appreciated. Thanks!


qemu-system-arm is just a VM that can emulate, among others, Cortex-M
MCUs. `qemu_cortext_m3` board is in fact emulated by qemu. Memory
usage of a running Qemu process does not directly (or otherwise
easily) translate to the memory usage in the target system.

Haven't looked at the reports for some time, but `ram_report` is
likely a listing statically allocated data that would normally be
copied into RAM during system initialization. `rom_report` likely
lists the size of each symbol (i.e. non-inlined function in the code).
So, you're more realistically looking at ~4kB of RAM and ~7kB of
flash.

>
> Cheers,
> Yie
>
>
>
>
> On 21 September 2017 at 06:15, Thiago Silveira <thiago@...> wrote:
>>
>> Hi Yie,
>>
>> That definitely isn't right. In which environment are you running Zephyr, and how are you measuring this?
>>
>> Try 'make rom_report' and 'make ram_report' to get a nice report of how much each function is consuming.
>>
>> Best regards,
>> Thiago
>>
>>
>>
>> 2017-09-20 13:00 GMT-03:00 Hui Yie Teh <hteh703@...>:
>>>
>>> Hi,
>>>
>>> I read that Zephyr allows small footprint of a few KBs. However, the sample hello world application already takes up 8MB of memory and has a size of 3.8MB. I am not sure if I am running this right.
>>>
>>> I would appreciate if I can get any help on this or someone to point me at the right direction.
>>>
>>> Cheers,
>>> Yie
>>>
>>> _______________________________________________
>>> Zephyr-devel mailing list
>>> Zephyr-devel@lists.zephyrproject.org
>>> https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
>>>
>>
>
>
> _______________________________________________
> Zephyr-devel mailing list
> Zephyr-devel@lists.zephyrproject.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
>



--
Maciek Borzecki

Join devel@lists.zephyrproject.org to automatically receive all group messages.