Quality RTOS & Embedded Software

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


Using xTimerReset() inside a timer callback

Posted by J. Day on March 20, 2012
Hi Everyone-

Is it acceptable to use xTimerReset() inside the timer's callback function?

Before I start the scheduler, I create a timer with xAutoReload set to pdFALSE.
then I set it active using xTimerStart(). I check all the return codes to make sure

Inside the timer's callback function, I use xTimerReset() to reload the timer.

It works but then the OS just hangs up. If I comment out the xTimerReset() code, it works fine with no issues.

Is this a bug or is this not allowed? Could i reset another timer using xTimerReset() inside a timer callback?



RE: Using xTimerReset() inside a timer callback

Posted by Richard on March 21, 2012
It is not a problem to call the reset function from inside the callback.


RE: Using xTimerReset() inside a timer callback

Posted by J. Day on March 21, 2012
Ok, I figured this out.

I thought configTIMER_TASK_STACK_DEPTH 80 would be sufficient.

It's not, so I bumped it to 160 and it's fine.

Suprising, since I coded a very contrived example.

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

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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

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