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

taskYIELD()

Posted by Nobody/Anonymous on August 5, 2006
Hi,

I 'am programing a project with FreeRtos 3.2.2, IAR 4.40 and a AT91Sam7S256.
The project has 2 tasks with the same priority. The second task checks UART activity:

void vDeviceTask( void *pvParameters ) {
while(1) {
...
taskYIELD();
}
}

Checking the UART takes not much time so taskYIELD "restarts" the main task.

After a short time the system crash complettly:
The IO's are reprogramed, the OSC stops , the reset pin is no longer activ and the watchdog is not able to restart the system.

When i remove the taskYIELD() line the program run stable over days.

Below are the RTOS settings:

#define configUSE_PREEMPTION1
#define configUSE_IDLE_HOOK0
#define configCPU_CLOCK_HZ( ( unsigned portLONG ) 47923200 )
#define configTICK_RATE_HZ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES( ( unsigned portBASE_TYPE ) 2 )
#define configMINIMAL_STACK_SIZE( ( unsigned portSHORT ) 500 )
#define configTOTAL_HEAP_SIZE( ( size_t ) 10000 ) // 14200
#define configMAX_TASK_NAME_LEN( 16 )
#define configUSE_TRACE_FACILITY0
#define configUSE_16_BIT_TICKS0
#define configIDLE_SHOULD_YIELD1

#define INCLUDE_vTaskPrioritySet0
#define INCLUDE_uxTaskPriorityGet0
#define INCLUDE_vTaskDelete0 #define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend0 #define INCLUDE_vTaskDelayUntil0
#define INCLUDE_vTaskDelay1

Has anybody an idea what is going wrong in the original code ?

There some points in my code where i like to use
taskYIELD() instead of vTaskDelay(1).

This crash doesn't happens when the code is running under IAR debugger !

Thanks for your comments.

Regards

Rainer


RE: taskYIELD()

Posted by Nobody/Anonymous on August 5, 2006
It is interesting that it works fine with the debugger. Are you using different optimisation levels between the debug and non debug versions? If so it could well be a missing volatile or something of that nature.

What are the optimisation settings you are using.

Before Richard asks the question :-) are you sure you are not just running out of stack space. Try making the stacks bigger in the tasks.

On the SAM7 the reset button input is setup in software, maybe the same is true of the watchdog.

RE: taskYIELD()

Posted by Nobody/Anonymous on August 7, 2006
Hi,

thanks for your response.
It seams that taskYIELD() is not the problem. With some other test parameters the problem still occurs.
This morning it happens with the debugger but we are not able to access the arm core.
The problem also happens with debug code in the past, so it seams not to be an optimization problem.
I have checked the stack while the system works and there is sufficient space on stack.
We are familiar with the reset and watchdog setting and the watchdog works fine when we have an endless loop in the main task.
When the error happens it seams that a couple of processors registers are changed and the core stops.
The main problem is, that the error occurs not very reliable.

Regards

Rainer



RE: taskYIELD()

Posted by Nobody/Anonymous on August 7, 2006
Are you able to set a data breakpoint? If so can you set one on the watchdog register so the program breaks when it gets written to?

RE: taskYIELD()

Posted by Nobody/Anonymous on August 7, 2006
We have notice this problem only once or twice unter debugger controll. It happens mostly without debugger controll.




[ 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