Quality RTOS & Embedded Software

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




Loading

Suspending a higher priority Task

Posted by sanhardik on March 16, 2015

Dear All, We are trying a code on Atmel SAM D21 for FreeRTOS. We have defined 2 tasks, one is a UART task that writes a string on the terminal and other one toggles a LED. The UART task has a higher priority than the LED task. When the UART task is suspended using vTaskSuspend(uarttaskhandle), the LED task which has a lower priority doesnt execute.

Is this expected ?

Thanks


Suspending a higher priority Task

Posted by rtel on March 16, 2015

If the two tasks are independent then, no, that is not expected.

Does the LED task run when the UART task is not suspended?

Regards.


Suspending a higher priority Task

Posted by embeddedindia on March 17, 2015

Hi All, I also found similar issue on SAMD21 Evaluation Board with FreeRtos.

case 1: UartTaskpriority ==> 1 & LEDTaskPriority ==> 2 Handler is Declared but not assigned to any task. both the task didn't execute with suspending the handler

case 2: UartTaskpriority ==> 2 & LEDTaskPriority ==> 1 Handler is Declared but not assigned to any task. LEDTask is executed. But, UartTask is not executed. with suspending the handler.

case 3: UartTaskpriority ==> 2 & LEDTaskPriority ==> 1 Handler is Declared but not assigned to any task. both the task didn't execute. without suspending the handler

case 4: USRTASKPRIORITY ===> 3 UartTaskpriority ==> 2 & LEDTaskPriority ==> 1 handler is assigned to USRTask LEDTask & Uart_Task executed. with suspending the handler.

case 5: USRTASKPRIORITY ===> 1 UartTaskpriority ==> 2 & LEDTaskPriority ==> 3 handler is assigned to USRTask UartTask is executed. But, LED_Task is not executed. with suspending the handler.

case 6: USRTASKPRIORITY ===> 1 UartTaskpriority ==> 3 & LEDTaskPriority ==> 2 handler is assigned to USRTask LEDTask is executed. But, Uart_Task is not executed. with suspending the handler.

case 7: USRTASKPRIORITY ===> 1 UartTaskpriority ==> 3 & LEDTaskPriority ==> 2 handler is assigned to USRTask LEDTask is executed. But, Uart_Task is not executed. without suspending the handler.

case 8: USRTASKPRIORITY ===> 1 UartTaskpriority ==> 2 & LEDTaskPriority ==> 3 handler is assigned to USRTask UartTask is executed. But, LED_Task is not executed. without suspending the handler.

please helpme out in fixing these issue.

Thank you


Suspending a higher priority Task

Posted by edwards3 on March 17, 2015

What do you mean "Handler is Declared but not assigned to any task" and "handler is assigned to USR_Task", etc? What handler? Could you have a buggy UART driver? Did you try with a simple polling driver in place of whatever you are using now?


Suspending a higher priority Task

Posted by embeddedindia on March 19, 2015

static xTaskHandle terminaltaskhandle; // Declaration of task handler

xTaskCreate(taskUSR,(const char *) "USR",configMINIMALSTACKSIZE,NULL,USRTASKPRIORITY,terminaltask_handle);

xTaskCreate(taskuart,(const char *) "Uart",configMINIMALSTACKSIZE,NULL,UARTTASK_PRIORITY,NULL);

xTaskCreate(ledtask,(const char *) "LED",configMINIMALSTACKSIZE,NULL,LEDTASK_PRIORITY,NULL);

Initially, taskuart & ledtask was created to which the handler was not assigned. To further understand we created one more task i.e. taskUSR to which we assigned handler. so that we can suspend or resume the task. But, presently we are only suspending the taskUSR not resuming it back ever.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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