<html><head><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head><body><div data-externalstyle="false" dir="ltr" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:12pt;"><div>Thanks for that Joel.  There is no problem with hardware knowledge.  I have been writing bare metal on the Raspberry Pi for about six months and have all the reference material I need, together with some experience of actually doing it!</div><div> </div><div>I have come into RTEMS for a hobby project I am working on at the moment, an autopilot for a semi-autonomous quadcopter based on the Raspberry Pi and some homemade electronics.  I had thought that I was going to have to develop a real time environment of my own.  RTEMS frees me of that seemingly monumental task.  I am interested in RTEMS from the application level (obviously) and, out of necessity the physical hardware level.  I am not that bothered about the bit in between as long as it does what it says on the tin.  RTEMS seems to fit that bill rather nicely.</div><div> </div><div>From my point of view (and I completely appreciate that this may differ radically from what others are looking for) I am really looking for documentation on the glue between the actual hardware drivers and the hardware abstraction layer.  The README that Alan pointed me at is a somewhat terse, but usable example of the sort of thing I was trying to find and I guess that the answer to finding the rest of the information is going to be to search for other documentation files in the hardware abstraction layer part of the tree.  I must confess that I had been looking on the internet rather than in the source tree as I hoped to avoid having to understand the code except where I had a specific need to know.  It appears I was neglecting a potentially rich source of information.</div><div> </div><div>Having said that, if there are any general design principle documents around this area, they would be useful, but I haven’t managed to find any.  Something that would be very nice would be if someone could recommend a single, mature example BSP that could be held up as ‘a perfect example of how to do it right’ that I could use as a template.  I just want to avoid redoing work that’s already been done and making mistakes that have already been made!</div><div> </div><div>For my project, I really just need I2C and SD Card, but I’ll probably also have a bash at the framebuffer and basic USB so that I can attach a monitor and keyboard for convenience.  Once I have something usable, I will publish them for the community to look at and use if they wish.  I plan to publish the entire application and avionics design once it works as I’m sure there will be at least one other person out there interested.</div><div> </div><div>My other need is documentation for the class library.  I want to write my application level code in C++, personal preference, I like OO development for applications.  I have worked some of it out and my test application flashes an LED using a C++ task, but mapping the C++ class library code onto the C Application Developers Guide is hard work!</div><div> </div><div data-signatureblock="true"><div>Sent from Windows Mail</div><div> </div></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face="Calibri, 'Segoe UI', Meiryo, 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'Khmer UI', 'Nirmala UI', Tunga, 'Lao UI', Ebrima, sans-serif" style='line-height: 15pt; letter-spacing: 0.02em; font-family: Calibri, "Segoe UI", Meiryo, "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "Khmer UI", "Nirmala UI", Tunga, "Lao UI", Ebrima, sans-serif; font-size: 11pt;'><b>From:</b> Joel Sherrill<br><b>Sent:</b> ‎Monday‎, ‎9‎ ‎September‎ ‎2013 ‎16‎:‎08<br><b>To:</b> Alan Cudmore<br><b>Cc:</b> Simon Williams; rtems-users@rtems.org</font></div></div><div> </div>
  
    
  
  
    <div class="moz-cite-prefix">On 9/9/2013 9:29 AM, Alan Cudmore
      wrote:<br>
    </div>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">Simon,
        <div>In my experience, there is no single place to get
          all of the information you need, especially for specific
          device driver development. In addition, it has taken me a
          while to feel comfortable navigating the RTEMS source tree and
          being able to quickly locate BSPs, drivers, and libraries. </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    RTEMS is a very large collection of software for a lot of hardware<br>
    combinations. I include a source tree walk through as part of <br>
    teaching the class. <br>
    <br>
    My walk through has two sections -- one that is BSP and target<br>
    hardware INDEPENDENT-- and another that is BSP and target<br>
    hardware DEPENDENT.<br>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">
        <div>Here are the docs that I know of:</div>
        <div>Starting point: <a title="http://www.rtems.org/onlinedocs.html" href="http://www.rtems.org/onlinedocs.html" target="_parent">http://www.rtems.org/onlinedocs.html</a><br>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    That's the main starting point and includes historical versions.<br>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">
        <div>
          Manuals for developing RTEMS applications:</div>
        <div><a title="http://rtems.org/onlinedocs/doc-current/share/rtems/html/" href="http://rtems.org/onlinedocs/doc-current/share/rtems/html/" target="_parent">http://rtems.org/onlinedocs/doc-current/share/rtems/html/</a><br>
        </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    That is built twice a day off the git head. <br>
    <br>
    In addition, the C library is newlib and the manual for the methods<br>
    in libc/libm are documented by that project.<br>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">
        <div>
          Doxygen for the cpukit ( but why is that directory called
          cpukit? )</div>
        <div><a title="http://www.rtems.org/onlinedocs/doxygen/cpukit/html/" href="http://www.rtems.org/onlinedocs/doxygen/cpukit/html/" target="_parent">http://www.rtems.org/onlinedocs/doxygen/cpukit/html/</a><br>
        </div>
        <div>
          <br>
        </div>
      </div>
    </blockquote>
    Well.. the other parts of the tree are thought of as  BSP Kit and
    tests.<br>
    But CVS didn't let us easily move things around. libcpu, libchip,
    and<br>
    libbsp are a "BSP Kit"<br>
    <br>
    Everything in cpukit is supposed to be applicable to all BSPs and<br>
    not be dependent on any particular cpu mdoel.<br>
    <br>
    Although it does include the Classic and POSIX APIs, the Doxygen is<br>
    probably best avoided unless you are curious about the internals of<br>
    RTEMS or modifying it. :)<br>
    the Doxygen is <br>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">
        <div>For the Raspberry Pi: I was hoping to start with
          the I2C driver shortly. It seems there are two options:</div>
        <div>1. A standalone I2C driver similar to the one in
          the arm/lpc32xx BSP:</div>
        <div>
          <a title="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc32xx/misc/i2c.c" href="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc32xx/misc/i2c.c" target="_parent">http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc32xx/misc/i2c.c</a><br>
        </div>
        <div><br>
        </div>
        <div>2. A driver for libi2c similar to the one in the
          arm/lpc24xx BSP:</div>
        <div><a title="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc24xx/i2c" href="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc24xx/i2c" target="_parent">http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc24xx/i2c</a><br>
        </div>
        <div><br>
        </div>
        <div>This readme file gives a pretty good overview of
          libi2c:</div>
        <div><a title="http://git.rtems.org/rtems/tree/cpukit/libi2c/README_libi2c" href="http://git.rtems.org/rtems/tree/cpukit/libi2c/README_libi2c" target="_parent">http://git.rtems.org/rtems/tree/cpukit/libi2c/README_libi2c</a><br>
        </div>
        <div><br>
        </div>
        <div>I was going to start with a simple i2c driver for
          the Rpi, then try to implement a libi2c driver when I had a
          little more experience with it.</div>
        <div><br>
        </div>
        <div>Same with the SPI/SD card access: I'm pretty sure
          I saw a good example of using the SPI bus to access a SD card
          , but I can't find it right now ( exactly your point! ) </div>
        <div>
          <br>
        </div>
        <div>Also, here is another GPIO driver for the
          Raspberry Pi. I was able to use this for reading button states
          and lighting multiple LEDs. </div>
        <div><a title="https://github.com/pficheux/raspberry_pi" href="https://github.com/pficheux/raspberry_pi" target="_parent">https://github.com/pficheux/raspberry_pi</a><br>
        </div>
        <div><br>
        </div>
        <div>But feel free to ask more questions: I would like
          to help with the I2c implementation. </div>
        <div><br>
        </div>
      </div>
    </blockquote>
    And this block of questions is a good example of why there is no
    single source<br>
    for all your RTEMS answers.  At some point, you need a board or chip
    manual. :)<br>
    <blockquote style="margin-top: 0px; margin-bottom: 0px;" cite="mid:CAJrjN71E_M81-7Z7LnH85TJD6ibzhgiLK1yMJ1musKSxZeD3BQ@mail.gmail.com">
      <div dir="ltr">
        <div>Alan</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>
          <br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Sep 9, 2013 at 5:20 AM, Simon
          Williams <span dir="ltr"><<a title="mailto:williamssimonp@gmail.com" href="mailto:williamssimonp@gmail.com" target="_parent">williamssimonp@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
            <div dir="ltr">
              <div>I have made some progress with the work I have been
                doing for the Raspberry Pi, but I am finding that
                progress is being held up due to lack of information
                about RTEMS.  Is there a repository of information I am
                not aware of?</div>
              <div><br>
              </div>
              <div>I have a GPIO driver which allows me to have an RTEMS
                task that switches an external LED on and off.  The is
                based on the description of the discrete driver in the
                BSP and Device Driver Development Guide, but that
                description is almost non-existent!  There also does not
                appear to be any sample implementation anywhere.  I have
                one specific issue with my implementation, which is that
                stat() does not return anything useful and so I have to
                use the deprecated RTEMS specific call to get
                information about the devices.  This leads me to believe
                that I have not got it quite right!  </div>
              <div><br>
              </div>
              <div>My next targets are I2C, followed by a driver to put
                the console on an <span style="color: rgb(68, 68, 68); line-height: 16px; font-family: arial,sans-serif;">HD44780
                  compatible display and keyboard attached to the I2C
                  bus.  After that, I will be looking at an SD card
                  filesystem and other I2C devices I need for my
                  application.  I would be extremely grateful if anyone
                  could point me towards some well documented examples
                  of these sort of drivers for other boards, I would be
                  grateful.  The problem with most of the examples I
                  have found in the repository is that any documentation
                  that they contain assumes that the reader has a good
                  knowledge of RTEMS and it's requirements and it is
                  that knowledge that I am trying to gain!</span></div>
              <div><span style="color: rgb(68, 68, 68); line-height: 16px; font-family: arial,sans-serif;"><br>
                </span></div>
              <div><span style="color: rgb(68, 68, 68); line-height: 16px; font-family: arial,sans-serif;">I
                  would also be interested to know if there is any
                  documentation I have not been able to find on using
                  the C++ class library as my application level code
                  will be written in C++.</span></div>
              <div><span style="color: rgb(68, 68, 68); line-height: 16px; font-family: arial,sans-serif;"><br>
                </span></div>
              <div><span style="color: rgb(68, 68, 68); line-height: 16px; font-family: arial,sans-serif;">Thanks
                  in advance for your help.</span></div>
              <div><br>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            rtems-users mailing list<br>
            <a title="mailto:rtems-users@rtems.org" href="mailto:rtems-users@rtems.org" target="_parent">rtems-users@rtems.org</a><br>
            <a title="http://www.rtems.org/mailman/listinfo/rtems-users" href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_parent">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature">-- 
Joel Sherrill, Ph.D.             Director of Research & Development 
<a title="mailto:joel.sherrill@OARcorp.com" class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com" target="_parent">joel.sherrill@OARcorp.com</a>        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805 
Support Available                (256) 722-9985 </pre>
  

</div></body></html>