Quality RTOS & Embedded Software

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


Loading

Time management FreeRTOS

Posted by ikram on January 12, 2007
I have three tasks.

static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets
static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets
static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets

Let suppose Subscription packets are generated every 10sec.

1. vTaskAd runs continuously until any reception of the
STYPE packet
2. vTaskSu(read the STYPE packets every time) run
continuously
3. If it found the STYPE packet then vTaskPu task will
start.
4. vTaskAd will goes to sleep until let suppose TTL=
1000ms and the vTaskPu will run till TTL=1000ms
5. After 1000ms the vTaskSu task again starts and do the
same above steps.


Could anyone please guide me I am facing problem with the time management of the tasks.

Time management FreeRTOS(New)

Posted by ikram on January 12, 2007
I have three tasks.

static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets
static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets
static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets

Let suppose SType packets are generated every 10sec.

1. vTaskAd runs continuously until any reception of the
STYPE packet
2. vTaskSu(read the STYPE packets every time) run
continuously
3. If it found the STYPE packet then vTaskPu task will
start.
4. vTaskAd will goes to sleep until let suppose TTL=
1000ms and the vTaskPu will run till TTL=1000ms
5. After 1000ms the vTaskSu task again starts and do the
same above steps.


Could anyone please guide me I am facing problem with the time management of the tasks.

RE: Time management FreeRTOS(New)

Posted by Richard on January 12, 2007
Sorry but I'm not sure what you are asking.

You are saying that vTaskAd runns until vTaskSu receives an SType packet (what ever that is)? Therefore task vTaskSu has to suspend vTaskAd when it receives a packet? Is this correct?

Regards.

RE: Time management FreeRTOS

Posted by ikram on January 14, 2007
I have three tasks.

static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets
static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets
static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets

Let suppose SType packets are generated every 10sec.

By default vTaskAd runs in the begning and vTaskSu keep listening the packets.
if in the mean time vTaskSu receive any Stype packets then it will suspend the vTaskAd(let suppose 1000ms) and it will run vTaskPu for the time of 1000ms. after 1000ms it will resume the vTaskAd..


I have not try time scheduling with freeRTOS could you please guide me what will be the commands for these tasks.


RE: Time management FreeRTOS(richard)

Posted by ikram on January 15, 2007
I have three tasks.

static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets
static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets
static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets

Let suppose SType packets are generated every 10sec.

By default vTaskAd runs in the begning and vTaskSu keep listening the packets.
if in the mean time vTaskSu receive any Stype packets then it will suspend the vTaskAd(let suppose 1000ms) and it will run vTaskPu for the time of 1000ms. after 1000ms it will resume the vTaskAd..


I have not try time scheduling with freeRTOS could you please guide me what will be the commands for these tasks.


RE: Time management FreeRTOS(richard)

Posted by Richard on January 15, 2007
I think the simplest way would be to simply call vTaskSuspend() to suspend the tasks when necessary. You can keep a track of the tick count, then call vTaskResume() when the time comes. You might even suspend one task, then call vTaskDelay( 1000 ) to know when it is time to resume it, and call vTaskResume() as soon as you unblock (assuming there is nothing else to do in the mean time).

Regards.

RE: Time management FreeRTOS

Posted by ikram on January 15, 2007

static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets

found Stype packet then

SuWakeTime = xTaskGetTickCount();
vTaskDelay(1000);

//Now I want to put vTaskAd to sleep to the same time as vTaskSu (Duration for both Tasks vTaskSu and vTaskAd for sleep is same)
-------

static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets

-------

//Now I want to AWAKE or Run vTaskPu for the time when vTaskSu and vTaskAd are in sleeping mode.

static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets

--------
//when the time of sleeping of vTaskAd and vTaskSu expired i want to send vTaskPu in sleep mode.

Please guide me i could not able to slove it.


[ 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