Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner