Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


speedup freertos

Posted by mastupristi on March 1, 2017

Hi, I have an STM32F410 cortex M4 clocked @100MHz. I notify an high priority task from another, with lower priority, using xTaskNotifyGive()/ulTaskNotifyTake(). The firmware is compiled with arm-gcc: ~~~ ~$ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715] ~~~ and I already use -O3 optimization. Moving a pin I can measure time between notification and task wakeup. It is about 4us. Is it possible to speed up notification (I think also context switch)?

best regards Max

speedup freertos

Posted by heinbali01 on March 1, 2017

Hi Max

There are many factors influencing this delay between vTaskNotifyGiveFromISR() and ulTaskNotifyTake(). Compiler optimisation, for GCC, use -Os or -O3. I tend to like -Os ( optimise for size ) Once you're ready debugging, stop using configASSERT() and stop checking the for stack overflows. Make sure that the task that you are waking-up has the highest priority of all tasks that are runnable at that moment. Please let us hear

speedup freertos

Posted by hs2sf on March 1, 2017

I also tend to use -Os instead of -O3 with GCC. In addition I get pretty good results using link time optimization (LTO) ie. using -flto. At least it saves even more code space which usually also improves runtime performance.

speedup freertos

Posted by rtel on March 1, 2017

Stack overflow detection is the feature that takes the most time to execute.

As has already been said, turning off run time stats, asserts, tick hooks, etc. all help. The context switch itself is not the limiting factor.

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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner