<div dir="auto">I'm going to assume that Daniel didn't see this since he didn't comment.</div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 10, 2017 2:41 AM, "Charles INGELS" <<a href="mailto:charles.ingels@syderal.ch">charles.ingels@syderal.ch</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div 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_<wbr>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\<wbr>libbsp\sparc\shared\uart\<wbr>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="m_-5841158778217462889moz-signature">-- <br>
      <table border="0" width="750px">
        <tbody>
          <tr>
            <td>
              <b>Charles INGELS</b><br>
              Embedded software expert<br>
              <font face="courier"><a class="m_-5841158778217462889moz-txt-link-abbreviated" href="mailto:charles.ingels@syderal.ch" target="_blank">charles.ingels@syderal.ch</a></font><br>
              Phone <i><a href="tel:+41%2032%20338%2099%2010" value="+41323389910" target="_blank">+41 (0)32 338 99 10</a></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><a href="tel:+41%2032%20338%2098%2000" value="+41323389800" target="_blank">+41 (0)32 338 98 00</a></i> <br>
              Fax <i><a href="tel:+41%2032%20338%2099%2034" value="+41323389934" target="_blank">+41 (0)32 338 99 34</a></i> <br>
              Web site <a class="m_-5841158778217462889moz-txt-link-freetext" href="http://www.syderal.ch" target="_blank">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>
  </div>

<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br></blockquote></div><br></div>