<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000099">
<p>Hello,</p>
<p>By using the APB Uart BSP on a SPARC LEON3 target, I think that I
have found something which seems to be incorrect.</p>
<p>In my RTEMS app, I just want to receive data through the UART1.
Such data are then echoed on the same interface.</p>
<p>When I want to open the '/dev/apbuart1' descriptor, I get a 'No
such file or directory' error message. I get the same error
message whatever is the descriptor I try to open ('/dev/apbuart0',
...).</p>
<p>I am using the driver manager and I have defined the
CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART to have the driver manager
create the device descriptors. However, the descriptors are not
created.</p>
<p>I had a look at the content of the following file :</p>
<p>U:\rtems\src2\rtems\c\src\lib\libbsp\sparc\shared\uart\apbuart_cons.c</p>
<p>On line #278, the if statement does not explicitly test the value
returned by the call to function 'drvmgr_get_dev_prefix()'.</p>
<p>Since such function returns 0 in case of success, the content of
the if statement is never executed. Consequently, the variable
'priv->devName' is never initialized to the right string
'/dev/apbuart%d', it is always empty which seems to explain why
the device descriptor is not not created.</p>
<p>I have slightly modified the test with the following code :</p>
<pre>if (drvmgr_get_dev_prefix(dev, prefix) != -1)
{
...
}
</pre>
<p>I explicitly test the returned value against -1 (which is
considered as an error). With that code, the '/dev/apbuartX'
device descriptors are successfully created and communicate with
the UART.</p>
<p>So is it a known bug ? Will it be fixed in the next releases ? Is
the way I fixed it correct, or no ?</p>
<p>Such fix works for me but are there some side effects that shall
be taken into account ?</p>
<p>Thanks for your answers,</p>
<p>Regards,</p>
<p>Charles</p>
<p><br>
</p>
<p><br>
</p>
<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.5AFFF6F6.FEA7B01F@syderal.ch"
height="65%" width="65%">
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>