#3761 closed defect (invalid)

RTEMS Object creation failed when using RTEMS with LEON3 BSP.

Reported by: Ashritha Owned by:
Priority: normal Milestone:
Component: admin Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

I am building dual core using LEON3 IP cores provided with GRLIB library in Cobham Gaisler website.
The RTEMS 5 version is also provided in the same website.
I have instantiated 2 LEON3 IP cores. Enabled SMP.
Created a simple rtems C program of creating a task. But task creation is failing with Statius code - RTEMS_INVALID_ADDRESS
In my makefile I have used -qbsp=leon3_smp switch.

Change History (7)

comment:1 Changed on Jun 24, 2019 at 11:26:21 AM by Joel Sherrill

You will have to provide your task create call. But this error is documented as meaning the I'd parameter is NULL.https://docs.rtems.org/releases/rtemsdocs-4.6.2/share/rtems/html/c_user/c_user00065.html

comment:2 Changed on Jun 25, 2019 at 3:50:29 AM by Ashritha

Thank You for the reply. I have gone through the link you have provided and I am aware of it from C User documentation of RTEMS.
However in what case does ID parameter be NULL, When I am very much declaring it? I have taken the code from the example application(1.37) provided in the RTEMS C User Documentation. Its as follows :

#include <rtems.h>
#include <bsp.h>

#define CONFIGURE_MAXIMUM_PROCESSORS 2
#define CONFIGURE_SMP_APPLICATION TRUE
#define CONFIGURE_SCHEDULER_PRIORITY_SMP TRUE

rtems_task Init(

rtems_task_argument ignored

)
{

rtems_id id;

status = rtems_task_create(

rtems_build_name( 'T', 'A', ch, ' ' ),
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_NO_PREEMPT,
RTEMS_FLOATING_POINT,
&id

);

if (status!=RTEMS_SUCCESSFUL) {

if (status = RTEMS_INVALID_ADDRESS)

printf("TASK CREATION : RTEMS_INVALID_ADDRESS ERROR \n");

}

}

comment:3 in reply to:  2 Changed on Jun 27, 2019 at 7:14:08 AM by Sebastian Huber

Replying to Ashritha:
[...]

if (status = RTEMS_INVALID_ADDRESS)

printf("TASK CREATION : RTEMS_INVALID_ADDRESS ERROR \n");

[...]

You should turn on and pay attention to compiler warnings to avoid bugs like this. Here you assign the value RTEMS_INVALID_ADDRESS to status.

comment:4 Changed on Jul 6, 2019 at 9:25:55 AM by Ashritha

Thank You for bringing out the mistake in the program. However after I set it correct, task creation is still failing. But now it is showing RTEMS_UNSATISFIED error.

Does it mean the stack size defined by RTEMS_MINIMUM_STACK_SIZE is not available really or should we based on the application redefine the MINIMUM_STACK_SIZE ?

comment:5 Changed on Jul 6, 2019 at 1:54:52 PM by Joel Sherrill

If that's your entire configuration, you forgot to configure any application tasks. Look at any of the examples.

comment:6 Changed on Jul 8, 2019 at 5:38:46 AM by Sebastian Huber

Please have a look at the API documentation:

https://docs.rtems.org/branches/master/c-user/task_manager.html#rtems-task-create

RTEMS_UNSATISFIED non-preemption mode not supported on SMP system

You should update to the latest RTEMS master, if you want to use the SMP support.

comment:7 Changed on Jul 8, 2019 at 5:39:57 AM by Sebastian Huber

Resolution: invalid
Status: newclosed

The right error status is returned for this application error.

Note: See TracTickets for help on using tickets.