compile error in rtems/confdefs header

Vishav.Vishav at dlr.de Vishav.Vishav at dlr.de
Tue Nov 26 17:31:01 UTC 2019


Hello,

To explain my problem, here are my system details:

RTEMS Version: 5.0.0
RTEMS tools: 7.4.1
BSP: Custom BSP adopted from Xilinx_zynq
Build tool: scons

While compiling I get the following error:

In file included from /tools/modulesystem/tools/rtems/rtems/bsps/5/arm/arm-rtems5/xilinx_zynq_scosa/lib/include/rtems/confdefs.h:320:0,
from */examples/rtems_hello/init.c:70:
*/lib/include/rtems/imfs.h: In function '_IMFS_get_time':
*/lib/include/rtems/imfs.h:344:18: error: storage size of 'now' isn't known
   struct bintime now;

The sample application has been taken from rtems website and looks like this:

#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/unistd.h>

rtems_task user_application(rtems_task_argument argument);
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_NO_PREEMPT, RTEMS_FLOATING_POINT, &tid
    );
    if ( status != RTEMS_SUCCESSFUL ) {
        printf( "rtems_task_create failed with status of %d.\n", status );
        exit( 1 );
    }

    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 );
    }

    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)
{
    /* 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");
    sleep(1);
    }
}

#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
/* The Clock Driver supplies the clock tick. */
//#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 1
#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>

I have been successful in building the RTEMS sample applications (ticker, hello-world). I am using scons to build the application. I am not using any CFLAGS for -std. I tried with -std=c99 and -std=c11 but I get the same error. However, if  I use -std=pedantic, then compilation succeeds but fails while running with the error: rtems_task_create failed with status of 5.

Similar issue I have found at the following link:  https://lists.rtems.org/pipermail/devel/2018-November/023693.html   but doesn't help unfortunately.

Regards
Vishav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20191126/64aab64f/attachment.html>


More information about the users mailing list