large bss size for sample applications

Gedare Bloom gedare at rtems.org
Wed Sep 23 01:32:11 UTC 2015


Welcome Jeff!

The bss defaults to take up the leftover space in the memory map, so
it will appear large. This is where the C program heap lives, and also
the "RTEMS Workspace" (where dynamically allocated, but statically
configured size, blocks of memory are located).

I believe you can use RTEMS in under 64K with some hacks. Anything
above 256K should work very well except for the new networking stack.
I don't know off-hand its size reqs.

HTH.

Gedare

On Tue, Sep 22, 2015 at 6:27 PM, Jeff Webb <jeff.webb at nta-inc.net> wrote:
> I am new to RTEMS, and I am interested in getting a an ARM-based development
> system up an running.  Ultimately, I would like to use RTEMS on a Zynq-based
> board with no external RAM.  Is it possible to do anything useful in a few
> hundred kilobytes of RAM on the Zynq platform?  The sample applications I
> have generated have very large bss sizes that do not seem to be in line with
> the reported values for other platforms that I have found in web searches.
>
> I found an excellent tutorial [1] (thanks!) for getting started with RTEMS
> on the Raspberry Pi.  I followed the instructions and successfully built and
> ran the ticker.exe sample application on the Pi.  I was curious about the
> memory usage, so I attempted to determine how much memory this application
> required.
>
>   $ arm-rtems4.11-size  ticker.exe
>    text    data     bss     dec     hex filename
>   94196    1692 134077844       134173732       7ff5424 ticker.exe
>
> The executable size is 3.1M, which is reduced to 95K after running
> arm-rtems4.11-strip on it.
>
> When I used objcopy to create an image for copying to the raspberry pi SD
> card, the resulting image was 999K:
>
>   $ arm-rtems4.11-objcopy -Obinary ticker.exe ticker.img
>
> Since I had success with the Pi, I decided to try the Zedboard.  I
> successfully got the ticker application built using this configure command:
>
> ../rtems-git/configure --target=arm-rtems4.11 \
> --enable-rtemsbsp=xilinx_zynq_zedboard \
> --enable-tests=samples \
> --enable-networking \
> --enable-posix \
> --prefix=/opt/rtems/bsps/4.11 BSP_ARM_A9MPCORE_PERIPHCLK=333333333U
>
> The bss size of the resulting executable was also large:
>
>   $ arm-rtems4.11-size  ticker_zed.exe
>    text    data     bss     dec     hex filename
>   72588    1780 535731528       535805896       1fefbfc8
> ticker_zed.exe
>
>   $ ls -lh ticker_zed*
>   3.2M Sep 22 17:16 ticker_zed.exe
>   74K Sep 22 17:18 ticker_zed_stripped.exe
>
> I tried shrinking the memory map for the zedboard using various techniques,
> but it looks like I'm running out of memory.  One technique I attempted was
> to add something like "BSP_ZYNQ_RAM_LENGTH=1536K
> BSP_ZYNQ_NOCACHE_LENGTH=128K" to the configure command, which would yield an
> error message like this:
>
> arm-rtems4.11-gcc -B../../../../../xilinx_zynq_zedboard/lib/ -specs
> bsp_specs -qrtems -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard
> -mtune=cortex-a9 -O2 -g -Wall -Wmissing-prototypes
> -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs
> -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9   -o
> hello.exe init.o
> linkcmds.base:383 cannot move location counter backwards (from
> 0000000000203c34 to 0000000000160000)
>
> Can anyone point me in the right direction?
>
> Thanks,
>
> -Jeff
>
> [1]
> http://alanstechnotes.blogspot.com/2013/03/setting-up-rtems-development.html
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users


More information about the users mailing list