FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2012 Threads] vTaskGetRunTimeStats increases flash usePosted by michal on July 14, 2012 Hello,
I have an issue with Run Time Stats. Adding vTaskGetRunTimeStats function to my code increases flash use by more than 20kB! Stats seems to be working fine, but increased flash use doesn't look like a normal behaviour. Did someone have a similar problem?
Here is the memory use before and after adding vTaskGetRunTimeStats function
text data bss dec 42124 1444 19148 62716 19648 1320 19096 40064
My code is running on STM32 CM3 and use ARM Sourcery GCC Toolchain
Regards, Michal
RE: vTaskGetRunTimeStats increases flash usePosted by Richard on July 14, 2012 The run time stats code itself is very small, but it makes use of C library functions that are not used anywhere else in the code. As soon as you include run time stats you will be pulling in a lot of extra library functions that can bloat your code, depending on your GCC supplier. Companies such as Rowley and Code Red have their own libraries build specifically for embedded systems. Other suppliers use things like NewLib which is a disaster on a small micro.
There are a couple of things you can do. First, avoid using the libraries that come with your compiler. Normally, this can be done by simply including the printf-stdarg.c source file in your project. Search for it in the FreeRTOS/Demo directory, it is included in a lot of projects. The file implements, in a basic and very stack friendly way, the functions needed by the run time stack. If these functions are defined in your project they will not be pulled in from the compilers libraries.
The second thing you can do is ensure the compiler is configured to remove unused code. Most compilers do that by default, but the GCC default is not to do it so you have to tell it explicitly using the -ffunction-sections and -fdata-sections command line options to the compiler, and the --no-gc-sections linker option.
Regards.
RE: vTaskGetRunTimeStats increases flash usePosted by michal on July 14, 2012 I added printf-stdarg.c as you suggested and it helped very well! Now only 600bytes more of flash used. Thank you a lot for your help.
Regards, Michal
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|