Quality RTOS & Embedded Software

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


Loading

vTimerCreate

Posted by michaeln32 on June 25, 2018

Hi, If the system created only one timer (using vTimerCreate).

Along the running of the system - Can only one task use this timer or many tasks can use it ?

Thank you


vTimerCreate

Posted by richard_damon on June 25, 2018

A Timer is not tied to a specific task, so many tasks can use (start/stop/reset/etc) the timer, but a timer can only have a single time period/timeout time at any given time, so it can only be running once at any given time, and the timeout callback runs in the context of the Timer Task, not any particular task,


vTimerCreate

Posted by michaeln32 on June 25, 2018

Thank you Richard.

What happend if Task1 use timerA to run call back with timeout of 500 milli seconds and after 100 milli Task2 do stop command to TimerA ?

Is the call back will run or not ?


vTimerCreate

Posted by richard_damon on June 25, 2018

If the last action on TimerA was ANY task (or ISR) doing a stop, then the timer is stopped, and the callback won't be called until some task (or ISR) restarts it. As I said, Timers are NOT connected to a task and have no knowledge of the tasks using them (unless YOU add such information for YOUR use in the timer tag).


vTimerCreate

Posted by michaeln32 on June 25, 2018

When task send command to timer service message Q - it causes the timer service task to move from block state to running state and process the command.

What can be more other situations that can cause the timer service task to move from block state to running state ?


vTimerCreate

Posted by rtel on June 25, 2018

What happend if TaskA use timerA to run call back with timeout of 500 milli seconds and after 100 milli Task2 do stop command to TimerA ?

Is the call back will run or not ?

I strongly recommend that you read the documentation and experiment with the code. In relation to this specific question - setting up a quick and dirty test, observing the behaviour, and stepping through the code, would give you the answer very quickly and teach you a lot about how the code functions.


[ 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 & STM32H745 dual core (AMP) 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.


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