Using B1553BRM driver with RTEMS latest release

Charles INGELS charles.ingels at syderal.ch
Tue Dec 20 15:04:52 UTC 2016


Dear all,

I am currently trying to develop a small RTEMS app running on a GR712
LEON3 CPU.

My goal is to use several drivers coming from the GRLib. The first one
that I want to use is the B1553BRM driver to turn the board into an RT
device.

I have successfully compiled the development release of RTEMS taken from
the GIT repository and compiled with the following options :

--enable-rtemsbsp=leon3
--enable-smp=no
--enable-drvmgr=yes

My application configuration code is the following:

#define CONFIGURE_INIT
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MICROSECONDS_PER_TICK        1000
#define CONFIGURE_TICKS_PER_TIMESLICE            100
#define CONFIGURE_INIT_TASK_ENTRY_POINT        Init
#define CONFIGURE_INIT_TASK_NAME rtems_build_name('F','A','W','3')
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MAXIMUM_TASKS                        3
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    200
#define CONFIGURE_MAXIMUM_SEMAPHORES    20
#define CONFIGURE_MAXIMUM_MSRP_SEMAPHORES    20
#define CONFIGURE_MAXIMUM_PERIODS        2
#define CONFIGURE_EXTRA_TASK_STACKS            (50 *
RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_MAXIMUM_DRIVERS        32
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
#define CONFIGURE_CONFDEFS_DEBUG
#define CONFIGURE_INTERRUPT_STACK_SIZE    (10 *
CONFIGURE_MINIMUM_TASK_STACK_SIZE)
#include <rtems/confdefs.h>

To configure the driver manager, I have the following lines of code :

#if defined(RTEMS_DRVMGR_STARTUP)
    #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
        #define CONFIGURE_DRIVER_AMBA_GAISLER_APBUART
    #endif
    #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
        #define CONFIGURE_DRIVER_AMBA_GAISLER_GPTIMER
    #endif
#endif
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_B1553BRM
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
#include <drvmgr/drvmgr_confdefs.h>

In my app, I simply open the device /dev/b153brm0 which returns the
error code 19 (NODEV), with the following code:

char* b1553brm_dev_name[] =
{"/dev/b1553brm0","/dev/b1553brm1","/dev/b1553brm2"};

for(minor = 0; minor < 3; minor++)
{
        printf("Opening device '%s'... ", b1553brm_dev_name[minor]);
        fd_b1553brm[minor] = open(b1553brm_dev_name[minor], O_RDWR);
        if(fd_b1553brm[minor] != -1)
        {
            printf("ok (fd = %d)\n", (int)fd_b1553brm[minor]);
            first_dev = minor;
        }
        else
            printf("failed (fd = %d, errno = %d)\n",
(int)fd_b1553brm[minor], errno);
}
   
As you can see, I try to open all b1553brm devices, with minor value
ranging from 0 to 3, and I memorize the first available device (in
variable first_dev).

If I do not define the CONFIGURE_DRIVER_AMBAPP_B1553BRM, then the open()
function returns the value 2 which means that the file /dev/b1553brm
does not exist, which seems to be consistent.

Since I have debug messages displayed by the B1553BRM driver, I see that
the driver is successfully registered, and that the file descriptor
/dev/b1553brm is successfully created.

When I go deeper into the b1553brm driver, in the brm_open() function,
it appears that the error comes from the call to
drvmgr_interrupt_register(...) function which fails. For information,
that function is located in the file
./c/src/lib/libbsp/sparc/shared/1553/b1553brm.c.

For the moment, I cannot figure out why the interrupt registration fails.

I just wanted to ask if someone has already used the B1553BRM driver and
what was his/her feedback on how to use such driver.

In the source code given above, do you see something that I make wrong ?

Do you have a rough idea on what is going wrong with the interrupt
registration ?

I would really appreciate your feedback.

Thanks in advance.

Charles





-- 
*Charles INGELS*
Embedded software expert
charles.ingels at syderal.ch
Phone /+41 (0)32 338 99 10/
iNum /+883 5100 0902 7759/

*SYDERAL SA*
Neuenburgstrasse 7
CH-3238 Gals (Suisse)
Desk /+41 (0)32 338 98 00/
Fax /+41 (0)32 338 99 34/
Web site http://www.syderal.ch
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20161220/78d737ab/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20161220/78d737ab/attachment-0001.html>


More information about the users mailing list