Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS footprint on MicroBlaze

Posted by ema083 on March 11, 2008
Hi everybody,

I'm using FreeRTOS on a MicroBlaze; I was surprised because the OS footprint is not 3-4 KB but, on my architecture, is about 12 KB.

Is the footprint supposed to be like that? Do you have any suggestions on how to shrink it? (I've already set the parameters in freeRTOSConfig.h)...

With thanks in anticipation,
Emanuele

RE: FreeRTOS footprint on MicroBlaze

Posted by Dave on March 12, 2008
I don't know about Microblaze but that does not sound right at all. How are you obtaining the footprint size? That is, where are you getting the 12K number from?

RE: FreeRTOS footprint on MicroBlaze

Posted by ema083 on March 12, 2008
Hi,

here is the output when I compile my project:


mb-gcc -O2 code/main.c code/Source/list.c code/Source/queue.c code/Source/tasks.c code/Source/portable/MemMang/heap_1.c code/Source/portable/GCC/MicroBlaze/port.c code/Source/portable/GCC/MicroBlaze/portasm.s code/serial.c -o MB_1/executable.elf \
-mno-xl-soft-mul -mcpu=v4.00.a -Wl,-T -Wl,Proj_MB_1_linker_script.ld -I./mb_1/include/ -Icode/ -Icode/Source/include/ -I. -I./code/Common/include -I./code/Source/include -I./code/Source/portable/GCC/MicroBlaze -L./mb_1/lib/ \
-D MICROBLAZE_GCC -Wall -Wl,-Map=rtosdemo.map

mb-size MB_1/executable.elf
text data bss dec hexfilename
12136 122 19720 31978 7ceaMB_1/executable.elf


I'm getting the footprint size from the "text" value... I hope this is the right way to get it...

RE: FreeRTOS footprint on MicroBlaze

Posted by Richard on March 12, 2008
Yes this is a valid way of getting the size but the 12K for the kernel is very improbable. Can you look in the map file to see which module is taking up the text, I would be very surprised if it were anything to do with the kernel.

Is you main.c using any GCC libraries? In particular anything to do with sprintf/printf/scanf? This can bring LOTS of very inefficient GCC library code into your build.

Regards.

RE: FreeRTOS footprint on MicroBlaze

Posted by ema083 on March 13, 2008
My main.c is the one included in the Demo, from which I erased the demo function calls; so I'm sure I've not included other GCC functions. The part of the map file dealing with text is listed below (I've cut some lines to don't take up too much space). If you please can help me figure out what's wrong, I'll be very glad... I'm not an expert on this topic...

.text 0x00000050 _start1
0x0000006c exit
0x000000e8 _crtinit
.text 0x00000170 main
.text 0x000001d4 vListInsertEnd
... OTHER FREERTOS MODULES ...
0x000020e8 xSerialPortInitMinimal
.text 0x00002388 _exception_handler
.text 0x00002390 _program_clean
.text 0x00002398 _program_init
.text 0x000023a0 _hw_exception_handler
.text 0x000023a4 microblaze_disable_interrupts
.text 0x000023c4 microblaze_enable_interrupts
.text 0x00002478 microblaze_register_handler
0x000023e4 _interrupt_handler
0x000023e4 __interrupt_handler
.text 0x00002910 XTmrCtr_Reset
... OTHER XTMRCTR AND XINTC MODULES...
0x00002bb4 XIntc_SetIntrSvcOption
.text 0x00002c7 XNullHandler
0x00002c34 XAssert
0x00002c68 XAssertSetCallback
.text 0x00002c80 memcpy
.text 0x00002d38 memset
.text 0x00002de0 strncpy
.text 0x00002f2c 0x3c /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/m/crtend.o

Best regards

RE: FreeRTOS footprint on MicroBlaze

Posted by Richard on March 13, 2008
Could you send me the .map file to r [dot] barry _at_ freertos.org.

Regards.

RE: FreeRTOS footprint on MicroBlaze

Posted by Richard on March 15, 2008
In the map file there is:

2888 bytes for tasks.c
2748 bytes for queue.c
268 bytes for list.c
1000 bytes for port.c

Total for the kernel is then 6.9K which is the largest I have ever seen. This must be something specific to the Microblaze architecture or instruction set inefficiencies. I should turn on the optimiser and remove unused symbols, and see what it comes down to.

You could remove quite a lot from port.c by removing the code that fills the registers with known values. You could also make functions out of some of the inline code.

In addition you have:

1548 bytes for libxil.a.
732 bytes for the USRT driver.
416 bytes for the Xilinx interrupt handler code.

Regards.

RE: FreeRTOS footprint on MicroBlaze

Posted by ema083 on March 16, 2008
Thank you very much for your help!

I'll try and see if I can shrink it a bit with your suggestions.

Thanks again, best regards,

Emanuele


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists