FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2012 Threads] Use vTaskGetRunTimeStats with codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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 codewarriorPosted 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?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|