Re: Information Needed

williamssimonp at gmail.com williamssimonp at gmail.com
Wed Sep 11 12:47:37 UTC 2013


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!


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.


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.


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!


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.


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!



Sent from Windows Mail



From: Joel Sherrill
Sent: ‎Monday‎, ‎9‎ ‎September‎ ‎2013 ‎16‎:‎08
To: Alan Cudmore
Cc: Simon Williams; rtems-users at rtems.org


On 9/9/2013 9:29 AM, Alan Cudmore wrote:



Simon, 
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. 



RTEMS is a very large collection of software for a lot of hardware
combinations. I include a source tree walk through as part of 
teaching the class. 

My walk through has two sections -- one that is BSP and target
hardware INDEPENDENT-- and another that is BSP and target
hardware DEPENDENT.



Here are the docs that I know of:

Starting point: http://www.rtems.org/onlinedocs.html




That's the main starting point and includes historical versions.



Manuals for developing RTEMS applications:

http://rtems.org/onlinedocs/doc-current/share/rtems/html/




That is built twice a day off the git head. 

In addition, the C library is newlib and the manual for the methods
in libc/libm are documented by that project.



Doxygen for the cpukit ( but why is that directory called cpukit? )

http://www.rtems.org/onlinedocs/doxygen/cpukit/html/




Well.. the other parts of the tree are thought of as  BSP Kit and tests.
But CVS didn't let us easily move things around. libcpu, libchip, and
libbsp are a "BSP Kit"

Everything in cpukit is supposed to be applicable to all BSPs and
not be dependent on any particular cpu mdoel.

Although it does include the Classic and POSIX APIs, the Doxygen is
probably best avoided unless you are curious about the internals of
RTEMS or modifying it. :)
the Doxygen is 



For the Raspberry Pi: I was hoping to start with the I2C driver shortly. It seems there are two options:

1. A standalone I2C driver similar to the one in the arm/lpc32xx BSP:

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc32xx/misc/i2c.c





2. A driver for libi2c similar to the one in the arm/lpc24xx BSP:

http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc24xx/i2c





This readme file gives a pretty good overview of libi2c:

http://git.rtems.org/rtems/tree/cpukit/libi2c/README_libi2c





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.




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! ) 




Also, here is another GPIO driver for the Raspberry Pi. I was able to use this for reading button states and lighting multiple LEDs. 

https://github.com/pficheux/raspberry_pi





But feel free to ask more questions: I would like to help with the I2c implementation. 



And this block of questions is a good example of why there is no single source
for all your RTEMS answers.  At some point, you need a board or chip manual. :)



Alan

























On Mon, Sep 9, 2013 at 5:20 AM, Simon Williams <williamssimonp at gmail.com> wrote:



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?




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!  




My next targets are I2C, followed by a driver to put the console on an 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!




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++.




Thanks in advance for your help.




_______________________________________________
rtems-users mailing list
rtems-users at rtems.org
http://www.rtems.org/mailman/listinfo/rtems-users




-- 
Joel Sherrill, Ph.D.             Director of Research & Development 
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805 
Support Available                (256) 722-9985
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130911/550a90e1/attachment.html>


More information about the users mailing list