<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000099">
<p>Dear all,</p>
<p>I am currently trying to develop a small RTEMS app running on a
GR712 LEON3 CPU.</p>
<p>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.</p>
<p>I have successfully compiled the development release of RTEMS
taken from the GIT repository and compiled with the following
options :</p>
<p><tt>--enable-rtemsbsp=leon3</tt><tt><br>
</tt><tt>--enable-smp=no</tt><tt><br>
</tt><tt>--enable-drvmgr=yes</tt></p>
<p>My application configuration code is the following:</p>
<p><tt>#define CONFIGURE_INIT</tt><tt><br>
</tt><tt>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</tt><tt><br>
</tt><tt>#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER</tt><tt><br>
</tt><tt>#define CONFIGURE_MICROSECONDS_PER_TICK 1000</tt><tt><br>
</tt><tt>#define CONFIGURE_TICKS_PER_TIMESLICE 100</tt><tt><br>
</tt><tt>#define CONFIGURE_INIT_TASK_ENTRY_POINT Init</tt><tt><br>
</tt><tt>#define CONFIGURE_INIT_TASK_NAME
rtems_build_name('F','A','W','3')</tt><tt><br>
</tt><tt>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_TASKS 3</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 200</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_SEMAPHORES 20</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_MSRP_SEMAPHORES 20</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_PERIODS 2</tt><tt><br>
</tt><tt>#define CONFIGURE_EXTRA_TASK_STACKS (50 *
RTEMS_MINIMUM_STACK_SIZE)</tt><tt><br>
</tt><tt>#define CONFIGURE_MAXIMUM_DRIVERS 32</tt><tt><br>
</tt><tt>#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32</tt><tt><br>
</tt><tt>#define CONFIGURE_CONFDEFS_DEBUG</tt><tt><br>
</tt><tt>#define CONFIGURE_INTERRUPT_STACK_SIZE (10 *
CONFIGURE_MINIMUM_TASK_STACK_SIZE)</tt><tt><br>
</tt><tt>#include <rtems/confdefs.h></tt><br>
<br>
</p>
To configure the driver manager, I have the following lines of code
:<br>
<br>
<tt>#if defined(RTEMS_DRVMGR_STARTUP)</tt><tt><br>
</tt><tt> #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</tt><tt><br>
</tt><tt> #define CONFIGURE_DRIVER_AMBA_GAISLER_APBUART</tt><tt><br>
</tt><tt> #endif</tt><tt><br>
</tt><tt> #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER</tt><tt><br>
</tt><tt> #define CONFIGURE_DRIVER_AMBA_GAISLER_GPTIMER</tt><tt><br>
</tt><tt> #endif</tt><tt><br>
</tt><tt>#endif</tt><tt><br>
</tt><tt>#define CONFIGURE_DRIVER_AMBAPP_GAISLER_B1553BRM</tt><tt><br>
</tt><tt>#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART</tt><tt><br>
</tt><tt>#include <drvmgr/drvmgr_confdefs.h></tt><br>
<br>
In my app, I simply open the device <tt>/dev/b153brm0</tt> which
returns the error code 19 (NODEV), with the following code:<br>
<br>
<tt>char* b1553brm_dev_name[] =
{"/dev/b1553brm0","/dev/b1553brm1","/dev/b1553brm2"};</tt><tt><br>
</tt><br>
<tt>for(minor = 0; minor < 3; minor++)</tt><tt><br>
</tt><tt>{</tt><tt><br>
</tt><tt> printf("Opening device '%s'... ",
b1553brm_dev_name[minor]);</tt><tt><br>
</tt><tt> fd_b1553brm[minor] = open(b1553brm_dev_name[minor],
O_RDWR);</tt><tt><br>
</tt><tt> if(fd_b1553brm[minor] != -1)</tt><tt><br>
</tt><tt> {</tt><tt><br>
</tt><tt> printf("ok (fd = %d)\n",
(int)fd_b1553brm[minor]);</tt><tt><br>
</tt><tt> first_dev = minor;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> else</tt><tt><br>
</tt><tt> printf("failed (fd = %d, errno = %d)\n",
(int)fd_b1553brm[minor], errno);</tt><tt><br>
</tt><tt>}</tt><br>
<br>
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 <tt>first_dev</tt>).<br>
<br>
If I do not define the <tt>CONFIGURE_DRIVER_AMBAPP_B1553BRM</tt>,
then the <tt>open()</tt> function returns the value 2 which means
that the file <tt>/dev/b1553brm</tt> does not exist, which seems to
be consistent.<br>
<br>
Since I have debug messages displayed by the B1553BRM driver, I see
that the driver is successfully registered, and that the file
descriptor <tt>/dev/b1553brm</tt> is successfully created.<br>
<br>
When I go deeper into the b1553brm driver, in the <tt>brm_open()</tt>
function, it appears that the error comes from the call to <tt>drvmgr_interrupt_register(...)</tt>
function which fails. For information, that function is located in
the file <tt>./c/src/lib/libbsp/sparc/shared/1553/b1553brm.c</tt>.<br>
<br>
For the moment, I cannot figure out why the interrupt registration
fails.<br>
<br>
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. <br>
<br>
In the source code given above, do you see something that I make
wrong ?<br>
<br>
Do you have a rough idea on what is going wrong with the interrupt
registration ?<br>
<br>
I would really appreciate your feedback.<br>
<br>
Thanks in advance.<br>
<br>
Charles<br>
<br>
<br>
<br>
<br>
<br>
<div class="moz-signature">-- <br>
<table border="0" width="750px">
<tbody>
<tr>
<td>
<b>Charles INGELS</b><br>
Embedded software expert<br>
<font face="courier"><a class="moz-txt-link-abbreviated" href="mailto:charles.ingels@syderal.ch">charles.ingels@syderal.ch</a></font><br>
Phone <i>+41 (0)32 338 99 10</i> <br>
iNum <i>+883 5100 0902 7759</i> <br>
<br>
<b>SYDERAL SA</b> <br>
Neuenburgstrasse 7 <br>
CH-3238 Gals (Suisse) <br>
Desk <i>+41 (0)32 338 98 00</i> <br>
Fax <i>+41 (0)32 338 99 34</i> <br>
Web site <a class="moz-txt-link-freetext" href="http://www.syderal.ch">http://www.syderal.ch</a> <br>
</td>
<td>
<img src="cid:part1.B2F4C25D.DA1BF923@syderal.ch"
height="65%" width="65%">
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>