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 ]    [ Sitemap ]    [ ]

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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