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

execution ends in prvTaskExitError(void) function.

Posted by karthik366 on March 24, 2014

i am running freertos with 3 tasks on msp430 initially and now i ported the code to stm32l152cb(stm32l152xb family) but here the execution ends in prvTaskExitError(void) how to solve this problem , the function definition is static void prvTaskExitError( void ) { /* A function that implements a task must not exit or attempt to return to its caller as there is nothing to return to. If a task wants to exit it should instead call vTaskDelete( NULL ).

Artificially force an assert() to be triggered if configASSERT() is
defined, then stop here so application writers can catch the error. */
configASSERT( uxCriticalNesting == ~0UL );
portDISABLE_INTERRUPTS();
for( ;; );

}

Does this mean that my tasks exit in between by returning some value.one of the tasks handles usart interrupts and other tasks resolve them. please throw some light on this


execution ends in prvTaskExitError(void) function.

Posted by rtel on March 24, 2014

prvTaskExitError() will be called if a task attempts to exit from its implementing function. See http://www.freertos.org/implementing-a-FreeRTOS-task.html

As you are using an STM32 make sure you call have configASSERT() defined and that you call NVICPriorityGroupConfig( NVICPriorityGroup_4 ). See: http://www.freertos.org/RTOS-Cortex-M3-M4.html

Regards.


execution ends in prvTaskExitError(void) function.

Posted by karthik366 on March 25, 2014

yes i am using NVICPriorityGroupConfig( NVICPriorityGroup_4 ). you mean #define configASSERT( x ) in FreeRTOS.h file? i didnt get it , where can i find some example of such assertion function. thanks for reply


execution ends in prvTaskExitError(void) function.

Posted by rtel on March 25, 2014

The easiest way to cause your program to halt when assert is called is to just add the following line to FreeRTOSConfig.h

define configASSERT( x ) if( x == 0 ) { taskDISABLE_INTERRUPTS(); for(;;); }


The traditional way of defining assert() is to pass the file name and line number into a function, in which case you would define as follows in FreeRTOSConfig.h:

void vAssertCalled( const char * pcFile, unsigned long ulLine );

define configASSERT(x) if((x)==0 ) vAssertCalled( FILE, LINE );


...and in a C file provide the implementation of the function, something like this.

void vAssertCalled( const char * pcFile, 
                    unsigned long ulLine )
{
volatile unsigned long ul = 0;

taskENTER_CRITICAL();
{
    while( ul == 0 )
    {
        portNOP();
    }
}
taskEXIT_CRITICAL();

}


Regards.


[ 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