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

Run Time Stats failure in 7.0.2

Posted by keith soldavin on November 21, 2011
I am currently running version 7.0.2 on a dsPIC33. We recently upgraded from version 5.3.1 and aside from slightly more RAM and Flash usage everything seems OK. We have recently found that when we attempt to get the real time stats on the tasks we are getting strange results. When we request the stats the first time, everything seems to work fine. All subsequent requests for the stats returns 0% or <1% CPU usage for all tasks. This code worked perfectly under 5.3.1.

Any suggestions on where to look for the problem?

Thank you
Keith

RE: Run Time Stats failure in 7.0.2

Posted by MEdwards on November 21, 2011
What is the run time stats code? Can you post it?

RE: Run Time Stats failure in 7.0.2

Posted by keith soldavin on November 21, 2011
To start with, I have configGENERATE_RUN_TIME_STATS set to 1 in freeRTOSConfig.h.

Here is the code for setting up the timer, reading the timer, and the timer interrupt. The code that calculates the stats is in the FreeRTOS code and was not modified.

void vConfigureTimerForRunTimeStats( void )
{
const unsigned long ulCompareMatch = ( configCPU_CLOCK_HZ / 8 ) / configTICK_RATE_HZ / 10;

runTimeStatsTicker = 0;

T4CON = 0;
TMR4 = 0;

PR4 = ( unsigned portSHORT ) ulCompareMatch;

/* Setup timer 1 interrupt priority. */
IPC6bits.T4IP = configKERNEL_INTERRUPT_PRIORITY;

/* Clear the interrupt as a starting condition. */
IFS1bits.T4IF = 0;

/* Enable the interrupt. */
IEC1bits.T4IE = 1;

/* Setup the prescale value. */
T4CONbits.TCKPS0 = 1;
T4CONbits.TCKPS1 = 0;

/* Start the timer. */
T4CONbits.TON = 1;

} // vConfigureTimerForRunTimeStats



// ulGetTimerForRunTimeStats
unsigned long ulGetTimerForRunTimeStats( void )
{
return( runTimeStatsTicker );
} // ulGetTimerForRunTimeStats


// ulGetTimerForRunTimeStats
void __attribute__((__interrupt__, auto_psv)) _T4Interrupt( void )
{
/* Clear the timer interrupt. */
IFS1bits.T4IF = 0;

runTimeStatsTicker++;

} // _T4Interrupt

RE: Run Time Stats failure in 7.0.2

Posted by MEdwards on November 21, 2011
Looks ok, I think. Have you checked that _T4Interrupt is actually executing at the expected frequency?

RE: Run Time Stats failure in 7.0.2

Posted by keith soldavin on November 22, 2011
Yes, That was one of the first things I checked. The interrupt is being triggered and the runTimeStatsTicker variable is being incremented.

RE: Run Time Stats failure in 7.0.2

Posted by keith soldavin on November 28, 2011
Anyone else have any suggestions? I have hit a wall.


[ 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