Internal Error RTEMS API

Vishav.Vishav at dlr.de Vishav.Vishav at dlr.de
Wed Dec 11 10:04:34 UTC 2019


Hi,


I am creating a c++ rtems application. I have already been able to run a hello world application. In my current application, I declare a class object in the task function. This class has been defined in other .h and .cpp files which have been included in the current application. The application compiles successfully but when I run the application, I get the following error:


I am in Init
declaring class object

*** FATAL ***
fatal source: 1 (INTERNAL_ERROR_RTEMS_API)
fatal code: 4026597379 (0xf0010003)
RTEMS version: 5.0.0.f3e0c73594aee72ba32eccf1c622364a8e72fda4
RTEMS tools: 7.4.1 20190514 (RTEMS 5, RSB cd67edb7ca371c79b72223496393813457afd)
executing thread ID: 0x08a010002
executing thread name: APP1

To verify if it is not the problem in declaration, I created a test class in .h and .cpp file which I am including. If I declare this class object, the app compiles and runs successfully. I think, there might be a problem in this particular class but how can I find this problem. Does the fatal code gives me a hint? Here is my source code:

#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <myapp.h>

rtems_task user_application(rtems_task_argument argument);

//class test1{
//
//public:
//    test1()
//    {
//        printf("constructor created\n");
//    }
//};
extern "C" {
  rtems_task Init(
    rtems_task_argument ignored
  );
};
rtems_task Init(
    rtems_task_argument ignored
)
{
    rtems_id          tid;
    rtems_status_code status;
    rtems_name        name;

    name = rtems_build_name( 'A', 'P', 'P', '1' );

    status = rtems_task_create(
        name, 1, RTEMS_MINIMUM_STACK_SIZE,
        RTEMS_PREEMPT, RTEMS_FLOATING_POINT, &tid
    );
    if ( status != RTEMS_SUCCESSFUL ) {
        printf( "rtems_task_create failed with status of %d.\n", status );
        exit( 1 );
    }
    printf("I am in Init\n");
    status = rtems_task_start( tid, user_application, 0 );
    if ( status != RTEMS_SUCCESSFUL ) {
        printf( "rtems_task_start failed with status of %d.\n", status );
        exit( 1 );
    }
    sleep(10);
    status = rtems_task_delete( tid );    /* should not return */

    printf( "rtems_task_delete returned with status of %d.\n", status );
    exit( 1 );
}

rtems_task user_application(rtems_task_argument argument)
{

    printf("declaring spw device\n");
    usleep(50);
    MyClass obj;
    /* application specific initialization goes here */
    while ( 1 )  {              /* infinite loop */
        /*  APPLICATION CODE GOES HERE
         *
         *  This code will typically include at least one
         *  directive which causes the calling task to
         *  give up the processor.
         */
        printf("Hello\n");
        int x = sleep(1);
        printf("%d\n", x);
    }
}

#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
/* The Clock Driver supplies the clock tick. */
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'E', 'X', 'A', 'M' )
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>

Regards
Vishav

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20191211/575b3605/attachment-0001.html>


More information about the users mailing list