Quality RTOS & Embedded Software

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




Loading

LM3S811 demo questions

Posted by Antonio Pessina on March 23, 2010
Hello.

I'm learning to use the FreeRTOS and I'm modifying the LM3S811 demo.
I've added a simple led flasher task, getting good results.
Then I've added a very simple dummy task which increments a variable.
Also this new task works ok, but... the vCheckTask fails, returning xErrorOccurred = pdTRUE.
This strange behaviour appears when I add the dummy task to the existing ones and also when I leave it alone removing from the code the led flasher task.
In other words, the problem seems to be related to the dummy task itself.

I use the heap_1.c and I set the following defines to:

#define configMINIMAL_STACK_SIZE( ( unsigned short ) 70 )
#define configTOTAL_HEAP_SIZE( ( size_t ) ( 7500 ) )

Here's the small piece of code that I use:

static void vDummyTask( void *pvParameters );
xTaskCreate( vDummyTask, "Dummy", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );
static void vDummyTask( void *pvParameters )
{
unsigned portLONG ulSpy = 0;
for( ;; )
{
ulSpy++;
}
}

Any suggestion?

Thank You

Antonio

RE: LM3S811 demo questions

Posted by MEdwards on March 23, 2010
Your task never enters the Blocked state so will starve tasks that use lower priorities. The check task looks at every task to ensure it is still running and will indicate an error if any are being starved of processing time.

Try adding vTaskDelay(10) to the loop, or creating the task at the idle priority. Either will then allow lower priority tasks to continue executing.

RE: LM3S811 demo questions

Posted by Antonio Pessina on March 24, 2010
Great!!!
You're completely right.
The little vTaskDelay (10) added to the loop is enough to fix the problem.
I'm checking in this exact moment to what happens in the vCheckTask, setting some breakpoints to get the fail reason.
I can see that the error flag is set because the following condition is met:
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
xErrorOccurred = pdTRUE;
Thank You Very Much
Antonio (Milano-Italy)


[ 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