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] [September 2010 Threads] using vTaskDelayUntil in more then one taskPosted by daniel on September 7, 2010 I use FreeRTOS V6.0.5 on ARM1176JZF-S I created two small tasks to test freeRtos:
1st task - toggle LEDs using the vTaskDelayUntil function 2nd task - just toggle LEDs
//the prototypes static portTASK_FUNCTION_PROTO( vLEDFlashTask2, pvParameters ); static portTASK_FUNCTION_PROTO( vLEDFlashTask1, pvParameters );
void vStartLEDFlashTasks( unsigned portBASE_TYPE uxPriority ) { xTaskCreate( vLEDFlashTask1, "LED1", configMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL ); xTaskCreate( vLEDFlashTask2, "LED2", configMINIMAL_STACK_SIZE, ( void * ) NULL, uxPriority, ( xTaskHandle * ) NULL ); }
//task 1 portTickType xLastWakeTime1; static portTASK_FUNCTION( vLEDFlashTask1, pvParameters ) { xLastWakeTime1 = xTaskGetTickCount ();
for( ;; ) { vTaskDelayUntil( &xLastWakeTime1, 1000 ); vParTestSetLED(1, 1);
vTaskDelayUntil( &xLastWakeTime1, 3000 ); vParTestSetLED(1, 0); } }
//task 2 static portTASK_FUNCTION( vLEDFlashTask2, pvParameters ) { for( ;; ) { vParTestSetLED(0, 0); taskYIELD(); } }
These tasks work fine (LED1 toggles with 1000, 3000 and LED 0 toggles all the time)
The problem occurs when i did the following: I changed the vLEDFlashTask2 to use vTaskDelayUntil (same as the vLEDFlashTask1 task) Now it looks like:
portTickType xLastWakeTime2; static portTASK_FUNCTION( vLEDFlashTask2, pvParameters ) { xLastWakeTime2 = xTaskGetTickCount (); for( ;; ) { vTaskDelayUntil( &xLastWakeTime2, 500 ); vParTestSetLED(0, 1);
vTaskDelayUntil( &xLastWakeTime2, 250 ); vParTestSetLED(0, 0); } }
The problem is, when I run the first vTaskDelayUntil (no matter on which task) I get "stuck" inside the idle task forever and nothing else happens. The tick timer works fine.
RE: using vTaskDelayUntil in more then one taskPosted by Richard on September 7, 2010 > I use FreeRTOS V6.0.5 on ARM1176JZF-S I created two small tasks to > test freeRtos:
There is no official ARM11 port so I would be appreciate it if you could upload the code to the FreeRTOS interactive site: http://interactive.freertos.org
I think the modified code you describe that does not work has the exact same structure as the simple flashing led example that comes in the FreeRTOS download, so should work. Take a look at FreeRTOS/Demo/common/minimal/flash.c.
Regards.
RE: using vTaskDelayUntil in more then one taskPosted by daniel on September 7, 2010 The code in the FreeRTOS/Demo/common/minimal/flash.c it acts as I described before.
RE: using vTaskDelayUntil in more then one taskPosted by Richard on September 7, 2010 You mean it fails? That is about as simple a test as possible and runs without fault on countless architectures. Sorry to say, but I would suggest there is a problem in your port.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|