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

vTaskDelayUntil

Posted by Nobody/Anonymous on February 22, 2006
I'm trying to use the vTaskDelayUntil :
I have 3 tasks
- task 1 : priority 1 and it is resuming task 2
- task 2 : priority 2 and it is itself suspending
- task 3 : using vTaskDelayUntil like in FreeRTOS example

and it is scheduling like this
task 3 wake up + sleeping
task 2
task 1
task 2
task 1
task 2
task 3 wake up by timer + sleeping
task 1
task 1
....
task 3 wake up by timer + sleeping
task IDLE ....

I don't understand why it is 'killing" the other task : the value of uxNumberOfItems for the
pxReadyTasksLists[2] & [3] became 0 ????

task 3 is priority 3 and task 1 is my low priority task in which there is always something to do
static void task1( void *pvParameters )
{
( void ) pvParameters;
for( ;; )
{
//there is always something : polling + TaskResume(Task2) so pxReadyTasksLists[1].uxNumberOfItems must be always 1

}
}

static void task2( void *pvParameters )
{
( void ) pvParameters;
for( ;; )
{
//code + TaskSuspend(NULL)

}
}


static void task3( void *pvParameters )
{
portTickType xDelayPeriod = 100;
portTickType xLastWakeTime;

( void ) pvParameters;

xLastWakeTime = xTaskGetTickCount();

for( ;; )
{
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
//code
}
}

I understand pxReadyTasksLists[2].uxNumberOfItems can be 0 because I'm suspending it but for the task1 it must be always 1 but in my case this task is not working anymore as I wrote before.

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 22, 2006
Nothing obviously wrong. This is your only code? Have you changed the os code at all?

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 23, 2006
Hello,

We have a RAISONNANCE evaluation board which is using RIDE development. I must have done the "portage" to RIDE and I did this from the IAR one of the STR for the port part and I use the GCC LPC2106 for the gcc part and I'm turning in arm mode for the task.
I think I must have done something wrong because when I'm changing the compile option (for example -finline-functions or no) the os is working differently for the vTaskDelayUntil.
Once it is doing :
task 3 wake up + sleeping
task 2
task 1
task 2
task 1
task 2
task 3 wake up by timer + sleeping
task 1
task 1
....
task 3 wake up by timer + sleeping
task IDLE ....

and the other it's doing :
task 3 wake up + sleeping
task 2
task 1
task 2
task 1
task 2
task 3 wake up by timer + sleeping
task IDLE ....


in GCC LPC2106 makefile there is no -finline-functions : I must use it? What are the options in IAR : I can't read them because we don't have IAR and there is no makefile.
Is there -ansi? -mapcs-frame? -fvolatile? o1? -g (debug)? -L? etc ...

I hope I was clear
Thanks

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 23, 2006
I am confused. You have created a GCC STR71X port from combining the STR71X IAR port and the LPC2000 GCC port. Correct?

Have you tried it with optimisation turned off? Sometimes the optimisation can be very aggressive in GCC.

Also, GCC is likely to use more stack than IAR. Perhaps try increasing the stack sizes.

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 24, 2006
that's it, we have created a GCC STR71X port from combining the STR71X IAR port and the LPC2000 GCC port.
optimization : -o1 + debug -g

I just notice after several executions that :
- the tasksuspend & taskresume is working well
- fifo is working well
- semaphore is working well
- vTaskDelayUntil is not working well
and I'm wondering that what is working is when there is taskYield : switch context with software interrupt and vTaskDelayUntil is working good when we are stopping the task because it's switching context with taskYield and when we are reputting the task when the tick is good (in wdg interrupt) something wrong is happening. So I have pb with switching context with the wdg timer and I don't understand why? : thumb code, not possible normally because we are in ARM in IT? I'm trying to find solutions but now I'm still searching.
Thanks

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 24, 2006
Have you tried giving more stack to each task. Maybe the time value is getting whacked.

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 24, 2006
I increase configMinimalStackSize in Freertosconfig.h but it's changing nothing. I don't understand the ink between the stack size and the tick?

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 24, 2006
I increase configMinimalStackSize in Freertosconfig.h but it's changing nothing. I don't understand the ink between the stack size and the tick?

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on February 24, 2006
I just found an idea and it is working well now :
the taskyield is calling SWI interrupt which is in supervisor mode and in this case everything is working well and the timerWDG is in IRQ mode and not in supervisor mode so in vPortPreemptiveTick (function called in WDG), I'm doing a SWI interrupt and I added in vPortYiledProcessor the vTAskIncrement just to try if it will work and in this case the vTaskDelayUntil is working and the tasks are switching normally.

So I don't understand for the port for IAR/STR710 : is it good or no for the WDG Timer because we are not in supervisor mode in this case?
Which changes must I do for the WDG timer to be in supervisor mode.

Thanks


[ 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