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] [May 2017 Threads] xTaskGetTickCount always returns 0Posted by ramawidi on May 24, 2017 Hi, I working on STM32F4 Discovery with FreeRTOS ver 9. I use xTaskGetTickCount to see how long my task is working on. But xTaskGetTickCount always returns 0. This is my task code
void testprint(void)
{
uint32t waketime,temp1,temp2;
const uint32t period = 100;
char buff[32];
wake_time = xTaskGetTickCount();
while(1)
{
tamp1 = xTaskGetTickCount();
sprintf(buff,"Tick1 = %u\n",temp1);
USART_puts(buff);
USART_puts("aaaaaaaaaaa\n");
//vTaskDelay(1000);
delay_dw(500);
tamp2 = xTaskGetTickCount();
sprintf(buff,"Tick2 = %u\n",temp2);
USART_puts(buff);
vTaskDelayUntil(&wake_time,period);
}
}
Anyone help?
Thank You
xTaskGetTickCount always returns 0Posted by omar93 on May 24, 2017 Hi,
I am working with Xilinx Zynq ZC702 and I have the same problem..
xTaskGetTickCount always returns 0Posted by kenchang1 on May 24, 2017 Does the code compile? Any warnings (implicit declaration of variables)? TYPO: tamp1, tamp2 should be temp1, temp2.
xTaskGetTickCount always returns 0Posted by rtel on May 24, 2017 Sounds like the tick interrupt is not running. Is it installed? See the first question of the FAQ page "my application does not run, what could be wrong?". I think there is a link to the page in the comments at the top of each source file.
xTaskGetTickCount always returns 0Posted by ramawidi on May 28, 2017 No I don't have any warnings. Sorry for the Typo. Actually tamp1 & tamp2 is temp1 & temp2. And I'm sorry, I don't get what do you mean about installed? Do you mean Tick is installed? correct me if I'm wrong
xTaskGetTickCount always returns 0Posted by hs2sf on May 28, 2017 Question is if the SysTick interrupt / its ISR is properly installed.
Note that this is port / BSP specific.
For STMF4 ie. Cortex-M4 architecture you have to prepare the exception vector table containing the interrupt handlers used by your application.
It should at least contain the entries required by FreeRTOS to run.
These are defined in your FreeRTOSConfig.h:
~~~
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
define vPortSVCHandler SVC_Handler
define xPortPendSVHandler PendSV_Handler
define xPortSysTickHandler SysTick_Handler
~~~
xTaskGetTickCount always returns 0Posted by ramawidi on May 31, 2017 Hi, HS2
When I checked my FreeRTOSConfig.h those 3 lines is not available so I add it and works. Thank you so much for your help
Regards,
Rama
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|