Quality RTOS & Embedded Software

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


Loading

Any Method to trigger/start FreeRTOS task from normal STM32 ISR??

Posted by madhan719 on February 21, 2019

Hello Folks,

What is the most effecient method to start a freeRTOS task only after an ISR is completed and flag or something set by ISR that triggers freeRTOS task.

Lets take an example scenario , I have STM32F3 nucleo board in which i would like to toggle two different led's using freeRTOS task by using xTaskCreate . Also i want to Serial read a character say 'T' (T-toggel just random) using DMA which will generate interrupt on tranfer complete, the corresponding Interrupt Service Routine should have a method/flag to trigger/execute the tasks created (toggling of LED's). Once the two tasks are completed should wait for the arrival of character 'T' over Serial.

Any IDE is ok for explanation and preferably ST's standard periperal library (if any good heart would like to provide entire code structure as an eaxmple/explanation )

Any Ideas would be very welcome ;)

Thanks in advance.


Any Method to trigger/start FreeRTOS task from normal STM32 ISR??

Posted by rtel on February 21, 2019

What is the most effecient method to start a freeRTOS task only after an ISR is completed and flag or something set by ISR that triggers freeRTOS task.

There is no really efficient way of doing that - most efficient would be to have the tasks already created then just unblock them from the ISR to start them running as per https://sourceforge.net/p/freertos/discussion/382005/thread/9baed78cc9/#1720/a912

If you must create a task, then you can't do that directly in an ISR, but you can pend a function that starts them from the RTOS daemon task (aka the timer task). https://www.freertos.org/xTimerPendFunctionCallFromISR.html

If the daemon task is the highest priority task then it will run after the ISR, execute the function that creates the task you want, which will create the tasks.

Any IDE is ok for explanation and preferably ST's standard periperal library (if any good heart would like to provide entire code structure as an eaxmple/explanation )

So this sight remains narrowly focused on helping people with FreeRTOS my preference is not to provide support for third party libraries here - FreeRTOS runs on many different architectures.


Any Method to trigger/start FreeRTOS task from normal STM32 ISR??

Posted by madhan719 on February 21, 2019

Hi Richard, Thanks for the quick response.

To be precise i don't want any task to be dynamically created by ISR, instead i'm interested in something like this https://docs.aws.amazon.com/freertos-kernel/latest/ref/reference125.html in which the previously existing task should be in suspended state and once ISR is triggered, the ISR should unblock the existing task ( by using any FreeRTOS API ) and should be executed.

luckily something am looking for exists in FreeRTOSSupportForum https://www.freertos.org/FreeRTOSSupportForumArchive/October2014/freertosHowtowakeupaFreeRtostaskfromahighpriorityISR_140cde98j.html

:) :) :) so could you please suggest me ideas for the same.


[ 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.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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.


Careers

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

Mediatek

Renesas

RISC-V

SiFIve RISC-V

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