Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Software timers sleep indefinitely after systick overflow

Posted by kelvinelton on March 10, 2017

I am currently developing a project with FreeRTOS (v8.2.1) on ARM Cortex-M3 (STM32F103xE) and IAR Compiler and all the software timers callbacks stopped being called after a systick overflow.

I also created a minimal example and the result was the same. The timer worked just fine until the overflow on xTickCount. Am I missing something here or is there really a bug?

I also tried to create the timer within a task, or starting it after osKernelStart(), but it's always the same result.

FreeRTOSConfig.h: ~~~ ...

define configUSE16BIT_TICKS 1
define configTICKRATEHZ ((TickType_t)1000)
define configUSE_TIMERS 1
define configTIMERTASKPRIORITY 3
define configTIMERQUEUELENGTH 6
define configMINIMALSTACKSIZE ((uint16_t)128)
define configTIMERTASKSTACKDEPTH configMINIMALSTACK_SIZE

... ~~~

main.c:

~~~ static volatile uint32t testtick = 0; TimerHandlet test_timer = NULL;

void testticktimer(void * n) { testtick += 10; }

int main() { // Hardware configuration (clock, systick, ...) testtimer = xTimerCreate("testtimer", pdMSTOTICKS(10), pdTRUE, (void *) 2, testticktimer); xTimerStart(test_timer, 0); osKernelStart(); while(1){} } ~~~


Software timers sleep indefinitely after systick overflow

Posted by rtel on March 10, 2017

The behaviour of software timers when the tick overflows is very well tested. In addition soak tests that use a 16-bit counter, which results in frequent overflows, run for months with no failures. That doesn't mean there are not bugs though, just that if there are our tests don't find them.

It looks like you are using an abstraction layer on top of the FreeRTOS API. My first suggestion would be to try using the native API directly. If you still have a demostatable issue after that please create the smallest project possible that exhibits the behaviour along with instructions on how to observe the error and we can investigate.


Software timers sleep indefinitely after systick overflow

Posted by kelvinelton on March 13, 2017

Actually I was using the version 8.2.2 and the problem occurs only in this version. I tried 8.2.1 or 8.2.3 and it worked as excepted. It's probably the same bug fix related to tickless low power applications.


Software timers sleep indefinitely after systick overflow

Posted by rtel on March 13, 2017

Didn't realise you were using tickless - tickless and software timers didn't used to work together but that was changed some versions ago.


Software timers sleep indefinitely after systick overflow

Posted by kelvinelton on March 13, 2017

I am not using tickless. I just suspect that the same bugfix that corrected the tickless problem between 8.2.2 and 8.2.3 also corrected my problem.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists