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

Use vTaskGetRunTimeStats with codewarrior

Posted by sakouat on April 11, 2012
Hello,
I use FreeRTOS source 7.1.0 with Frescale IDE codewarrior special Edition, so i dont have any operating system for this version. But i has opensource 7.1.0 that i add to my project. It s works correctly.
My device is MC9S12XEQ512
I have two timer one of them is used to generate tickcount for RTOS and the second is used to calculate CPU charge using vTaskGetRunTimeStats.
I set in FreeRtosConfig.h :
#define configGENERATE_RUN_TIME_STATS 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() Timer_GetRunTime_OnInterrupt()
#define portGET_RUN_TIME_COUNTER_VALUE () ulHighFrequencyTimerTicks

the Timer_GetRunTime_OnInterrupt is a Interrupt for my second timer :

#pragma CODE_SEG __NEAR_SEG NON_BANKED
ISR(Timer_GetRunTime_Interrupt)
{
PITTF = 0x04U; /* Reset interrupt request flag */
Timer_GetRunTime_OnInterrupt(); /* Invoke user event */
}

#pragma CODE_SEG Timer_GetRunTime_CODE

the event "Timer_GetRunTime_OnInterrupt()" is defined into events.c as follow :

void Timer_GetRunTime_OnInterrupt(void)
{
/* Write your code here ... */
ulHighFrequencyTimerTicks++;
}

when i compile the "task. c" i have some errors

Thank you for your help

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by Erich Styger on April 11, 2012
Hello,
could you post the kind of error messages you see, and which version of CodeWarrior you are using?

thanks!

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by Erich Styger on April 11, 2012
Hello,
FYI, I'm using the port described in
http://mcuoneclipse.wordpress.com/2012/02/11/back-to-classic-freertos-for-freescale-s12x/
with CodeWarrior for MCU 5.1 (classic, not eclipse). I have performance counter enabled, and it works for me just fine.

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by sakouat on April 11, 2012
Hello xz897f,
I use CodeWarrior V5.1 special Edition without any operatin system.
the erros are :
C2450: Expected IDENT char cont double enum float int long short sigend struct union unsigend void volatile
and some error
the cursor is set in the line itnt task.c
ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by Erich Styger on April 11, 2012
Hello,
as the error is for the macro portGET_RUN_TIME_COUNTER_VALUE(), which is using ulHighFrequencyTimerTicks:
can you make sure that task.c includes the header file which contains ulHighFrequencyTimerTicks?

I think that you are missing to include the declaration for ulHighFrequencyTimerTicks.

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by sakouat on April 11, 2012
Hello,
I has include the header file which contains ulHighFrequencyTimerTicks, it s name is "Events.h" and ulHighFrequencyTimerTicks is decalared as extern.

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by Erich Styger on April 12, 2012
Hello,
well, then it is hard to tell what the problem could be. Maybe attach/provide a link to your project and I can have a look.

RE: Use vTaskGetRunTimeStats with codewarrior

Posted by sakouat on April 24, 2012
Hello,
Finaly i have find the problem, it s came frome my macro i have written :
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS Timer_GetRunTime_OnInterrupt()
#define portGET_RUN_TIME_COUNTER_VALUE ulHighFrequencyTimerTicks
and not
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() Timer_GetRunTime_OnInterrupt()
#define portGET_RUN_TIME_COUNTER_VALUE () ulHighFrequencyTimerTicks

i checked the function it works corectly but i have a problem in my timing when i add the second counter my tasks are not accurate it is normal?


[ 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