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

Suspend-Resume with Tickless Idle cause to Assert

Posted by znatok on July 25, 2014

Hi, I'm using FreeRTOS v7.5.2 on STM32F2xx with

define configUSETICKLESSIDLE 1

Once I have strated to use vTaskSuspend and vTaskResume I keep getting ASSERT here (tasks.c) :

~~~~~~ void vTaskStepTick( portTickType xTicksToJump ) { /* Correct the tick count value after a period during which the tick was suppressed. Note this does not call the tick hook function for each stepped tick. */ configASSERT( ( xTickCount + xTicksToJump ) <= xNextTaskUnblockTime ); xTickCount += xTicksToJump; traceINCREASETICKCOUNT( xTicksToJump ); } ~~~~~~

It happens once per a few hours. I have a transmit and receive tasks that implement some interface with external device. During transmit I suspend receive task and resume it after transmit finished.

Do you have any comments about this assert? Probably this issue was fixed in higher versions? Thanks.


Suspend-Resume with Tickless Idle cause to Assert

Posted by rtel on July 25, 2014

While I'm not aware of any issues the tickless idle functionality has been refined a few times since the version you are using - so using a newer version might help.

Other than that:

Are you using the default tickless idle implementation that still uses the SysTick timer, or have you created your own using a different timer?

Have you created any PRE/POST sleep macros? If so, please post them.

What are the values of xTickCount, xTicksToJump and xNextTaskUnblockTime when the assert is hit?

Regards.


Suspend-Resume with Tickless Idle cause to Assert

Posted by znatok on July 25, 2014

While I'm not aware of any issues the tickless idle functionality has been refined a few times since the version you are using - so using a newer version might help.

What version do you think worth to try before v8.x.x as I do not want to change API so far.

Other than that:

Are you using the default tickless idle implementation that still uses the SysTick timer, or have you created your own using a different timer?

Default

Have you created any PRE/POST sleep macros? If so, please post them.

No PRE/POST. Actually I don't even know what is it?

What are the values of xTickCount, xTicksToJump and xNextTaskUnblockTime when the assert is hit?

I'll try to catch and print it.


Suspend-Resume with Tickless Idle cause to Assert

Posted by rtel on July 25, 2014

What version do you think worth to try before v8.x.x as I do not want to change API so far.

I would always recommend using the latest - I'm not sure what you mean by "I don't want to change API" though. The API is the same and by default fully backward compatible, as is documented.

Regards.


Suspend-Resume with Tickless Idle cause to Assert

Posted by znatok on July 28, 2014

Here are the values that ASSERT the code

xTickCount: 31605614, xTicksToJump: 35656, xNextTaskUnblockTime: 31605618 ASSERT ../../STM32/FreeRTOS-7.5.2/Source/tasks.c:1563

xTicksToJump looks suspicious.

Attachments

alternate (2070 bytes)

Suspend-Resume with Tickless Idle cause to Assert

Posted by rtel on July 28, 2014

So the MCU has been asleep for 35656 ticks, whereas it should have been asleep for a maximum of 4 ticks - something has gone very wrong there. I suspect the timer didn't unblock the task at all, as it should have been re-programmed to generate an interrupt in 4 ticks time, but instead the MCU just stayed asleep until there was an external interrupt that brought it out of sleep mode.

What is your tick frequency? It may be conceivable that if the frequency was very very high, or the tick clock driving SysTick was not operating at the frequency you thought it was, that the timer could not be programmed to generate a tick before the time had already past - but to be honest on the assumption you have not changed anything in the code I would doubt that very much as the timer is momentarily stopped while it is re-programmed.

In any case, I don't want to spend time delving into old code, so suggest you update the code to the latest as a fist step.

Regards.


[ 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