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] [July 2017 Threads]
Hi again! I'm trying to run freeRTOS demo application in the Explorer16/32 demo board with PIC24FJ1024GB610 MCU.
In other topic I comment a problem related with the task (or set of tasks) named #4 in FreeRTOS demo application. It is failing. But another question came up observing the behavior of it.
In this example, there is one task wich only role is to "talk" with the LCD (like a 'gatekeeper task' according to the official comments).
This task is initialized from main.c file:
~~~
/* Start the task that will control the LCD. This returns the handle
to the queue used to write text out to the task. /
xLCDQueue = xStartLCDTask();
~~~
xStartLCDTask() code is:
~~~
QueueHandle_t xStartLCDTask( void )
{
/ Create the queue used by the LCD task. Messages for display on the LCD
are received via this queue. */
xLCDQueue = xQueueCreate( lcdQUEUE_SIZE, sizeof( xLCDMessage ) );
/* Start the task that will write to the LCD. The LCD hardware is
initialised from within the task itself so delays can be used. */
xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL );
return xLCDQueue;
}
~~~
And the task code is next:
~~~
static void vLCDTask( void *pvParameters )
{
xLCDMessage xMessage;
unsigned short usRow = 0;
/* Remove compiler warnigns. */
( void ) pvParameters;
/* Initialise the hardware. This uses delays so must not be called prior
to the scheduler being started. */
prvSetupLCD();
/* Welcome message. */
prvLCDPutString( "www.FreeRTOS.org" );
for( ;; )
{
/* Wait for a message to arrive that requires displaying. */
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
/* Clear the current display value. */
prvLCDClear();
/* Switch rows each time so we can see that the display is still being
updated. */
prvLCDGotoRow( usRow & 0x01 );
usRow++;
prvLCDPutString( xMessage.pcMessage );
/* Delay the requested amount of time to ensure the text just written
to the LCD is not overwritten. */
vTaskDelay( xMessage.xMinDisplayTime );
}
}
~~~
If I'm not wrong, the code** prvLCDPutString( "www.FreeRTOS.org" );** should run just once, when the vLCDTask is initialized. Instead, I'm watching the message** "www.FreeRTOS.org"** in my LCD display frecuently. So, is the demo application resetting itself?
On the other hand, like I mentioned at the beggining, Task #4 is failing and I don't know the cause.
Are this two issues related?
I apreciate a lot your help.
Is there a watchdog timer resetting the system?
I don't think so. Where WATCHDOG should be configured? What I'm running is the original freeRTOS demo application with minimal changes in the lcd driver. I also disabled a task that was trying to use a serial port that is no longer available (the demo was coded to an older version of the demo board Explorer16).
I searched the entire project for the term "watchdog" and "dog" and no results were found.
The watchdog would be in the hardware, not in the software. I'm pretty
sure people have used the part with newer files, or newer IDE versions
that don't set fuses to turn the watchdog off, etc.
It's supposed to be turned off, right?
You either need to ensure it is turned off, or periodically reset it.
Look in the hardware manual for the device you are using.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.