FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2016 Threads] FreeRTOS timer not stoppingPosted by ksoldavin on November 16, 2016 I am having an issue with my timer code under FreeRTOS v9.0 using an STM32F4. I am trying to create a one shot timer with a period of 1000mS. The timer is being activated correctly and the callback function is being run, but after it has finished it is repeatedly called again 1000mS later.
My timer is being set up as follows:
~~~
static void SerialTimerCallback( TimerHandlet pxExpiredTimer );
static TimerHandlet SerialTimerHandle = NULL;
SerialTimerHandle = xTimerCreate("Video DMA Timer", 1000, pdFALSE, ( void * ) 123, SerialTimerCallback );
static void SerialTimerCallback( TimerHandle_t pxExpiredTimer )
{
printf("Timer expiredn");
// Do other stuff
}
~~~
I have also tried making the timer auto reload and calling the stop timer command in my callback with the same result.
Any suggestions?
Thank you
Keith
FreeRTOS timer not stoppingPosted by rtel on November 16, 2016 I've never come across that symptom before. Is anything else using the
SerialTimerHandle handle in any way? Could it be accidentally reset by
any other code? Where is xTimerCreate() being called from? Could it be
accidentally created more than once?
FreeRTOS timer not stoppingPosted by ksoldavin on November 17, 2016 Thank you for responding. The timer is being created in my init code that is efinately only run once. Aside from that I have code that checks if SerialTimerHandle is NULL and only tries to create it if it is. I just looked over my code and the only place the timer is touched is when it is initialized.
Keith
FreeRTOS timer not stoppingPosted by rtel on November 17, 2016 This is very odd, and perhaps it is a simple data corruption that has
effected the timer's structure.
Place a break point on the function prvProcessExpiredTimer(), which is
in FreeRTOS/Source/timers.c. The break point will get hit when your
timer expires. Step through the function and see what happens - there
is a line "if( pxTimer->uxAutoReload == ( UBaseType_t ) pdTRUE )" - if
it goes through there then the timer thinks it is an auto reload timer.
If that is the case it would indeed seem to have been corrupted - in
which case restart the application and step through the code that
creates the timer. pxTimer->uxAutoReload should get set to pdFALSE (0)
- does it? If it does then you will have to try and catch the place
where it gets overwritten - the easiest way of doing that would be to
put a data watchpoint on the pxTimer->uxAutoReload memory address that
will automatically stop the code when that memory address gets written to.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|