RTEMS/TSIM problem

Joel Sherrill joel.sherrill at OARcorp.com
Thu Oct 2 18:33:03 UTC 2008


You must have missed my private answer.

The test runs as expected.  The POSIX thread reaches the end of the method
and returns.  This is an implicit thread exit.  With or without the print,
the system ends up in the IDLE task.

--joel

Cassia Yuri wrote:
> Hello all!
>
>  I'm using RTEMS 4.8, in a target platform sparc, the BSP is leon2.
>  I'm running the sparc applications with TSIM2.
>
> The problem occurs randomly on the RTEMS/TSIM platform. When I compile 
> sparc programs with a specific combination of instructions I have no 
> compilation errors, but when I run the application the program simply 
> hangs up.
>
> I put below an example of a simple program that hangs up on RTEMS/TSIM 
> platform.
>  If I uncomment the line "//printf("end\n");" the program runs fine. 
> Would you have a clue for me????
>
> The program runs on tsim-leon with or without that line for me.  When 
> a POSIX thread
> exits, it is not an error.  Your thread is falling off the bottom and 
> is silently deleted.
> Then the IDLE task is running.  Same with and without the line and the 
> behavior
> is correct as defined.
>
>
> /* -- system includes -- */
>
> #include <stdio.h>
>
> #include <time.h>
>
> #include <bsp.h>
>
> #include <string.h>
>
> #include <pthread.h>
>
> #include <time.h>
>
> #include <errno.h>
>
> #include <stdio.h>
>
> #include <stdlib.h>
>
> /* --------------------- */
>
> void *POSIX_Init( void *argument )
>
> {
>
> //--- simple application -----------------------------------------//
>
> int i2;
>
> int i;
>
> printf("-----------------------------\n");
>
> printf(" Simple program v1.0 \n");
>
> printf("-----------------------------\n");
>
> i=0;
>
> i2=12;
>
> i2 = i2 * i;
>
> printf("i2 = %d\n",i2);
>
> i = i * 4;
>
> printf("i = %d\n", i);
>
> //printf("end\n");
>
> //--- end ---------------------------------------------------------//
>
> }
>
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
>
> #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
>
> #define CONFIGURE_MAXIMUM_POSIX_THREADS 128
>
> #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 120
>
> #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 60
>
> #define CONFIGURE_MAXIMUM_TIMERS 10
>
> #define CONFIGURE_MAXIMUM_RTEMS_TIMERS CONFIGURE_MAXIMUM_TIMERS
>
> #define CONFIGURE_MAXIMUM_POSIX_TIMERS CONFIGURE_MAXIMUM_TIMERS
>
> #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
>
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>
> #define CONFIGURE_MICROSECONDS_PER_TICK 10
>
> #define CONFIGURE_MAXIMUM_TASKS 10
>
> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
>
>  
> #define CONFIGURE_INIT
>
>  
> #include <rtems/confdefs.h>
>
>  
> /* end of file */
>
> #endif
>
> Thanks a lot!!
>
> Cássia
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list