Quality RTOS & Embedded Software

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



Posted by Nobody/Anonymous on August 5, 2006

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) {

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.



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

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.



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 ]    [ 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.

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.


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


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