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] [January 2015 Threads]
Hi Folks:
I am using FreeRTOS on STM32L15RD processor--a STM32L152 variant, and using
the Rowley Crossworks for ARM as a toolchain. My problem is when a I set a timer
for what I think is 10000 milliseconds it doesn't expire until approximately 17000
milliseconds.
The timer is created as follows:
TSAMPLE = xTimerCreate("Sample T", (10000/portTICKRATEMS), pdFALSE, &v, samplehandler);
The underlying definition of portTICKRATEMS in FreeRtosConfig.h is as follows:
define configTICKRATEHZ ( (TickTypeT) 1000)
This is the timeout handler.
void samplehandler(TimerHandlert timerid)
{
TLPMESSAGE msg;
msg.event = AGG_E_SAMPLE_TIMEOUT;
msg.data_len = 0;
msg.data = NULL;
xQueueSendToFront(AGGREGATE_TASK, &msg, portMAX_DELAY);
return;
}
The timer is started and handled in AGGREGATE_TASK and the only thing the task
is doing is waiting for a message as follows:
(i.e. No messages except the timeout message arrive.)
xQueueReceive(AGGREGATE_TASK, &msg, 0);
Do you have any idea what the problem is ?
Best Regards,
Paul R.
xQueueSendToFront(AGGREGATETASK, &msg, portMAXDELAY);
You are not supposed to make any Blocking function calls in timers, as to do so will Block the timer task itself, and effect any other timers that might be running. That may be the cause of the problem, but also....
Are you sure the tick interrupt is executing at the frequency you think it is? Can you toggle a pin from a tick hook function and check its frequency on a scope or frequency meter?
Regards.
Hi:
I don't think that is the problem becuase if one substibutes
xQueueSendToFrontFromISR(), the problem persists. In any case,
the queueing functions don't do much more than a linked list
insertion.
Best Regards,
Paul R.
Hi Folks:
I don't have a scope handy but is is possible the
clock is not configured as I think. The file with
the clock initialization routines is attached to this note.
Best Regards,
Paul R.
I'm afraid the configuration of microcontrollers falls outside of FreeRTOS support. Even toggling an LED once per second and timing 60 toggles will give you a gross assessment of how the frequency of the tick count. Also ST provide a spreadsheet that automates clock configuration - you can enter your settings into the spread sheet and it will tell you the frequency of the output clocks.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.