https://elinux.org/api.php?action=feedcontributions&user=Gamaral&feedformat=atomeLinux.org - User contributions [en]2024-03-19T04:12:37ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=RPi_Low-level_peripherals&diff=276914RPi Low-level peripherals2013-08-04T09:16:12Z<p>Gamaral: Added C example using sysfs interface</p>
<hr />
<div>[[Category: RaspberryPi]]<br />
{{Template:RPi_Hardware}}<br />
<br />
<br />
==Introduction==<br />
In addition to the familiar USB, Ethernet and HDMI ports, the R-Pi offers lower-level interfaces intended to connect more directly with chips and subsystem modules. These GPIO (general purpose I/O) signals on the 2x13 header pins include SPI, I2C, serial UART, 3V3 and 5V power. These interfaces are not "plug and play" and require care to avoid miswiring. The pins use a 3V3 logic level and are not tolerant of 5V levels, such as you might find on a 5V powered Arduino. CSI (camera serial interface) can be used to connect the 5 MP camera available. Not yet software-enabled is the flex cable connectors with DSI (display serial interface) and a serial link inside the HDMI connector called CEC. (consumer electronics control)<br />
<br />
==General Purpose Input/Output (GPIO)==<br />
[[File:GPIOs.png|thumb|254px|right|The layout of the Raspberry Pi P1 pin-header seen from the top, containing pins useable for general purpose I/O. Colour coded to the table. Three pins changed between PCB Rev.1 and Rev.2 [https://sites.google.com/site/burngatehouse/home/drawings/GPIOs2.gif Source] ]]<br />
<br />
General Purpose Input/Output (a.k.a. GPIO) is a generic pin on a chip whose behavior (including whether it is an input or output pin) can be controlled (programmed) through software.<br />
<br />
The Raspberry Pi allows peripherals and expansion boards (such as the [[Rpi Gertboard]]) to access the CPU by exposing the inputs and outputs.<br />
<br />
For further general information about GPIOs, see: [http://en.wikipedia.org/wiki/GPIO the wikipedia article].<BR><br />
For further specific information about the Raspberry Pi's BCM2835 GPIOs, see: [[RPi_BCM2835_GPIOs|this wiki article]].<br />
<br />
The production Raspberry Pi board has a 26-pin 2.54&nbsp;mm (100&nbsp;mil)<ref>http://www.raspberrypi.org/forum/features-and-requests/easy-gpio-hardware-software/page-3/#p31907</ref> expansion header, marked as P1, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I²C, SPI, UART), as well as +3.3&nbsp;V, +5&nbsp;V and GND supply lines. Pin one is the pin in the first column and on the bottom row. <ref>http://www.raspberrypi.org/archives/384</ref><br />
<br />
[[File:RPi_P1_header.png]]<br />
<br />
'''GPIO voltage levels are 3.3&nbsp;V and are not 5&nbsp;V tolerant. There is no over-voltage protection on the board''' - the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.<br />
<br />
All the GPIO pins can be reconfigured to provide alternate functions, SPI, [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM], I²C and so. At reset only pins GPIO 14 & 15 are assigned to the alternate function UART, these two can be switched back to GPIO to provide a total of 17 GPIO pins<ref>http://www.raspberrypi.org/archives/384</ref>. Each of their functions and full details of how to access are detailed in the chipset datasheet <ref>http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf</ref>.<br />
<br />
Each GPIO can interrupt, high/low/rise/fall/change.<ref>http://www.raspberrypi.org/archives/384#comment-5217</ref><ref>http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf</ref> There is currently no support for GPIO interrupts in the official kernel, however a patch exists, requiring compilation of modified source tree.<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=7509</ref> The 'Raspbian "wheezy"' <ref>http://www.raspberrypi.org/downloads</ref> version that is currently recommended for starters already includes GPIO interrupts.<br />
<br />
GPIO input hysteresis (Schmitt trigger) can be on or off, output slew rate can be fast or limited, and source and sink current is configurable from 2&nbsp;mA up to 16&nbsp;mA. Note that chipset GPIO pins 0-27 are in the same block and these properties are set per block, not per pin. See [http://www.scribd.com/doc/101830961/GPIO-Pads-Control2 GPIO Datasheet Addendum - GPIO Pads Control]. Particular attention should be applied to the note regarding SSO (Simultaneous Switching Outputs): to avoid interference, driving currents should be kept as low as possible.<br />
<br />
The available [[RPi_BCM2835_GPIOs|alternative functions]] and their corresponding pins are detailed below. These numbers are in reference to the chipset documentation and may not match the numbers exposed in Linux. Only fully usable functions are detailed, for some alternative functions not all the necessary pins are available for the funtionality to be actually used.<br />
<br />
There is also some information on the [[RPi Tutorial Easy GPIO Hardware & Software|Tutorial on Easy GPIO Hardware & Software]].<br />
<br />
Kernel boot messages go to the UART at 115200&nbsp;bit/s - there are more details on the [[RPi_Serial_Connection|serial port]] page.<br />
<br />
'''R-Pi PCB Revision 2 UPDATE:''' According to Eben at [http://www.raspberrypi.org/archives/1929#comment-31646] the R-Pi Rev.2 board being rolled out starting in September 2012 adds 4 more GPIO on a new connector called P5, and changes some of the existing P1 GPIO pinouts. On Rev2, GPIO_GEN2 [BCM2835/GPIO27] is routed to P1 pin 13, and changes what was SCL0/SDA0 to SCL1/SDA1: SCL1 [BCM2835/GPIO3] is routed to P1 pin 5, SDA1 [BCM2835/GPIO2] is routed to P1 pin 3. Also the power and ground connections previously marked "Do Not Connect" on P1 will remain as connected, specifically: P1-04:+5V0, P1-09:GND, P1-14:GND, P1-17:+3V3, P1-20:GND, P1-25:GND. According to this comment [http://www.raspberrypi.org/archives/2081#comment-33577] (and confirmed in this post [http://www.raspberrypi.org/archives/2233]) the P1 pinout is not expected to change in future beyond the current Rev.2 layout. <br />
<br />
'''P1 Header Pinout, top row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev1''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P1-02 || bgcolor="red" colspan="2" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P1-04 || bgcolor="red" colspan="2" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P1-06 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
|-<br />
| P1-08 || bgcolor="lime" colspan="2" | GPIO 14 || Boot to Alt 0 -> || bgcolor="yellow" | UART0_TXD || ALT5 = UART1_TXD<br />
|-<br />
| P1-10 || bgcolor="lime" colspan="2" | GPIO 15 || Boot to Alt 0 -> || bgcolor="yellow" | UART0_RXD || ALT5 = UART1_RXD<br />
|-<br />
| P1-12 || bgcolor="lime" colspan="2" | GPIO 18 || || PCM_CLK || ALT4 = SPI1_CE0_N ALT5 = PWM0<br />
|-<br />
| P1-14 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-16 || bgcolor="lime" colspan="2" | GPIO23 || || || ALT3 = SD1_CMD ALT4 = ARM_RTCK<br />
|-<br />
| P1-18 || bgcolor="lime" colspan="2" | GPIO24 || || || ALT3 = SD1_DAT0 ALT4 = ARM_TDO<br />
|-<br />
| P1-20 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-22 || bgcolor="lime" colspan="2" | GPIO25 || || || ALT3 = SD1_DAT1 ALT4 = ARM_TCK<br />
|-<br />
| P1-24 || bgcolor="lime" colspan="2" | GPIO08 || || bgcolor="purple" | <span style="color:white">SPI0_CE0_N</span> ||<br />
|-<br />
| P1-26 || bgcolor="lime" colspan="2" | GPIO07 || || bgcolor="purple" | <span style="color:white">SPI0_CE1_N</span> || <br />
|}<br />
<br />
<br />
'''P1 Header Pinout, bottom row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev1''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P1-01 || bgcolor="orange" colspan="2" | 3.3&nbsp;V || 50&nbsp;mA max (01 & 17)<br />
|-<br />
| P1-03 || bgcolor="lime" | GPIO 0 || bgcolor="lime" | '''GPIO 2'''|| 1K8 pull up resistor || bgcolor="cyan" | I2C0_SDA / '''I2C1_SDA''' ||<br />
|-<br />
| P1-05 || bgcolor="lime" | GPIO 1 || bgcolor="lime" | '''GPIO 3'''|| 1K8 pull up resistor || bgcolor="cyan" | I2C0_SCL / '''I2C1_SCL''' ||<br />
|-<br />
| P1-07 || bgcolor="lime" colspan="2" | GPIO 4 || || GPCLK0 || ALT5 = ARM_TDI<br />
|-<br />
| P1-09 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|-<br />
| P1-11 || bgcolor="lime" colspan="2" | GPIO17 || || ||| ALT3 = UART0_RTS ALT4 = SPI1_CE1_N ALT5 = UART1_RTS<br />
|-<br />
| P1-13 || bgcolor="lime" | GPIO21 || bgcolor="lime" | '''GPIO27''' || || PCM_DOUT / '''reserved''' || ALT4 = SPI1_SCLK ALT5 = GPCLK1 / '''ALT3 = SD1_DAT3 ALT4 = ARM_TMS'''<br />
|-<br />
| P1-15 || bgcolor="lime" colspan="2" | GPIO22 || || || ALT3 = SD1_CLK ALT4 = ARM_TRST<br />
|-<br />
| P1-17 || bgcolor="orange" colspan="2" | 3.3&nbsp;V || 50&nbsp;mA max (01 & 17)<br />
|-<br />
| P1-19 || bgcolor="lime" colspan="2" | GPIO10 || || bgcolor="purple" | <span style="color:white">SPI0_MOSI</span> || <br />
|-<br />
| P1-21 || bgcolor="lime" colspan="2" | GPIO9 || || bgcolor="purple" | <span style="color:white">SPI0_MISO</span> ||<br />
|-<br />
| P1-23 || bgcolor="lime" colspan="2" | GPIO11 || || bgcolor="purple" | <span style="color:white">SPI0_SCLK</span> || <br />
|-<br />
| P1-25 || bgcolor="black" colspan="2" | <span style="color:white">GND</span> <br />
|}<br />
<br />
<br />
{| border="1"<br />
! Colour legend<br />
|-<br />
| bgcolor="red" | <span style="color:white">+5&nbsp;V</span><br />
|-<br />
| bgcolor="orange" | +3.3&nbsp;V<br />
|-<br />
| bgcolor="black" | <span style="color:white">Ground, 0V</span> <br />
|-<br />
| bgcolor="yellow" | UART<br />
|-<br />
| bgcolor="lime" | GPIO<br />
|-<br />
| bgcolor="purple" | <span style="color:white">SPI</span><br />
|-<br />
| bgcolor="cyan" | I²C<br />
|}<br />
<br />
KiCad symbol: [[File:Conn-raspberry.lib]]<br />
<br />
<ref>http://www.raspberrypi.org/forum/projects-and-collaboration-general/gpio-header-pinout-clarification/page-2</ref><br />
<br />
Pin 3 (SDA0) and Pin 5 (SCL0) are preset to be used as an I²C interface. So there are 1.8&nbsp;kilohm pulls up resistors on the board for these pins.<ref>http://www.raspberrypi.org/forum/features-and-requests/easy-gpio-hardware-software/page-6/#p56480</ref><br />
<br />
Pin 12 supports [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM] .<br />
<br />
It is also possible to reconfigure GPIO connector pins P1-7, 15, 16, 18, 22 (chipset GPIOs 4 and 22 to 25) to provide an ARM JTAG interface.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1288.1</ref> However ARM_TMS isn't available on the GPIO connector (chipset pin 12 or 27 is needed). Chipset pin 27 is available on S5, the CSI camera interface however.<br />
<br />
It is also possible to reconfigure GPIO connector pins P1-12 and 13 (chipset GPIO 18 and 21) to provide an I2S (a hardware modification may be required<ref name="I2S">[http://www.raspberrypi.org/forum/features-and-requests/sad-about-removal-of-i2s-why-was-this-change-made Forum:Sad about removal of I2S. Why was this change made?]</ref>) or PCM interface.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1288.2</ref> However, PCM_FS and PCM_DIN (chipset pins 19 and 20) are needed for I2S or PCM.<br />
<br />
A second I²C interface (GPIO02_ALT0 is SDA1 and GPIO03_ALT0 is SCL1) and two further GPIOs (GPIO05_ALT0 is GPCLK1, and GPIO27) are available on S5, the CSI camera interface.<br />
<br />
===Referring to pins on the Expansion header===<br />
<br />
The header is referred to as "The GPIO Connector (P1)". To avoid nomenclature confusion between Broadcom signal names on the SoC and pin names on the expansion header, the following naming is highly recommended.<br />
<br />
* The expansion header is referred to as "Expansion Header" or "GPIO Connector (P1)"<br />
* Pins on the GPIO connector (P1) are referred to as P1-01, etc.<br />
* Names GPIO0, GPIO1, GPIOx-ALTy, etc. refer to the signal names on the SoC as enumerated in the Broadcom datasheet, where "x" matches BCM2835 number (without leading zero) and "y" is the alternate number column 0 to 5 on page 102-103 of the Broadcom document. For example, depending on what you are describing, use either "GPIO7" to refer to a row of the table, and "GPIO7-ALT0" would refer to a specific cell of the table.<br />
* When refering to signal names, you should modify the Broadcom name slightly to minimize confusion. The Broadcom SPI bus pin names are fine, such as "SPI0_*" and "SPI1_*", but they didn't do the same on the I²C and UART pins. Instead of using "SDA0" and "SCL0", you should use "I2C0_SDA" and "I2C0_SCL"; and instead of "TX" or "TXD" and "RX" or "RXD", you should use "UART0_TXD" and "UART0_RXD".<br />
<br />
===Power pins===<br />
The maximum permitted current draw from the 3.3&nbsp;V pins is 50&nbsp;mA.<br />
<br />
Maximum permitted current draw from the 5&nbsp;V pin is the USB input current (usually 1&nbsp;A) minus any current draw from the rest of the board.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1536#postid-21841</ref><br />
*Model A: 1000&nbsp;mA - 500&nbsp;mA -> max current draw: 500&nbsp;mA<br />
*Model B: 1000&nbsp;mA - 700&nbsp;mA -> max current draw: 300&nbsp;mA<br />
Be very careful with the 5&nbsp;V pins P1-02 and P1-04, because if you short 5&nbsp;V to any other P1 pin you may permanently damage your RasPi. Before probing P1, it's a good idea to strip short pieces of insulation off a wire and push them over the 5&nbsp;V pins so you don't accidentally short them with a probe.<br />
<br />
=== GPIO hardware hacking ===<br />
<br />
The complete list of [[RPi_BCM2835_GPIOs|chipset GPIO pins]] which are available on the GPIO connector is: <blockquote>[[RPi_BCM2835_GPIOs#GPIO0|0]], [[RPi_BCM2835_GPIOs#GPIO1|1]], [[RPi_BCM2835_GPIOs#GPIO4|4]], [[RPi_BCM2835_GPIOs#GPIO7|7]], [[RPi_BCM2835_GPIOs#GPIO8|8]], [[RPi_BCM2835_GPIOs#GPIO9|9]], [[RPi_BCM2835_GPIOs#GPIO10|10]], [[RPi_BCM2835_GPIOs#GPIO11|11]], [[RPi_BCM2835_GPIOs#GPIO14|14]], [[RPi_BCM2835_GPIOs#GPIO15|15]], [[RPi_BCM2835_GPIOs#GPIO17|17]], [[RPi_BCM2835_GPIOs#GPIO18|18]], [[RPi_BCM2835_GPIOs#GPIO21|21]], [[RPi_BCM2835_GPIOs#GPIO22|22]], [[RPi_BCM2835_GPIOs#GPIO23|23]], [[RPi_BCM2835_GPIOs#GPIO24|24]], [[RPi_BCM2835_GPIOs#GPIO25|25]]</blockquote><br />
<br />
(on the Revision2.0 RaspberryPis, this list changes to: [[RPi_BCM2835_GPIOs#GPIO2|2]], [[RPi_BCM2835_GPIOs#GPIO3|3]], [[RPi_BCM2835_GPIOs#GPIO4|4]], [[RPi_BCM2835_GPIOs#GPIO7|7]], [[RPi_BCM2835_GPIOs#GPIO8|8]], [[RPi_BCM2835_GPIOs#GPIO9|9]], [[RPi_BCM2835_GPIOs#GPIO10|10]], [[RPi_BCM2835_GPIOs#GPIO11|11]], [[RPi_BCM2835_GPIOs#GPIO14|14]], [[RPi_BCM2835_GPIOs#GPIO15|15]], [[RPi_BCM2835_GPIOs#GPIO17|17]], [[RPi_BCM2835_GPIOs#GPIO18|18]], [[RPi_BCM2835_GPIOs#GPIO22|22]], [[RPi_BCM2835_GPIOs#GPIO23|23]], [[RPi_BCM2835_GPIOs#GPIO24|24]], [[RPi_BCM2835_GPIOs#GPIO25|25]], [[RPi_BCM2835_GPIOs#GPIO27|27]], with [[RPi_BCM2835_GPIOs#GPIO28|28]], [[RPi_BCM2835_GPIOs#GPIO29|29]], [[RPi_BCM2835_GPIOs#GPIO30|30]], [[RPi_BCM2835_GPIOs#GPIO31|31]] additionally available on the [[#P5_header|P5 header]])<br />
<br />
As noted above, P1-03 and P1-05 (SDA0 and SCL0 / SDA1 and SCL1) have 1.8&nbsp;kilohm pull-up resistors to 3.3&nbsp;V.<br />
<br />
If 17 GPIOs aren't sufficient for your project, there are a few other signals potentially available, with varying levels of software and hardware (soldering iron) hackery skills:<br />
<br />
GPIO02, 03, 05 and 27 are available on S5 (the CSI interface) when a camera peripheral is not connected to that socket, and are configured by default to provide the functions SDA1, SCL1, CAM_CLK and CAM_GPIO respectively. SDA1 and SCL1 have 1K6 pull-up resistors to 3.3&nbsp;V.<br />
<br />
GPIO06 is LAN_RUN and is available on pad 12 of the footprint for IC3 on the Model A. On Model B, it is in use for the Ethernet function.<br />
<br />
There are a few other chipset GPIO pins accessible on the PCB but are in use:<br />
<br />
* GPIO16 drives status LED D5 (usually SD card access indicator)<br />
* GPIO28-31 are used by the board ID and are connected to resistors R3 to R10 (only on Rev1.0 boards).<br />
* GPIO40 and 45 are used by analogue audio and support [http://en.wikipedia.org/wiki/Pulse-width_modulation PWM]. They connect to the analogue audio circuitry via R21 and R27 respectively.<br />
* GPIO46 is HDMI hotplug detect (goes to pin 6 of IC1).<br />
* GPIO47 to 53 are used by the SD card interface. In particular, GPIO47 is SD card detect (this would seem to be a good candidate for re-use). GPIO47 is connected to the SD card interface card detect switch; GPIO48 to 53 are connected to the SD card interface via resistors R45 to R50.<br />
<br />
=== P2 header ===<br />
<br />
The P2 header is the VideoCore JTAG and used only during the production of the board. It cannot be used as the ARM JTAG <ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=5894</ref>. This connector is unpopulated in Rev 2.0 boards. <br />
<br />
[[File:RPi_P2_header.png]]<br />
<br />
Useful P2 pins:<br />
<br />
* Pin 1 - 3.3V (same as P1-01, 50 mA max current draw across both of them)<br />
* Pin 7 - GND<br />
* Pin 8 - GND<br />
<br />
=== P3 header ===<br />
<br />
The P3 header, unpopulated, is the LAN9512 JTAG <ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=5894</ref>.<br />
<br />
[[File:RPi_P3_header.png]]<br />
<br />
Useful P3 pins:<br />
<br />
* Pin 7 - GND<br />
<br />
=== P5 header ===<br />
<br />
The P5 header was added with the release of the Revision 2.0 PCB design.<br />
<br />
[[File:RPi_P5_header.png]]<br />
<br />
'''P5 Header Pinout (seen from the back of the board), top row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P5-01 || bgcolor="red" | <span style="color:white">5V0</span> || Supply through input poly fuse<br />
|-<br />
| P5-03 || bgcolor="lime" | GPIO28 || || bgcolor="cyan" | I2C0_SDA || ALT2 = PCM_CLK<br />
|-<br />
| P5-05 || bgcolor="lime" | GPIO30 || || || ALT2 = PCM_DIN ALT3 = UART0_CTS ALT5 = UART1_CTS<br />
|-<br />
| P5-07 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
'''P5 Header Pinout (seen from the back of the board), bottom row:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes''' || '''Alt 0 Function''' || '''Other Alternative Functions'''<br />
|-<br />
| P5-02 || bgcolor="orange" | 3.3&nbsp;V || 50&nbsp;mA max (combined with P1)<br />
|-<br />
| P5-04 || bgcolor="lime" | GPIO29 || || bgcolor="cyan" | I2C0_SCL || ALT2 = PCM_FS<br />
|-<br />
| P5-06 || bgcolor="lime" | GPIO31 || || || ALT2 = PCM_DOUT ALT3 = UART0_RTS ALT5 = UART1_RTS<br />
|-<br />
| P5-08 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
[[File:Male-slanted2small.jpg|150px|thumb|left|Slanted P5 header]]<br />
<br />
Note that the connector is intended to be mounted on the '''bottom''' of the PCB, so that for those who put the connector on the top side, the pin numbers are swapped. Pin 1 and pin 2 are swapped, pin 3 and 4, etc. <br />
<br />
Some people have come to the conclusion that the best way (for them) to attach this header is on top, [http://raspi.tv/2013/the-leaning-header-of-pi5a-how-best-to-solder-a-header-on-p5 at a slant away from the P1 header.]<br />
<br />
The new header can provide a second I2C channel (SDA + SCL) and handshake lines for the existing UART (TxD and RxD), or it can be used for an I2S (audio codec chip) interface using the PCM signals CLK, FS (Frame Sync), Din and Dout.<br />
<br />
Note that the connector is placed JUST off-grid with respect to the P1 connector.<br />
<br />
=== P6 header ===<br />
<br />
The P6 header was added with the release of the Revision 2.0 PCB design.<br />
<br />
[[File:RPi_P6_header.png]]<br />
<br />
'''P6 Pinout:'''<br />
{| border="1" style="text-align:center;"<br />
| '''Pin Number''' || '''Pin Name Rev2''' || '''Hardware Notes'''<br />
|-<br />
| P6-01 || RUN || Short to ground to reset the BCM2835<br />
|-<br />
| P6-02 || bgcolor="black" | <span style="color:white">GND</span><br />
|}<br />
<br />
[http://raspi.tv/2012/making-a-reset-switch-for-your-rev-2-raspberry-pi A reset button can be attached to the P6 header], with which the Pi can be reset.<br />
Momentarily shorting the two pins of P6 together will cause a soft reset of the CPU (which can also 'wake' the Pi from halt/shutdown state).<br />
<br />
===Driver support===<br />
<br />
The Foundation will not include a GPIO driver in the initial release, standard Linux GPIO drivers should work with minimal modification.<ref>http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=1278.0</ref><br />
<br />
The community implemented SPI and I²C drivers <ref>http://www.bootc.net/projects/raspberry-pi-kernel/</ref>, which will be integrated with the new Linux pinctrl concept in a later version of the kernel. (On Oct. 14 2012, it was already included in the latest raspbian image.) A first compiled version as Linux modules is available to install on the 19/04/2012 Debian image, including 1-wire support<ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?p=86172#p86172</ref>. The I²C and SPI driver uses the hardware modules of the microcontroller and interrupts for low CPU usage, the 1-wire support uses bitbanging on the GPIO ports, which results in higher CPU usage.<br />
<br />
GordonH<ref>http://www.raspberrypi.org/forum/general-discussion/wiring-for-the-raspberry-pis-gpio</ref> wrote a (mostly) Arduino compatible/style [https://projects.drogon.net/raspberry-pi/wiringpi/ WiringPi library] in C for controlling the GPIO pins.<br />
<br />
A useful tutorial on setting up I²C driver support can be found at [http://www.robot-electronics.co.uk/htm/raspberry_pi_examples.htm Robot Electronics] - look for the downloadable document rpi_i2c_setup.doc<br />
<br />
===Graphical User Interfaces===<br />
====WebIOPi====<br />
[http://code.google.com/p/webiopi/ WebIOPi] allows you to control each GPIO with a simple web interface that you can use with any browser. Available in PHP and Python, they both require root access, but Python version serves HTTP itself. You can setup each GPIO as input or output and change their states (LOW/HIGH). WebIOPi is fully customizable, so you can use it for home remote control. It also work over Internet. UART/SPI/I2C support will be added later. If you need some computing for your GPIO go to code examples below.<br />
<br />
==GPIO Code examples==<br />
=== C ===<br />
Examples in different C-Languages.<br />
==== C ====<br />
[http://www.raspberrypi.org/forum/educational-applications/gertboard/page-4/#p31555 Gert van Loo & Dom, has provided] some tested code which accesses the GPIO pins through direct GPIO register manipulation in C-code.<br />
(Thanks to Dom for doing the difficult work of finding and testing the mapping.)<br />
Example GPIO code:<br />
<br />
<pre><br />
//<br />
// How to access GPIO registers from C-code on the Raspberry-Pi<br />
// Example program<br />
// 15-January-2012<br />
// Dom and Gert<br />
// Revised: 15-Feb-2013<br />
<br />
<br />
// Access from ARM Running Linux<br />
<br />
#define BCM2708_PERI_BASE 0x20000000<br />
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO controller */<br />
<br />
<br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include <fcntl.h><br />
#include <sys/mman.h><br />
#include <unistd.h><br />
<br />
#define PAGE_SIZE (4*1024)<br />
#define BLOCK_SIZE (4*1024)<br />
<br />
int mem_fd;<br />
void *gpio_map;<br />
<br />
// I/O access<br />
volatile unsigned *gpio;<br />
<br />
<br />
// GPIO setup macros. Always use INP_GPIO(x) before using OUT_GPIO(x) or SET_GPIO_ALT(x,y)<br />
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))<br />
#define OUT_GPIO(g) *(gpio+((g)/10)) |= (1<<(((g)%10)*3))<br />
#define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))<br />
<br />
#define GPIO_SET *(gpio+7) // sets bits which are 1 ignores bits which are 0<br />
#define GPIO_CLR *(gpio+10) // clears bits which are 1 ignores bits which are 0<br />
<br />
void setup_io();<br />
<br />
int main(int argc, char **argv)<br />
{<br />
int g,rep;<br />
<br />
// Set up gpi pointer for direct register access<br />
setup_io();<br />
<br />
// Switch GPIO 7..11 to output mode<br />
<br />
/************************************************************************\<br />
* You are about to change the GPIO settings of your computer. *<br />
* Mess this up and it will stop working! *<br />
* It might be a good idea to 'sync' before running this program *<br />
* so at least you still have your code changes written to the SD-card! *<br />
\************************************************************************/<br />
<br />
// Set GPIO pins 7-11 to output<br />
for (g=7; g<=11; g++)<br />
{<br />
INP_GPIO(g); // must use INP_GPIO before we can use OUT_GPIO<br />
OUT_GPIO(g);<br />
}<br />
<br />
for (rep=0; rep<10; rep++)<br />
{<br />
for (g=7; g<=11; g++)<br />
{<br />
GPIO_SET = 1<<g;<br />
sleep(1);<br />
}<br />
for (g=7; g<=11; g++)<br />
{<br />
GPIO_CLR = 1<<g;<br />
sleep(1);<br />
}<br />
}<br />
<br />
return 0;<br />
<br />
} // main<br />
<br />
<br />
//<br />
// Set up a memory regions to access GPIO<br />
//<br />
void setup_io()<br />
{<br />
/* open /dev/mem */<br />
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {<br />
printf("can't open /dev/mem \n");<br />
exit(-1);<br />
}<br />
<br />
/* mmap GPIO */<br />
gpio_map = mmap(<br />
NULL, //Any adddress in our space will do<br />
BLOCK_SIZE, //Map length<br />
PROT_READ|PROT_WRITE,// Enable reading & writting to mapped memory<br />
MAP_SHARED, //Shared with other processes<br />
mem_fd, //File to map<br />
GPIO_BASE //Offset to GPIO peripheral<br />
);<br />
<br />
close(mem_fd); //No need to keep mem_fd open after mmap<br />
<br />
if (gpio_map == MAP_FAILED) {<br />
printf("mmap error %d\n", (int)gpio_map);//errno also set!<br />
exit(-1);<br />
}<br />
<br />
// Always use volatile pointer!<br />
gpio = (volatile unsigned *)gpio_map;<br />
<br />
<br />
} // setup_io<br />
<br />
</pre><br />
<br />
===== GPIO Pull Up/Pull Down Register Example =====<br />
<pre><br />
// enable pull-up on GPIO24&25<br />
GPIO_PULL = 2;<br />
short_wait();<br />
// clock on GPIO 24 & 25 (bit 24 & 25 set)<br />
GPIO_PULLCLK0 = 0x03000000;<br />
short_wait();<br />
GPIO_PULL = 0;<br />
GPIO_PULLCLK0 = 0;<br />
</pre><br />
<br />
==== C + wiringPi ====<br />
Get and install wiringPi: https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/<br />
<br />
Save this, and compile with:<br />
<pre><br />
gcc -o blink blink.c -lwiringPi<br />
</pre><br />
and run with:<br />
<pre><br />
sudo ./blink<br />
</pre><br />
<br />
<pre><br />
/*<br />
* blink.c:<br />
* blinks the first LED<br />
* Gordon Henderson, projects@drogon.net<br />
*/<br />
<br />
#include <stdio.h><br />
#include <wiringPi.h><br />
<br />
int main (void)<br />
{<br />
printf ("Raspberry Pi blink\n") ;<br />
<br />
if (wiringPiSetup () == -1)<br />
return 1 ;<br />
<br />
pinMode (0, OUTPUT) ; // aka BCM_GPIO pin 17<br />
<br />
for (;;)<br />
{<br />
digitalWrite (0, 1) ; // On<br />
delay (500) ; // mS<br />
digitalWrite (0, 0) ; // Off<br />
delay (500) ;<br />
}<br />
return 0 ;<br />
}<br />
</pre><br />
<br />
==== C + sysfs ====<br />
<br />
The following example requires no special libraries, it uses the available sysfs interface.<br />
<br />
<pre><br />
/* blink.c<br />
*<br />
* Raspberry Pi GPIO example using sysfs interface.<br />
* Guillermo A. Amaral B. <g@maral.me><br />
*<br />
* This file blinks GPIO 4 (P1-07) while reading GPIO 24 (P1_18).<br />
*/<br />
<br />
#include <sys/stat.h><br />
#include <sys/types.h><br />
#include <fcntl.h><br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include <unistd.h><br />
<br />
#define IN 0<br />
#define OUT 1<br />
<br />
#define LOW 0<br />
#define HIGH 1<br />
<br />
#define PIN 24 /* P1-18 */<br />
#define POUT 4 /* P1-07 */<br />
<br />
static int<br />
GPIOExport(int pin)<br />
{<br />
#define BUFFER_MAX 3<br />
char buffer[BUFFER_MAX];<br />
ssize_t bytes_written;<br />
int fd;<br />
<br />
fd = open("/sys/class/gpio/export", O_WRONLY);<br />
if (-1 == fd) {<br />
fprintf(stderr, "Failed to open export for writing!\n");<br />
return(-1);<br />
}<br />
<br />
bytes_written = snprintf(buffer, BUFFER_MAX, "%d", pin);<br />
write(fd, buffer, bytes_written);<br />
close(fd);<br />
return(0);<br />
}<br />
<br />
static int<br />
GPIOUnexport(int pin)<br />
{<br />
char buffer[BUFFER_MAX];<br />
ssize_t bytes_written;<br />
int fd;<br />
<br />
fd = open("/sys/class/gpio/unexport", O_WRONLY);<br />
if (-1 == fd) {<br />
fprintf(stderr, "Failed to open unexport for writing!\n");<br />
return(-1);<br />
}<br />
<br />
bytes_written = snprintf(buffer, BUFFER_MAX, "%d", pin);<br />
write(fd, buffer, bytes_written);<br />
close(fd);<br />
return(0);<br />
}<br />
<br />
static int<br />
GPIODirection(int pin, int dir)<br />
{<br />
static const char s_directions_str[] = "in\0out";<br />
<br />
#define DIRECTION_MAX 35<br />
char path[DIRECTION_MAX];<br />
int fd;<br />
<br />
snprintf(path, DIRECTION_MAX, "/sys/class/gpio/gpio%d/direction", pin);<br />
fd = open(path, O_WRONLY);<br />
if (-1 == fd) {<br />
fprintf(stderr, "Failed to open gpio direction for writing!\n");<br />
return(-1);<br />
}<br />
<br />
if (-1 == write(fd, &s_directions_str[IN == dir ? 0 : 3], IN == dir ? 2 : 3)) {<br />
fprintf(stderr, "Failed to set direction!\n");<br />
return(-1);<br />
}<br />
<br />
close(fd);<br />
return(0);<br />
}<br />
<br />
static int<br />
GPIORead(int pin)<br />
{<br />
#define VALUE_MAX 30<br />
char path[VALUE_MAX];<br />
char value_str[3];<br />
int fd;<br />
<br />
snprintf(path, VALUE_MAX, "/sys/class/gpio/gpio%d/value", pin);<br />
fd = open(path, O_RDONLY);<br />
if (-1 == fd) {<br />
fprintf(stderr, "Failed to open gpio value for reading!\n");<br />
return(-1);<br />
}<br />
<br />
if (-1 == read(fd, value_str, 3)) {<br />
fprintf(stderr, "Failed to read value!\n");<br />
return(-1);<br />
}<br />
<br />
close(fd);<br />
<br />
return(atoi(value_str));<br />
}<br />
<br />
static int<br />
GPIOWrite(int pin, int value)<br />
{<br />
static const char s_values_str[] = "01";<br />
<br />
char path[VALUE_MAX];<br />
int fd;<br />
<br />
snprintf(path, VALUE_MAX, "/sys/class/gpio/gpio%d/value", pin);<br />
fd = open(path, O_WRONLY);<br />
if (-1 == fd) {<br />
fprintf(stderr, "Failed to open gpio value for writing!\n");<br />
return(-1);<br />
}<br />
<br />
if (1 != write(fd, &s_values_str[LOW == value ? 0 : 1], 1)) {<br />
fprintf(stderr, "Failed to write value!\n");<br />
return(-1);<br />
}<br />
<br />
close(fd);<br />
return(0);<br />
}<br />
<br />
int<br />
main(int argc, char *argv[])<br />
{<br />
int repeat = 10;<br />
<br />
/*<br />
* Enable GPIO pins<br />
*/<br />
if (-1 == GPIOExport(POUT) || -1 == GPIOExport(PIN))<br />
return(1);<br />
<br />
/*<br />
* Set GPIO directions<br />
*/<br />
if (-1 == GPIODirection(POUT, OUT) || -1 == GPIODirection(PIN, IN))<br />
return(2);<br />
<br />
do {<br />
/*<br />
* Write GPIO value<br />
*/<br />
if (-1 == GPIOWrite(POUT, repeat % 2))<br />
return(3);<br />
<br />
/*<br />
* Read GPIO value<br />
*/<br />
printf("I'm reading %d in GPIO %d\n", GPIORead(PIN), PIN);<br />
<br />
usleep(500 * 1000);<br />
}<br />
while (repeat--);<br />
<br />
/*<br />
* Disable GPIO pins<br />
*/<br />
if (-1 == GPIOUnexport(POUT) || -1 == GPIOUnexport(PIN))<br />
return(4);<br />
<br />
return(0);<br />
}<br />
</pre><br />
<br />
==== C ====<br />
This must be done as root. To change to the root user:<br />
<pre>sudo -i</pre><br />
You must also get and install the bcm2835 library, which supports<br />
GPIO and SPI interfaces. Details and downloads <br />
from http://www.open.com.au/mikem/bcm2835<br />
<br />
<pre><br />
<br />
// blink.c<br />
//<br />
// Example program for bcm2835 library<br />
// Blinks a pin on an off every 0.5 secs<br />
//<br />
// After installing bcm2835, you can build this <br />
// with something like:<br />
// gcc -o blink -l rt blink.c -l bcm2835<br />
// sudo ./blink<br />
//<br />
// Or you can test it before installing with:<br />
// gcc -o blink -l rt -I ../../src ../../src/bcm2835.c blink.c<br />
// sudo ./blink<br />
//<br />
// Author: Mike McCauley (mikem@open.com.au)<br />
// Copyright (C) 2011 Mike McCauley<br />
// $Id: RF22.h,v 1.21 2012/05/30 01:51:25 mikem Exp $<br />
<br />
#include <bcm2835.h><br />
<br />
// Blinks on RPi pin GPIO 11<br />
#define PIN RPI_GPIO_P1_11<br />
<br />
int main(int argc, char **argv)<br />
{<br />
// If you call this, it will not actually access the GPIO<br />
// Use for testing<br />
// bcm2835_set_debug(1);<br />
<br />
if (!bcm2835_init())<br />
return 1;<br />
<br />
// Set the pin to be an output<br />
bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP);<br />
<br />
// Blink<br />
while (1)<br />
{<br />
// Turn it on<br />
bcm2835_gpio_write(PIN, HIGH);<br />
<br />
// wait a bit<br />
delay(500);<br />
<br />
// turn it off<br />
bcm2835_gpio_write(PIN, LOW);<br />
<br />
// wait a bit<br />
delay(500);<br />
}<br />
<br />
return 0;<br />
}<br />
</pre><br />
<br />
==== C# ====<br />
RaspberryPiDotNet library is available at https://github.com/cypherkey/RaspberryPi.Net/.<br />
The library includes a GPIOFile and GPIOMem class. The GPIOMem requires compiling Mike McCauley's bcm2835 library above in to a shared object.<br />
<br />
<pre><br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using RaspberryPiDotNet;<br />
using System.Threading;<br />
<br />
namespace RaspPi<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
// Access the GPIO pin using a static method<br />
GPIOFile.Write(GPIO.GPIOPins.GPIO00, true);<br />
<br />
// Create a new GPIO object<br />
GPIOMem gpio = new GPIOMem(GPIO.GPIOPins.GPIO01);<br />
gpio.Write(false);<br />
}<br />
}<br />
}<br />
</pre><br />
<br />
<br />
=== Ruby ===<br />
<br />
This example uses the WiringPi Ruby Gem: http://pi.gadgetoid.co.uk/post/015-wiringpi-now-with-serial which you can install on your Pi with "gem install wiringpi"<br />
<br />
<pre><br />
MY_PIN = 1<br />
<br />
require 'wiringpi'<br />
io = WiringPi::GPIO.new<br />
io.mode(MY_PIN,OUTPUT)<br />
io.write(MY_PIN,HIGH)<br />
io.read(MY_PIN)<br />
</pre><br />
<br />
Alternatively the Pi Piper Gem (https://github.com/jwhitehorn/pi_piper) allows for event driven programming:<br />
<br />
<pre><br />
require 'pi_piper'<br />
include PiPiper<br />
<br />
watch :pin => 23 do<br />
puts "Pin changed from #{last_value} to #{value}"<br />
end<br />
<br />
PiPiper.wait<br />
</pre><br />
<br />
<br />
=== Perl ===<br />
This must be done as root. To change to the root user:<br />
<pre>sudo su -</pre><br />
Supports GPIO and SPI interfaces.<br />
You must also get and install the bcm2835 library. Details and downloads <br />
from http://www.open.com.au/mikem/bcm2835<br />
You must then get and install the Device::BCM2835 perl library from CPAN <br />
http://search.cpan.org/~mikem/Device-BCM2835-1.0/lib/Device/BCM2835.pm<br />
<pre><br />
use Device::BCM2835;<br />
use strict;<br />
<br />
# call set_debug(1) to do a non-destructive test on non-RPi hardware<br />
#Device::BCM2835::set_debug(1);<br />
Device::BCM2835::init() <br />
|| die "Could not init library";<br />
<br />
# Blink pin 11:<br />
# Set RPi pin 11 to be an output<br />
Device::BCM2835::gpio_fsel(&Device::BCM2835::RPI_GPIO_P1_11, <br />
&Device::BCM2835::BCM2835_GPIO_FSEL_OUTP);<br />
<br />
while (1)<br />
{<br />
# Turn it on<br />
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 1);<br />
Device::BCM2835::delay(500); # Milliseconds<br />
# Turn it off<br />
Device::BCM2835::gpio_write(&Device::BCM2835::RPI_GPIO_P1_11, 0);<br />
Device::BCM2835::delay(500); # Milliseconds<br />
}<br />
<br />
<br />
</pre><br />
<br />
=== Python ===<br />
The RPi.GPIO module is installed by default in Raspbian. <br />
Any Python script that controls GPIO must be run as root.<br />
<pre>import RPi.GPIO as GPIO<br />
<br />
# use P1 header pin numbering convention<br />
GPIO.setmode(GPIO.BOARD)<br />
<br />
# Set up the GPIO channels - one input and one output<br />
GPIO.setup(11, GPIO.IN)<br />
GPIO.setup(12, GPIO.OUT)<br />
<br />
# Input from pin 11<br />
input_value = GPIO.input(11)<br />
<br />
# Output to pin 12<br />
GPIO.output(12, GPIO.HIGH)<br />
<br />
# The same script as above but using BCM GPIO 00..nn numbers<br />
GPIO.setmode(GPIO.BCM)<br />
GPIO.setup(17, GPIO.IN)<br />
GPIO.setup(18, GPIO.OUT)<br />
input_value = GPIO.input(17)<br />
GPIO.output(18, GPIO.HIGH)</pre><br />
<br />
More documentation is available at http://code.google.com/p/raspberry-gpio-python/wiki/Main<br />
<br />
Also available is RPIO at https://pypi.python.org/pypi/RPIO<br />
RPIO extends RPi.GPIO with TCP socket interrupts, command line tools and more.<br />
<br />
=== Scratch===<br />
==== Scratch using the ScratchGPIO ====<br />
[[File:Blink11.gif|left]]Scratch can be used to control the GPIO pins using a background Python handler available from <br />
http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/<br />
<br />
<br style="clear: both" /><br />
<br />
=== Java ===<br />
==== Java using the Pi4J Library ====<br />
This uses the Java library available at http://www.pi4j.com/. <br />
(Any Java application that controls GPIO must be run as root.)<br />
<br />
Please note that the Pi4J library uses the WiringPi GPIO pin numbering scheme <ref>http://pi4j.com/usage.html#Pin_Numbering</ref> <ref>https://projects.drogon.net/raspberry-pi/wiringpi/pins/</ref>. Please see the usage documentation for more details: http://pi4j.com/usage.html <br />
<br />
<pre><br />
<br />
public static void main(String[] args) {<br />
<br />
// create gpio controller<br />
GpioController gpio = GpioFactory.getInstance();<br />
<br />
// provision gpio pin #01 as an output pin and turn off<br />
GpioPinDigitalOutput outputPin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "MyLED", PinState.LOW);<br />
<br />
// turn output to LOW/OFF state<br />
outputPin.low();<br />
<br />
// turn output to HIGH/ON state<br />
outputPin.high();<br />
<br />
<br />
// provision gpio pin #02 as an input pin with its internal pull down resistor enabled<br />
GpioPinDigitalInput inputPin = gpio.provisionDigitalInputPin(RaspiPin.GPIO_02, "MyButton", PinPullResistance.PULL_DOWN);<br />
<br />
// get input state from pin 2<br />
boolean input_value = inputPin.isHigh();<br />
}<br />
</pre><br />
<br />
More complete and detailed examples are included on the Pi4J website at http://www.pi4j.com/. <br />
<br />
The Pi4J library includes support for:<br />
* GPIO Control<br />
* GPIO Listeners<br />
* Serial Communication<br />
* I2C Communication<br />
* SPI Communication<br />
<br />
==== Java ====<br />
This uses the Java library available at https://github.com/jkransen/framboos. It does not depend on (or use) the wiringPi driver, but uses the same numbering scheme. Instead it uses the default driver under /sys/class/gpio that ships with the distro, so it works out of the box. Any Java application that controls GPIO must be run as root.<br />
<pre><br />
public static void main(String[] args) {<br />
// reading from an in pin<br />
InPin button = new InPin(8);<br />
boolean isButtonPressed = button.getValue();<br />
button.close();<br />
<br />
// writing to an out pin<br />
OutPin led = new Outpin(0);<br />
led.setValue(true);<br />
led.setValue(false);<br />
led.close();<br />
}<br />
</pre><br />
<br />
==== Java Webapp GPIO web control via http ====<br />
This uses the Java Webapp available at https://bitbucket.org/sbub/raspberry-pi-gpio-web-control/overview. You can control your GPIO over the internet. Any Java application that controls GPIO must be run as root.<br />
<pre><br />
<br />
host:~ sb$ curl 'http://raspberrypi:8080/handle?g0=1&g1=0'<br />
{"g1":0,"g0":1}<br />
<br />
</pre><br />
<br />
=== Bash shell script, using sysfs, part of the raspbian operating system ===<br />
The export and unexport of pins must be done as root. <br />
To change to the root user see below: To change back, the word exit must be entered.<br />
<pre>sudo -i</pre><br />
Export creates a new folder for the exported pin, and creates files for each of its control functions (i.e. active_low, direction, edge, power, subsystem, uevent, and value). Upon creation, the control files can be read by all users (not just root), but can only be written to by user root, the file's owner. Nevertheless, once created, it is possible to allow users other than root, to also write inputs to the control files, by changing the ownership or permissions of these files. Changes to the file's ownership or permissions must initially be done as root, as their owner and group is set to root upon creation. Typically you might change the owner to be the (non root) user controlling the GPIO, or you might add write permission, and change the group ownership to one of which the user controlling the GPIO is a member. By such means, using only packages provided in the recommended rasbian distribution, it is possible for Python CGI scripts, which are typically run as user nobody, to be used for control of the GPIO over the internet from a browser at a remote location.<br />
<pre><br />
#!/bin/sh<br />
<br />
# GPIO numbers should be from this list<br />
# 0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25<br />
<br />
# Note that the GPIO numbers that you program here refer to the pins<br />
# of the BCM2835 and *not* the numbers on the pin header. <br />
# So, if you want to activate GPIO7 on the header you should be <br />
# using GPIO4 in this script. Likewise if you want to activate GPIO0<br />
# on the header you should be using GPIO17 here.<br />
<br />
# Set up GPIO 4 and set to output<br />
echo "4" > /sys/class/gpio/export<br />
echo "out" > /sys/class/gpio/gpio4/direction<br />
<br />
# Set up GPIO 7 and set to input<br />
echo "7" > /sys/class/gpio/export<br />
echo "in" > /sys/class/gpio/gpio7/direction<br />
<br />
# Write output<br />
echo "1" > /sys/class/gpio/gpio4/value<br />
<br />
# Read from input<br />
cat /sys/class/gpio/gpio7/value <br />
<br />
# Clean up<br />
echo "4" > /sys/class/gpio/unexport<br />
echo "7" > /sys/class/gpio/unexport<br />
</pre><br />
<br />
=== Shell script - take 2 ===<br />
You need the wiringPi library from<br />
https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/. Once installed, there is a new command '''gpio''' which can be used<br />
as a '''non-root''' user to control the GPIO pins.<br />
<br />
The man page <pre>man gpio</pre> has full details, but briefly:<br />
<br />
<pre><br />
gpio -g mode 17 out<br />
gpio -g mode 18 pwm<br />
<br />
gpio -g write 17 1<br />
gpio -g pwm 18 512<br />
</pre><br />
<br />
The '''-g''' flag tells the '''gpio''' program to use the BCM GPIO pin numbering<br />
scheme (otherwise it will use the wiringPi numbering scheme by default).<br />
<br />
The gpio command can also control the internal pull-up and pull-down<br />
resistors:<br />
<br />
<pre><br />
gpio -g mode 17 up<br />
</pre><br />
<br />
This sets the pull-up resistor - however any change of mode, even<br />
setting a pin that's already set as an input to an input will remove<br />
the pull-up/pull-down resistors, so they may need to be reset.<br />
<br />
Additionally, it can export/un-export the GPIO devices for use by<br />
other non-root programms - e.g. Python scripts. (Although you<br />
may need to drop the calls to GPIO.Setup() in the Python scripts, and<br />
do the setup separately in a little shell script, or call the '''gpio''' program<br />
from inside Python).<br />
<br />
<pre><br />
gpio export 17 out<br />
gpio export 18 in<br />
</pre><br />
<br />
These exports GPIO-17 and sets it to output, and exports GPIO-18<br />
and sets it to input. <br />
<br />
And when done:<br />
<br />
<pre><br />
gpio unexport 17<br />
</pre><br />
<br />
The export/unexport commands always use the BCM GPIO pin numbers regardless of the<br />
presence of the '''-g''' flag or not.<br />
<br />
If you want to use the internal pull-up/down's with the /sys/class/gpio mechanisms,<br />
then you can set them after exporting them. So:<br />
<br />
<pre><br />
gpio -g export 4 in<br />
gpio -g mode 4 up<br />
</pre><br />
<br />
You can then use GPIO-4 as an input in your Python, Shell, Java, etc. programs without the use<br />
of an external resistor to pull the pin high. (If that's what you were after - for example, a simple push<br />
button switch taking the pin to ground.)<br />
<br />
A fully working example of a shell script using the GPIO pins<br />
can be found at http://project-downloads.drogon.net/files/gpioExamples/tuxx.sh.<br />
<br />
<br />
=== Lazarus / Free Pascal ===<br />
[[File:RPI GPIO testprogram with lazarus.png|thumb|254px|right|A simple app for controlling GPIO pin 17 with Lazarus]]<br />
<br />
The GPIO pins are accessible from [[Lazarus on RPi|Lazarus]] without any third-party software. This is performed by means of the [http://www.freepascal.org/docs-html/rtl/baseunix/index.html BaseUnix] unit that is part of every distribution of Lazarus and Free Pascal or by invoking Unix shell commands with '''fpsystem'''. The following example uses GPIO pin 17 as output port. It is assumed that you created a form with a TToggleBox named GPIO17ToggleBox and for logging purposes a TMemo with name LogMemo (optional). The program has to be executed with root privileges.<br />
<br />
''Unit for controlling the GPIO port:''<br />
<pre><br />
unit Unit1;<br />
<br />
{Demo application for GPIO on Raspberry Pi}<br />
{Inspired by the Python input/output demo application by Gareth Halfacree}<br />
{written for the Raspberry Pi User Guide, ISBN 978-1-118-46446-5}<br />
<br />
{$mode objfpc}{$H+}<br />
<br />
interface<br />
<br />
uses<br />
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,<br />
Unix, BaseUnix;<br />
<br />
type<br />
<br />
{ TForm1 }<br />
<br />
TForm1 = class(TForm)<br />
LogMemo: TMemo;<br />
GPIO17ToggleBox: TToggleBox;<br />
procedure FormActivate(Sender: TObject);<br />
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);<br />
procedure GPIO17ToggleBoxChange(Sender: TObject);<br />
private<br />
{ private declarations }<br />
public<br />
{ public declarations }<br />
end;<br />
<br />
const<br />
PIN_17: PChar = '17';<br />
PIN_ON: PChar = '1';<br />
PIN_OFF: PChar = '0';<br />
OUT_DIRECTION: PChar = 'out';<br />
<br />
var<br />
Form1: TForm1;<br />
gReturnCode: longint; {stores the result of the IO operation}<br />
<br />
implementation<br />
<br />
{$R *.lfm}<br />
<br />
{ TForm1 }<br />
<br />
procedure TForm1.FormActivate(Sender: TObject);<br />
var<br />
fileDesc: integer;<br />
begin<br />
{ Prepare SoC pin 17 (pin 11 on GPIO port) for access: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/export', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_17[0], 2);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
{ Set SoC pin 17 as output: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/direction', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, OUT_DIRECTION[0], 3);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
<br />
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);<br />
var<br />
fileDesc: integer;<br />
begin<br />
{ Free SoC pin 17: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/unexport', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_17[0], 2);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
<br />
procedure TForm1.GPIO17ToggleBoxChange(Sender: TObject);<br />
var<br />
fileDesc: integer;<br />
begin<br />
if GPIO17ToggleBox.Checked then<br />
begin<br />
{ Swith SoC pin 17 on: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/value', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_ON[0], 1);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end<br />
else<br />
begin<br />
{ Switch SoC pin 17 off: }<br />
try<br />
fileDesc := fpopen('/sys/class/gpio/gpio17/value', O_WrOnly);<br />
gReturnCode := fpwrite(fileDesc, PIN_OFF[0], 1);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
finally<br />
gReturnCode := fpclose(fileDesc);<br />
LogMemo.Lines.Add(IntToStr(gReturnCode));<br />
end;<br />
end;<br />
end;<br />
<br />
end.<br />
</pre><br />
<br />
''Main program:''<br />
<pre><br />
program io_test;<br />
<br />
{$mode objfpc}{$H+}<br />
<br />
uses<br />
{$IFDEF UNIX}{$IFDEF UseCThreads}<br />
cthreads,<br />
{$ENDIF}{$ENDIF}<br />
Interfaces, // this includes the LCL widgetset<br />
Forms, Unit1<br />
{ you can add units after this };<br />
<br />
{$R *.res}<br />
<br />
begin<br />
Application.Initialize;<br />
Application.CreateForm(TForm1, Form1);<br />
Application.Run;<br />
end.<br />
</pre><br />
<br />
Alternative ways to access the GPIO port with Lazarus / Free Pascal is by using [http://www.lazarus.freepascal.org/index.php/topic,17404.0.html Lazarus wrapper unit for Gordon Henderson's wiringPi C library] or [http://wiki.lazarus.freepascal.org/Lazarus_on_Raspberry_Pi#2._Hardware_access_via_encapsulated_shell_calls encapsulated shell calls].<br />
<br />
The [http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi Lazarus wiki] describes a [http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Reading_the_status_of_a_port demo program] that can read the status of a GPIO pin.<br />
<br />
=== BASIC ===<br />
==== BASIC - Return to BASIC ====<br />
<br />
'''RTB''' or Return to Basic can be found here: https://projects.drogon.net/return-to-basic/<br />
<br />
It's a new BASIC featuring modern looping constructs, switch statements, named procedures and functions as well as graphics (caresian and turtle), file handling and more. It also supports the Pi's on-board GPIO without needing to be run as root. (You don't need any special setup routines either)<br />
<br />
Sample blink program:<br />
<br />
<pre><br />
// blink.rtb:<br />
// Blink program in Return to Basic<br />
// Gordon Henderson, projects@drogon.net<br />
//<br />
PinMode (0, 1) // Output<br />
CYCLE <br />
DigitalWrite (0, 1) // Pin 0 ON<br />
WAIT (0.5) // 0.5 seconds<br />
DigitalWrite (0, 0)<br />
WAIT (0.5)<br />
REPEAT <br />
END <br />
</pre><br />
<br />
==== BASIC ====<br />
<br />
'''Bywater BASIC Interpreter'''<br />
<br />
The Bywater BASIC Interpreter (bwBASIC) implements a large superset of the ANSI Standard for Minimal BASIC (X3.60-1978) and a significant subset of the ANSI Standard for Full BASIC (X3.113-1987) in C. It also offers shell programming facilities as an extension of BASIC. bwBASIC seeks to be as portable as possible. <br />
You can download it at.<br />
http://packages.debian.org/stable/interpreters/bwbasic<br />
<br />
'''BASIC programming of the I/O'''<br />
<br />
'''Setting up a GPIO pin to be used for inputs or for outputs.'''<br />
<br />
We cannot load the control words directly into the 32 bit ARM registers with 32 bit addresses, as bwBASIC has no POKE and PEEK commands and other versions of BASIC (as far as I know) only handle 8 bit registers with 16 bit addresses with these commands. So we need to export the GPIO pins, so that they exist in a file structure which we can access from basic with the OPEN command.(ref 2)<br />
<br />
We need to do this in Linux root.<br />
We need to run BASIC in the root too. First we go to the root, then we load bwbasic into root.<br />
<pre><br />
sudo -1<br />
sudo bwbasic<br />
</pre><br />
<br />
REM Now to export the no4 GPIO pin for example, using a Shell command.<br />
<br />
<pre>echo “4” > /sys/class/gpio/export</pre><br />
<br />
Whilst bwbasic can accommodate shell commands, and we can store a set of these commands (eg. to export a number of GPIO pins at the outset) as numbered statements in a file that can be loaded with the basic command LOAD “filename” and RUN (ref 2), the shell commands have to run as a separate file, as they cannot be run from within, as part of a basic programme.<br />
<br />
'''Now we can access the file containing the pin direction setting from BASIC'''<br />
<br />
We can set GPIO pin 4 to input or to output by OPENing its pin direction file for output and writing “in” or “out” with a PRINT# command. (ref 2 )<br />
<syntaxhighlight lang="basic4gl"><br />
10 OPEN ”O”,#1, “/sys/devices/virtual/gpio/gpio4/direction”,2<br />
20 PRINT #1,”out”<br />
30 CLOSE #1<br />
</syntaxhighlight><br />
<br />
REM closes the open direction file, whereupon the system performs the action of setting the direction to “out”. NB the system only carries out the action as the file is closed.(ref 3)<br />
<br />
'''We are now able to control the output of the gpio 4 pin from BASIC'''<br />
<br />
We can set the GPIO 4 pin to 1 or to 0 by OPENing its pin value file for output and writing “1” or “0” with a PRINT# command.<br />
<syntaxhighlight lang="basic4gl"><br />
40 OPEN ”O”,#4, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
50 PRINT #4,”1”<br />
60 CLOSE #4 <br />
</syntaxhighlight><br />
<br />
REM turns on the output of GPIO pin 4.<br />
<br />
REM similarly we can turn off the output of GPIO pin 4.<br />
OPEN ”O”,#4, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
PRINT #4,”0”<br />
CLOSE #4.<br />
<br />
'''Example of an (unstructured) BASIC programme''' <br />
<br />
To read the state of a switch and control the power to two LEDs connected to GPIO pins 8,7 and 4 respectively.<br />
<br />
Programme to set 2 pins as outputs and 1 pin as input and to read the input turning on two different combinations of the two outputs (ie output 0,1 or 1,0) depending on the state of the input (1 or 0).<br />
<syntaxhighlight lang="basic4gl"><br />
sudo –i<br />
sudo bwbasic<br />
LOAD “export.bas”<br />
LIST<br />
REM a set of Shell statements to export the three GPIO pins.<br />
10 echo “4” > /sys/class/gpio/export<br />
20 echo “7” > /sys/class/gpio/export<br />
30 echo “8” > /sys/class/gpio/export<br />
RUN<br />
</syntaxhighlight><br />
<br />
NEW REM clears the export.bas programme from memory<br />
<syntaxhighlight lang="basic4gl"><br />
.<br />
LOAD “demo1.bas”<br />
LIST<br />
10 OPEN ”O”,#1, “/sys/devices/virtual/gpio/gpio4/direction”,2 <br />
20 OPEN ”O”,#2, “/sys/devices/virtual/gpio/gpio7/direction”,2 <br />
30 OPEN ”O”,#3, “/sys/devices/virtual/gpio/gpio8/direction”,2<br />
REM opens the three pin direction files<br />
40 PRINT #1, “out”<br />
50 PRINT #2, “out”<br />
60 PRINT #3, “in”<br />
REM sets GPIO pins 4 and 7 as outputs and GPIO pin 8 as input.<br />
70 CLOSE #1<br />
80 CLOSE #2<br />
90 CLOSE #3<br />
REM closes all open files, allowing the system to perform the direction settings.<br />
100 OPEN ”I”,#8, “/sys/devices/virtual/gpio/gpio8/value”,1<br />
REM opens the GPIO pin 8 value file<br />
110 INPUT #8,x<br />
REM reads the value of the input pin and stores the value in numerical variable x<br />
120 CLOSE #8<br />
REM closes the open file, allowing the system to read the value of the input pin and store the value in numerical variable x.<br />
130 OPEN “O”,#1, “/sys/devices/virtual/gpio/gpio4/value”,1<br />
140 OPEN “O”,#2, “/sys/devices/virtual/gpio/gpio7/value”,1<br />
REM opens the GPIO pins 4 and value files ready for outputting 1s and 0s.<br />
150 IF x<1 THEN GOTO 160 ELSE GOTO 190<br />
REM tests the state of the switch (1 or0) and directs the program to generate the appropriate outputs<br />
160 PRINT #1,”1”<br />
170 PRINT #2,”0”<br />
180 GOTO 210<br />
190 PRINT#1,"0"<br />
200 PRINT #2,"1"<br />
210 CLOSE #1<br />
220 CLOSE #2<br />
REM Closes the files and allows the outputs to light the LED<br />
230 END.<br />
</syntaxhighlight><br />
<br />
When all is done, we should unexport the GPIO pins, to leave the R-Pi as we found it.(Ref 1.)<br />
<syntaxhighlight lang="basic4gl"><br />
NEW<br />
LOAD “unexport.bas”<br />
LIST<br />
REM a set of Shell statements to unexport the three GPIO pins.<br />
10 echo “4” > /sys/class/gpio/unexport<br />
20 echo “7” > /sys/class/gpio/unexport<br />
30 echo “8” > /sys/class/gpio/unexport<br />
RUN<br />
</syntaxhighlight><br />
A simple circuit to provide the switched input and the two LED outputs.<br />
<br />
Ancient Mariner. Dec. 2012<br />
<br />
References.<br />
<br />
1. This paper RPi Low-level peripherals.<br />
<br />
2. Ed Beynon. [http://www.ybw.com/forums/showthread.php?t=331320&page=5 http://www.ybw.com/forums/showthread.php?t=331320&page=5]<br />
<br />
3. Arthur Kaletzky. Private communication. 25/10/2012<br />
<br />
4. bwbasic manual.<br/><br />
<br />
For the two original documents this example has been copied from see:<br/><br />
[[Media:GPIO_Driving_Example_(BASIC)_.doc | GPIO_Driving_Example_(BASIC)_.doc]]<br />
<br />
[[Media:Raspberry_Pi_I-O_viii.doc | Raspberry_Pi_I-O_viii.doc]]<br />
<br />
==SPI==<br />
<br />
There is one SPI bus brought out to the header: [[RPi_SPI]]<br />
<br />
==MIPI CSI-2==<br />
<br />
On the production board<ref>http://www.raspberrypi.org/wp-content/uploads/2012/04/Raspberry-Pi-Schematics-R1.0.pdf</ref>, the Raspberry Pi Foundation design brings out the MIPI CSI-2 (Camera Serial Interface<ref>http://www.mipi.org/specifications/camera-interface</ref>) to a 15-way flat flex connector S5, between the Ethernet and HDMI connectors. A compatible camera<ref>http://elinux.org/Rpi_Camera_Module</ref> with 5 Megapixels and 1080p video resolution was released in May 2013.<br />
<br />
==DSI==<br />
<br />
On the production board, the Raspberry Pi Foundation design brings out the DSI (Display Serial Interface<ref>http://www.mipi.org/specifications/display-interface</ref>) to a 15-way flat flex connector labelled S2, next to Raspberry Pi logo. It has two data lanes and a clock lane, to drive a possible future LCD screen device. Some smart phone screens use DSI<ref>http://en.wikipedia.org/wiki/Display_Serial_Interface</ref>.<br />
<br />
==CEC==<br />
<br />
[[CEC (Consumer Electronics Control) over HDMI|HDMI-CEC (Consumer Electronics Control for HDMI)]] is supported by hardware but some driver work will be needed and currently isn't exposed into Linux userland.<br />
Eben notes that he has seen CEC demos on the Broadcom SoC they are using. <br />
<br />
libCEC with Raspberry Pi support has been included in OpenELEC and will be included in Raspbmc RC4.<ref>http://blog.pulse-eight.com/2012/08/01/libcec-1-8-0-a-firmware-upgrade-and-raspberry-pi-support/</ref><br />
<br />
For more information about HDMI-CEC and what you could do with it on the Raspberry Pi please see the [[CEC (Consumer Electronics Control) over HDMI]] article.<br />
<br />
== References ==<br />
<references/><br />
<br />
<br />
{{Template:Raspberry Pi}}</div>Gamaralhttps://elinux.org/index.php?title=RPi_Distributions&diff=213596RPi Distributions2013-01-25T07:44:26Z<p>Gamaral: MES (a project) replaced by the actual distro RPi-BuildRoot</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category:ARM Development Boards]]<br />
[[Category: Broadcom]]<br />
[[Category: Development Boards]]<br />
[[Category: RaspberryPi]]<br />
[[Category: Education]]<br />
{{Template:RPi_Software}}<br />
<br />
=Available Distributions=<br />
<br />
== What is armhf ==<br />
<br />
The official Debian Squeeze image issued by the Raspberry Pi foundation uses "soft float" settings. The foundation found it necessary to use the existing Debian port for less capable ARM devices due to time and resource constraints during development of the Raspberry Pi. Therefore, it does not make use of the Pi's processor's floating point hardware - reducing the Pi's performance during floating point intensive applications - or the advanced instructions of the ARMv6 CPU.<br />
<br />
The [http://www.raspberrypi.org/downloads official Raspberry Pi distributions] are now optimized for ARMV6 and for "hard float" which should have better performance on certain CPU intensive tasks. <br />
<br />
There are some info on the news groups that "hard float" optimization can speed up floating point operating up to 10x, please read detailed discussion on Raspberry Pi forums - http://www.raspberrypi.org/phpBB3/viewtopic.php?p=61497#p61497<br />
<br />
==Comparison==<br />
<br />
{| class="sortable wikitable"<br />
|+ Operating Systems for Raspberry Pi models A and B<br />
|-<br />
! Distribution <br />
! Latest<br />
! First<br />
! Type<br />
! License<br />
! Memory footprint<br />
! armhf<br />
! Image/Installer<br />
! Packages<br />
! Username:Password<br />
! default GUI<br />
|-<br />
| [http://archlinuxarm.org/ Arch Linux ARM]<br />
| 2012-09-18<br />
| 2012-03-01<br />
| Linux<br />
| [http://www.opensource.org/licenses/gpl-2.0.php OSI GPLv2]<br />
| <br />
| {{yes}}<br />
| [http://downloads.raspberrypi.org/download.php?file=/images/archlinuxarm/archlinuxarm-29-04-2012/archlinuxarm-29-04-2012.zip raw image]<br />
| [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=53&t=19842 {{formatnum:4604}}]<br />
| root:root<br />
| none<br />
|-<br />
| [http://www.berryterminal.com/doku.php BerryTerminal]<br />
| 2012-06-02 <br />
| 2012-06-02<br />
| Linux<br />
| <br />
| <br />
| {{no}}<br />
| [http://www.berryterminal.com/dl/berryterminal-20120602.zip Image]<br />
| <br />
| N/A<br />
| [http://www.ltsp.org/ ltsp]<br />
|-<br />
| [http://bodhilinux.com/ Bodhi Linux]<br />
| 2012-09-13 (raspbian/wheezy)<br />
| 2012-06-12 (wheezy)<br />
| Raspbian<br />
| [http://www.debian.org/legal/licenses/ Core: OSI mixed] (GPLv2 BSD etc)<br />
| <br />
| {{yes}}<br />
| [http://bodhilinux.com/downloads_mobile.php img+md5sum] <br />
| [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=4256&start=552 {{formatnum:35000}}+] <br/> [http://jeffhoogland.blogspot.co.at/2012/08/bodhis-arm-branch-moves-to-armhf.html ARMHF]<br />
| pi/bodhilinux <br/>(sudo su root/bodhilinux)<br />
| [http://www.enlightenment.org/ Enlightenment]<br />
|-<br />
| [http://www.debian.org/ports/arm/ Debian ARM]<br />
| 2012-04-19 (Squeeze)<br />
| 2012-02-16 (Squeeze)<br />
| Linux<br />
| [http://www.debian.org/legal/licenses/ Core: OSI mixed] (GPLv2 BSD etc)<br />
| <br />
| {{no}}<br />
| [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip raw image]<br />
| [http://packages.debian.org/stable/allpackages {{formatnum:20000}}+]<br />
| pi:raspberry<br />
| ?<br />
|-<br />
| [http://fedoraproject.org/wiki/Architectures/ARM Fedora Remix]<br />
| 2012-07-07 (F14)<br />
| 2012-07-07 (F14)<br />
| Linux<br />
| [http://fedoraproject.org/wiki/Licensing:Main OSI mixed] (GPLv2 BSD etc)<br />
| <br />
| {{no}}<br />
| Fedora RPM: [http://files.velocix.com/c1410/fedora/installer/fedora/fedora-arm-installer-1.0.0-1.fc16.noarch.rpm installer]<br />Windows Zip: [http://files.velocix.com/c1410/fedora/installer/windows/fedora-arm-installer-1.0.0.zip installer]<br />Other Linux: [http://files.velocix.com/c1410/fedora/installer/source/faii-1.0.0.tar.gz Python script]<br />
| [http://dl.fedoraproject.org/pub/fedora-secondary/releases/14/Everything/arm/os/Packages/ {{formatnum:16464}}]?<br />
| root:fedoraarm<br />
| gnome?<br />
|-<br />
| [http://www.gentoo.org/ Gentoo Linux]<br />
| weekly autobuilds<br />
| 2012-04-27<br />
| Linux<br />
| [http://www.opensource.org/licenses/gpl-2.0.php GPLv2]<br />
| ~23 MiB<br />
| {{yes}}<br />
| [http://wiki.gentoo.org/wiki/Raspberry_Pi Wiki article] [http://wiki.gentoo.org/wiki/Raspberry_Pi_Quick_Install_Guide Quick Install Guide] <br /> [http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv6j_hardfp/ stage3 tarball] <br />
| <br />
| N/A<br />
| <br />
|-<br />
| [http://planet.ipfire.org/post/ipfire-on-raspberry-pi-ready-to-first-test IPFire]<br />
| 2012-06-27 (2.11)<br />
| 2012-06-27 (2.11)<br />
| Linux<br />
| Open Source<br />
| ~20 MiB<br />
| {{no}}<br />
| raw image (404 error from their own website)<br />
| [http://wiki.ipfire.org/en/addons/all 144]<br />
| N/A<br />
| none<br />
|-<br />
| [http://wiki.meego.com/User:Vgrade#Raspberry_Pi Meego MER + XBMC]<br />
| 2012-04-27 (0.2)<br />
| 2012-04-11 (0.1)<br />
| Linux (embedded)<br />
| [http://www.opensource.org/licenses/index.html OSI mixed] (GPLv2 BSD etc)<br />
| ~34 MiB + XBMC<br />
| {{no}}<br />
| <br />
| [http://gitweb.merproject.org/gitweb/ ~{{formatnum:320}}] (core)<br />
| N/A<br />
| [http://www.xbmc.org XBMC]<br />
|-<br />
| [http://moebiuslinux.sourceforge.net/ Moebius]<br />
| 2012-09-11 (1.0.1)<br />
| 2012-08-01 (1.0.0)<br />
| Raspbian<br />
| (GPLv2)<br />
| ~20 MiB<br />
| {{yes}}<br />
| [http://moebiuslinux.sourceforge.net/download Raw Image]<br />
| (core) + Raspbian Repositories<br />
| root: raspi<br />
| none<br />
|-<br />
| [http://lists.opensuse.org/opensuse-arm/ openSUSE]<br />
| 2012-10-16<br />
| 2012-07-30<br />
| Linux 3.1<br />
| [http://www.opensource.org/licenses/index.html OSI mixed] (GPLv2 BSD etc)<br />
| 279 MiB (inc. X11)<br />
| {{no}}<br />
| [http://zq1.de/~bernhard/linux/opensuse/raspberrypi-opensuse-20121016.img.gz raw image]<br />
| [https://build.opensuse.org/project/show?project=openSUSE%3AFactory%3AARM 5000]<br />
| root:linux<br />
| icewm via startx<br />
|-<br />
| [http://wiki.openwrt.org/toh/raspberry_pi OpenWRT]<br />
| 2012-10-23<br />
| 2012-08-15<br />
| Linux<br />
| [http://www.opensource.org/licenses/index.html OSI mixed] (GPLv2 BSD etc)<br />
| 3,3MiB<br />
| {{no}}<br />
| [http://downloads.openwrt.org/attitude_adjustment/12.09-beta2/brcm2708/generic/ Image] <br />
| [http://downloads.openwrt.org/attitude_adjustment/12.09-beta2/brcm2708/generic/packages/ Packages]<br />
| [http://wiki.openwrt.org/doc/howto/firstlogin first login with telnet] <br> set your SSH pw<br />
| [http://wiki.openwrt.org/doc/howto/luci.essentials LuCI]<br />
|-<br />
| [http://pibanglinux.org/ PiBang Linux]<br />
| December 26th, 2012 (20121226)<br />
| November 29th, 2012 (Alpha1)<br />
| Linux<br />
| [http://www.debian.org/legal/licenses/ Core: OSI mixed] (GPLv2 BSD etc)<br />
|<br />
| {{yes}}<br />
| [http://pibanglinux.org/download.html Latest image]<br />
| <br />
| root:raspberry (user created at first boot)<br />
| [http://en.wikipedia.org/wiki/Openbox/ Openbox]<br />
|-<br />
| [http://www.pwnpi.net/index.html PwnPi]<br />
| 2012-06-29 (Squeeze)<br />
| 2012-05-26 (Squeeze)<br />
| Linux<br />
| GNU General Public License version 3.0 <br />
| <br />
| {{no}}<br />
| [http://sourceforge.net/projects/pwnpi/files/pwnpi-2.0-final.7z/download Image]<br />
| [http://packages.debian.org/stable/allpackages {{formatnum:20000}}+]<br />
| root:toor<br />
|[http://www.xfce.org/ xfce]<br />
|-<br />
| [http://wiki.qt-project.org/QtonPi QtonPi]<br />
| 2012-05-27 (0.2)<br />
| 2012-05-07 (0.1)<br />
| Linux<br />
| <br />
| <br />
| {{no}}<br />
| [http://downloads.raspberrypi.org/images/qtonpi/qtonpi-0.02/qtonpi-0.2.tar.bz2 qt 5 sdk + sdcard image]<br />
| <br />
| root:rootme<br/>qtonpi:qtonpi<br />
| ?<br />
|-<br />
| [http://www.raspbian.org/ Raspbian]<br />
| 2012-09-18 <br />
| 2012-05-28 (Wheezy)<br />
| Linux<br />
| [http://www.debian.org/legal/licenses/ Core: OSI mixed] (GPLv2 BSD etc)<br />
| ~30 MiB w/o desktop<br />
| {{yes}}<br />
| [http://www.raspbian.org/RaspbianImages pi image list] <br />[http://debian.raspbian.com/qemu/ qemu image]<br />
| [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=4256&start=552 {{formatnum:35000}}+]<br />
| root:hexxeh<br />root:raspbian<br />pi:raspberry<br />
| [http://wiki.lxde.org/en/Openbox LXDE Openbox]<br />
|-<br />
| [http://openelec.tv/component/k2/item/235-openelec-on-raspberry-pi-our-first-arm-device-supported OpenELEC]<br />
| 2013-01-03 (3.0 RC 1)<br />
| 2012-05-10<br />
| Linux 3.6.11 (embedded)<br />
| [http://www.opensource.org/licenses/index.html OSI mixed] (GPLv2 BSD etc)<br />
| 85 MiB (inc. XBMC)<br />
| {{yes}}<br />
| [http://wiki.openelec.tv/index.php?title=Installing_OpenELEC_on_Raspberry_Pi install instructions]<br /><br />
[http://openelec.tv/component/k2/item/241-openelec-meets-raspberry-pi-part-1 build instructions - part 1]<br />[http://openelec.tv/component/k2/item/242-openelec-meets-raspberry-pi-part-2 build instructions - part 2]<br />[http://sources.openelec.tv/tmp/image/openelec-rpi/ official builds]<br />[http://sparky0815.de/openelec-download-images-fat-files/ raw image (unofficial)]<br />
| [https://github.com/OpenELEC/OpenELEC.tv/tree/master/packages ~{{formatnum:140}}] (+ [http://wiki.openelec.tv/index.php?title=OpenELEC_Addons_(official) 7] via xbmc)<br />
| root:openelec<br/>(ssh only)<br />
| [http://www.xbmc.org XBMC-PVR]<br />
|-<br />
| [http://xbian.org/ XBian]<br />
| 2012-11-27<br />
| 2012-07-29 <br />
| Raspbian<br />
| [http://www.opensource.org/licenses/index.html OSI mixed] (GPLv2 BSD etc)<br />
| <br />
| {{yes}}<br />
| [http://download.xbian.org/xbian-installer.zip Windows installer] <br /> [http://xbian.org/download/ Latest images] <br /> [http://xbian.org/getting-started/ Install instructions]<br />
| [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=4256&start=552 {{formatnum:35000}}+]<br />
| xbian:raspberry<br />
| [http://www.xbmc.org XBMC]<br />
|-<br />
| [http://www.raspbmc.com/ raspbmc]<br />
| 2012-10-10<br />
| 2012-06-30 (Squeeze)<br />
| Raspbian<br />
| [http://svn.stmlabs.com/svn/raspbmc/LICENSE custom]<br />
| <br />
| {{yes}}<br />
| [http://raspbmc.com/downloads/bin/xbmc/nightlies/ nightlies] <br> [http://svn.stmlabs.com/svn/raspbmc/testing/installers/python/install.py linux installer] <br> [http://download.raspbmc.com/downloads/bin/installers/raspbmc-win32.zip windows installer]<br />
| [http://packages.debian.org/stable/allpackages {{formatnum:20000}}+]<br />
| pi:raspberry<br />
| [http://www.xbmc.org XBMC]<br />
|-<br />
| [http://en.wikipedia.org/wiki/RISC_OS RISC OS]<br />
| 2012-11-01 (5.19 RC6)<br />
| 2012-07-09 (5.19)<br />
| RISC OS<br />
| [http://www.riscosopen.org/content/documents/ssfaq Shared Source]<br />
| <br />
| {{no}}<br />
| [http://www.raspberrypi.org/downloads Latest official image] <br /><br />
| <br />
| (not applicable)<br />
| [http://en.wikipedia.org/wiki/RISC_OS RISC OS WIMP]<br />
|-<br />
| [http://www.slitaz.org/ SliTaz]<br />
| 2012-12-14 (cooking)<br />
| 2012-05-29 (4.0)<br />
| Linux 3.2.27<br />
| [http://www.opensource.org/licenses/gpl-2.0.php GPLv2]<br />
| ~10 MiB<br />
| {{yes}}<br />
| [http://arm.balinor.net/slitaz/armhf/ raw image]<br />
| [http://arm.balinor.net/slitaz/armhf/packages/ Packages]<br />
| root:root<br />
| [http://en.wikipedia.org/wiki/Openbox/ Openbox ?]<br />
|-<br />
| [http://www.aros.org/ Aros hosted on Raspbian Limited Demo]<br />
| <!--Latest-->2012-06-14<br />
| <!--First-->2012<br />
| <!--Type-->Mixed Debian6 and Aros <br />
| <!--Licence-->Mixed - [http://www.opensource.org/licenses/gpl-2.0.php GPLv2] and APL (MPL derivative)<br />
| <!--Memory requirement--><~50 MiB<br />
| <!--ArmHF-->{{no}}<br />
| <!--Image-->[http://www.aeros-os.org/aerosmxb2.tar.gz Binaries and run ./where/ever/AEROS/boot/AROSbootstrap] <br />
| <!--Packages--><br />
| <!--Username:Password-->pi:raspberry<br />
| <!--GUI-->[http://www.aros.org Aros Wanderer]<br />
|-<br />
| [http://plan9.bell-labs.com/plan9 Plan9]<br />
| <!--Latest-->2012-11-26<br />
| <!--First-->2012-11-12<br />
| <!--Type-->Plan 9 <br />
| <!--Licence-->[http://plan9.bell-labs.com/sources/plan9/LICENSE Lucent]<br />
| <!--Memory requirement--><br />
| <!--ArmHF-->{{no}}<br />
| <!--Image-->[http://plan9.bell-labs.com/sources/contrib/miller/9pi.img.gz raw image] <br />
| <!--Packages--><br />
| <!--Username:Password--><br />
| <!--GUI-->[http://plan9.bell-labs.com/wiki/plan9/using_rio Rio]<br />
|-<br />
|}<br />
<br />
==Android==<br />
Discuss: [http://www.raspberrypi.org/phpBB3/viewforum.php?f=73 Forum at raspberrypi.org]<br />
<br />
[http://androidpi.wikia.com/wiki/Android_Pi_Wiki Wiki & Main site]<br />
<br />
==Fedora Remix==<br />
<br />
The Raspberry Pi Fedora Remix is a Linux software distribution for the Raspberry Pi computer. It contains software packages from the Fedora Project (specifically, the Fedora ARM secondary architecture project), packages which have been specifically written for or modified for the Raspberry Pi, and proprietary software provided by the Raspberry Pi Foundation for device access. <br />
<br />
* [http://zenit.senecac.on.ca/wiki/index.php/Raspberry_Pi_Fedora_Remix wiki page]<br />
<br />
==Debian (Squeeze/6.x)==<br />
<br />
[http://www.debian.org/ports/arm/ http://www.debian.org/ports/arm/]<br />
<br />
[http://www.debian.org/ Debian] was the default distribution on the Alpha boards. Boot time depends on width & speed of SD-card. Alpha board boot into Debian prompt (no GUI) was timed taking about 34 seconds.<br />
<br />
The Debian distro for Raspberry Pi is the Cambridge reference filesystem, which is a fully functional Debian Squeeze installation containing LXDE (desktop) and Midori (browser); development tools; and sample code for accessing the multimedia functionality on the device.<br />
<br />
==Arch==<br />
<br />
[http://archlinuxarm.org Arch Linux ARM] is based on [http://www.archlinux.org/ Arch Linux], which aims for simplicity and full control to the end user. It provides a lightweight base structure that allows you to shape the system to your needs. For this reason, the Arch Linux ARM image for the Raspberry Pi does not come with a graphical user interface, though you can easily install one yourself. Please note that the Arch distribution may not be suitable for beginners.<br />
<br />
Arch Linux ARM is on a rolling-release cycle that can be updated daily through small packages instead of huge updates every few months.<br />
<br />
More information is available at http://archlinuxarm.org<br />
<br />
==Raspbian==<br />
<br />
Raspberry Pi + Debian = [http://www.raspbian.org Raspbian]. A project to create a hard float port of Debian Wheezy (7.x) armhf for the Raspberry Pi. The intent of Raspbian is to bring to the Raspberry Pi user 10,000s of pre-built Debian packages specifically tuned for optimal performance on the Raspberry Pi hardware. The project is still in it's early phases, but the major push to rebuild nearly all Debian packages for the Raspberry Pi is expected to be completed by early June, 2012 (only several hundred packages remain as of June 1st). After that, efforts will focus on making Raspbian the easiest to use, most stable and best performing Linux distribution available for the Raspberry Pi.<br />
<br />
More information is available at http://www.raspbian.org<br />
<br />
==Moebius==<br />
A very compact ARM HF debian based distribution, it fits in a 1Gb SD card, has autoresizing features to better adapt to your SD card size and uses Raspbian huge repositories for installing everything you need. A wise configuration and a small memory footprint are ideal for an headless machine or for interacting with real word I/O devices, take a look at [http://moebiuslinux.sourceforge.net/ Moebius Website]<br />
<br />
==Raspbian Server Edition==<br />
It's a stripped version of Raspibian with some other packages<br />
*[http://sirlagz.net/?p=662 Main site of version 2.1]<br />
*[https://docs.google.com/file/d/0B1RhPrxJp7gySmpybnhXOEo0MXM/edit?pli=1 Dowload Version 2.1]<br />
<br />
== Red Sleeve Linux ==<br />
[http://www.redsleeve.org/ Red Sleeve Linux] is a Linux distribution that aims to bring the RHEL clone design to the ARM architecture.<br />
There are images for several ARM devices including the Raspberry Pi.<br />
<br />
== IPFire ==<br />
<br />
[http://www.ipfire.org IPFire] is an Open Source firewall distribution for x86 and ARM-based systems. It turns the Raspberry Pi computer into a small router for home networks and very small businesses. As the Raspberry Pi computer comes with only one NIC, it works perfectly as a 3G router without plugging in additional hardware.<br />
<br />
The generally small system that provides essential services for networks can be enhanced by addons which add new features to IPFire. So the system can be turned into a file server and much more.<br />
<br />
More information is available at http://www.ipfire.org<br />
<br />
==Raspberry Pi Thin Client==<br />
Thin Client project want to create a very low price thin client over Raspberry Pi board! Microsoft RDC, Citrix ICA & VMWare View<br />
*[http://rpitc.blogspot.se/ Homepage]<br />
*[http://rpitc.blogspot.se/p/download.html Dowload]<br />
<br />
==DarkElec==<br />
None of the currently available solutions do a perfect job with running XBMC on the Pi, however OpenELEC comes by far the closest, in spite of its locked down nature.<br />
<br />
This fork aims to remedy the very few flaws in its implementation and to focus 100% on the Pi, while also sticking to the upstream and incorporating its updates.<br />
<br />
Features:<br />
•Low idle CPU usage (< 15%)<br />
•Smoother and more responsive<br />
•Built in XBMC addons: iPlayer, custom fixed version of Demand 5, various unofficial repos<br />
•iPlayer, 4oD, Demand 5, ITV Player, SportsDevil all fully tested+working<br />
•Improved wifi connectivity<br />
•Added test-connman scripts for easy wifi setup <br />
•Added wireless_tools (iwconfig etc.)<br />
•Added rndis_wlan wifi driver (broadcom 4320 chipset)<br />
•Easy SD card installation script for building from source <br />
<br />
*[http://darkimmortal.com/category/raspberry-pi/ Main site]<br />
*[http://shit.weeaboo.com/darkelec3.zip Download DarkELEC Release 3]<br />
<br />
==OpenELEC==<br />
<br />
OpenELEC is an embedded operating system built specifically to run [http://www.xbmc.org XBMC], the open source entertainment media hub. The idea behind OpenELEC is to allow people to use their Home Theatre PC (HTPC) like any other device you might have attached to your TV, like a DVD player or Sky box. Instead of having to manage a full operating system, configure it and install the packages required to turn it into a hybrid media center, OpenELEC is designed to be simple to install, manage and use, making it more like running a set-top box than a full-blown computer.<br />
<br />
*[http://www.openelec.tv OpenELEC Mainsite]<br />
*In February 2012, OpenELEC.tv announced their [http://openelec.tv/component/k2/item/235-openelec-on-raspberry-pi-our-first-arm-device-supported ARM port for Raspberry Pi]<br />
*[http://openelec.tv/forum/90-miscellaneous/11763-raspberry-pi OpenELEC forum] thread<br />
*[http://www.raspberrypi.org/forum/general-discussion/openelec RaspberryPi forum] thread<br />
*[http://elinux.org/Rpi_openELEC Raspberry Pi build instructions for OpenELEC]<br />
<br />
==Raspbmc==<br />
<br />
Raspbmc is a minimal Linux distribution based on Debian that brings XBMC to your Raspberry Pi. This device has an excellent form factor and enough power to handle media playback, making it an ideal component in a low HTPC setup, yet delivering the same XBMC experience that can be enjoyed on much more costly platforms. Raspbmc is brought to you by the developer of the Crystalbuntu Linux Distribution, which brings XBMC and 1080p decoding to the 1st generation Apple TV.<br />
<br />
*[http://www.raspbmc.com/ Main Site]<br />
<!--*[http://webcache.googleusercontent.com/search?q=cache:risUEuNLWycJ:www.raspbmc.com/+&cd=1&hl=en&ct=clnk&client=firefox-a Cache of Main Site] Site had problems with their provider, but they're resolved for now. --~~~~ --><br />
*[http://www.stmlabs.com/2012/06/24/network-issues/ Blog]<br />
*[http://files.velocix.com/c1410/raspbmc/downloads/bin/ramdistribution/installer-testing.img.gz image]<br />
*[http://download.raspbmc.com/downloads/bin/installers/raspbmc-win32.zip 1-click-Installer (Win)]<br />
*[http://www.raspbmc.com/wiki/user/os-x-linux-installation/ Installation instructions (Mac/Lin)]<br />
*[http://svn.stmlabs.com/listing.php?repname=raspbmc source]<br />
<br />
==XBian==<br />
XBian is a small, fast and lightweight media center distro for the Raspberry Pi, based on a minimal Raspbian image. It's slogan is "XBMC on raspberry pi, bleeding edge" and thus it's main focus is delivering the fastest XBMC solution for the Raspberry Pi. Thereby making most of the commercial media-center products obsolete...<br />
<br />
[[Features:]]<br />
<br />
*Fits on a 1GB SD card<br />
*Low RAM usage and low CPU usage<br />
*Very smooth UI<br />
*Auto mount USB<br />
*AFP support<br />
*NFS support<br />
*AirPlay support<br />
*CEC support<br />
*Lirc support<br />
*PVR support<br />
*Kernel 3.6.7 + a lot of modules<br />
*Performance as the default governor<br />
*Out of the box support for almost all wlan adapters<br />
*User friendly configuration tool xbian-config<br />
*Source code on git<br />
*Large community<br />
*Apt repo so updated was never easier!<br />
<br />
<br />
*[http://xbian.org/ Main Site] <br />
*[https://github.com/xbianonpi/xbian Xbian Github]<br />
<br />
==PwnPi==<br />
*[http://pwnpi.net http://pwnpi.net/]<br />
PwnPi is a Linux-based penetration testing dropbox distribution for the Raspberry Pi. It currently has 181 network security tools pre-installed to aid the penetration tester. It is built on the debian squeeze image from the raspberry pi foundation's website and uses Xfce as the window manager<br />
<br />
==ha-pi==<br />
*[https://sourceforge.net/projects/ha-pi/ Main Site]<br />
Description<br />
This debian squeeze image created to perform "pwn plug" type of attacks using Raspberry pi.<br />
pleas look at the wiki for further details [https://sourceforge.net/p/ha-pi/wiki/Home/ Wiki]<br />
<br />
==Bodhi==<br />
Bodhi Linux is a small Linux distribution using the [http://www.enlightenment.org Enlightenment] window manager and the ARM build is based on Debian.<br />
<br />
If you hit any snags or find bugs with this image please let us know in the [http://forums.bodhilinux.com/index.php?/forum/30-raspberry-pi/ R_Pi section of our user forums] so we can improve this release.<br />
<br />
* [http://jeffhoogland.blogspot.co.at/2012/07/bodhi-linux-raspberry-pi-beta.html?showComment=1343869408306#c8475812441665709126/ ARMHF ] announced for Bodhi Linux on R_Pi <br />
*[http://jeffhoogland.blogspot.co.at/2012/06/bodhi-linux-arm-alpha-release-for.html Release Announcement] from Bodhi Developer Blog<br />
*[http://sourceforge.net/projects/bodhilinux/files/ARM/RaspBerryPi/ Download] from sourceforge<br />
*[http://forums.bodhilinux.com/index.php?/topic/2472-what-about-the-raspberry-pi/ what-about-the-raspberry-pi] Forum thread<br />
<br />
Alpha Release [http://jeffhoogland.blogspot.co.at/2012/06/bodhi-linux-arm-alpha-release-for.html | Link Alpha Bodhi R_Pi])<br />
User/Password: bodhi/bodhi root/raspberry <br />
Beta Release [http://jeffhoogland.blogspot.co.at/2012/07/bodhi-linux-raspberry-pi-beta.html | Link Beta Bodhi R_Pi ] <br />
User/Password: pi/bodhilinux Root: sudo su root/bodhilinux<br />
<br />
Bodhi Linux moves ARM Branch to [http://jeffhoogland.blogspot.co.at/2012/08/bodhis-arm-branch-moves-to-armhf.html ARMHF] [http://sourceforge.net/projects/bodhilinux/files/ARMHF/Pi/ Download newest Release from Sourcforge]<br />
The R_Pi Bodhi build is built directly on top of Raspbian and incorporates all of their changes and improvements.<br />
<br />
==Gentoo== <br />
<br />
[http://www.gentoo.org/ Gentoo Linux] is a source based rolling-release distribution which emphasizes choice and flexibility. [http://www.gentoo.org/proj/en/base/arm/ Gentoo ARM] aims to be the most up to date and fastest ARM distribution available.<br />
<br />
A [http://wiki.gentoo.org/wiki/Raspberry_Pi_Quick_Install_Guide Quick Start Guide] exists how to install Gentoo on the Raspberry Pi.<br />
<br />
[http://www.raspberrypi.org/phpBB3/viewforum.php?f=54 Gentoo Section] on the official Raspberry Pi forum.<br />
<br />
==Adafruit - Occidentalis v0.1== <br />
http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-1<br />
Occidentalis v0.1. Rubus occidentalis is the black raspberry. It is derived from Raspbian Wheezy July 15<br />
Made a few key changes to make it more hardware-hacker friendly!<br />
*I2C and hardware SPI support<br />
*I2C/SPI modules initialized on boot<br />
...<br />
Please keep in mind, adafruit is not full time linux distro maintainers - we will try to fix any bugs we find but this distro is not for beginners or people who are new to linux!<br />
<br />
==RISC OS==<br />
<br />
RISC OS is a fast and lightweight computer operating system designed in Cambridge, England by [http://en.wikipedia.org/wiki/Acorn_Computers Acorn]. First released in 1987, its origins can be traced back to the original team that developed the ARM microprocessor. RISC OS includes [http://en.wikipedia.org/wiki/BBC_BASIC BBC BASIC] which was primarily conceived to teach programming skills as part of the BBC computer literacy project.<br />
<br />
*[http://www.riscosopen.org/ RISC OS Open] (ROOL) has released the sources. Community members have ported the OS to the BeagleBoard and similar hardware<br />
*In November 2011, RISCOScode.com announced that [http://www.riscoscode.com/Pages/Item0113.html RISC OS will be available as an alternative OS] for Raspberry Pi <del>from launch</del><br />
*[http://www.raspberrypi.org/forum?mingleforumaction=viewtopic&t=919 RaspberryPi forum] thread<br />
*[http://www.riscosopen.org/forum/forums/5/topics/783 ROOL forum] thread<br />
*http://www.pilearn.com/Pages/Page1001.html<br />
<br />
==PiBang Linux==<br />
<br />
PiBang linux is a Raspbian based distribution. PiBang is inspired by Crunchbang Linux, an i686 and x86_68 Debian based distribution. It comes preconfigured with many helpful scripts and pipemenus as well as a fork of Raspi-config with increases functions such as support for changing the user and hostname. PiBang is also one of the heavier Rasperry Pi distributions boasting a complete package set with favorites such as Abiword, OMXPlayer, GIMP, and VLC all pre-installed.<br />
<br />
http://www.pibanglinux.org<br />
<br />
== Plan 9 ==<br />
<br />
Plan 9 is a distributed operating system originally designed and implemented by Ken Thompson, Rob Pike, Dave Presotto, and Phil Winterbottom @ Bell Labs. It is a lean operating system that has been ported to super computers such as IBM's Blue Gene down to tiny boards such the RaspberryPi.<br />
<br />
*[http://plan9.bell-labs.com/sources/contrib/miller/9pi.img.gz Distribution disk image]<br />
*[http://www.raspberrypi.org/phpBB3/viewtopic.php?f=80 Plan9 subforum @ raspberryPi.org]<br />
*[http://research.swtch.com/acme Acme editor tutorial]<br />
*[http://plan9.bell-labs.com/plan9/ Plan 9 Main page]<br />
*[http://www.plan9.bell-labs.com/wiki/plan9/plan_9_wiki/ Plan 9 wiki]<br />
<br />
=Announced distributions=<br />
<br />
The following distributions have been announced and may have been publicly demonstrated but distributions are not generally available quite yet.<br />
<br />
==NetBSD==<br />
NetBSD is an operating system based off 4.3BSD and is geared towards embedded systems.<br />
There has been an unofficial public beta release [ftp://ftp.netbsd.org/pub/NetBSD/misc/skrll/rpi-netbsd-6.img.gz here], however the since there is no video or networking support yet, the only way to interface with it is through a serial console.<br />
<br />
==FreeBSD==<br />
[http://kernelnomicon.org/?p=164 Details and install guide of the FreeBSD port]<br />
<br />
==Chromium OS==<br />
[http://www.engadget.com/2012/06/20/chromium-os-gets-ported-to-raspberry-pi/ Details about the work]<br />
Chromium OS is Google own version of linux os <br />
<br />
==KidsRuby==<br />
<br />
KidsRuby is what it sounds like – a Ruby for kids – and it’s running beautifully on the Raspberry Pi. This is exactly the sort of application we want to see on the device, and we’re really pleased to see it up and running. It looks like there will be some optimisation for speed before we launch, but what’s there already is very useable.<br />
<br />
R.Pi blog entry: [http://www.raspberrypi.org/2011/09/kidsruby-on-raspberry-pi-another-video-demo/ http://www.raspberrypi.org/2011/09/kidsruby-on-raspberry-pi-another-video-demo/]<br />
More info & Video: [http://confreaks.net/videos/637-gogaruco2011-kidsruby-think-of-the-children?player=html5 http://confreaks.net/videos/637-gogaruco2011-kidsruby-think-of-the-children?player=html5]<br />
<br />
==Meego MER & XBMC==<br />
<br />
The MeeGo MER project provides a Linux-based, open source software platform for the next generation of computing devices. The MeeGo MER software platform is designed to give developers the broadest range of device segments to target for their applications, including netbooks, handheld computing and communications devices, in-vehicle infotainment devices, smart TVs, tablets and more – all using a uniform set of APIs based on Qt. XBMC is an award-winning free and open source (GPL) software media player and entertainment hub for digital media. Meego TV 1.2 uses XBMC as a reference GUI (that is, a starting point for creating a custom GUI).<br />
<br />
* [http://www.madeo.co.uk/?p=783 http://www.madeo.co.uk/?p=783]<br />
* [http://www.madeo.co.uk/?page_id=605 http://www.madeo.co.uk/?page_id=605]<br />
* [http://wiki.meego.com/User:Vgrade#Raspberry_Pi http://wiki.meego.com/User:Vgrade#Raspberry_Pi]<br />
* [http://wiki.merproject.org/wiki/Community_Workspace/RaspberryPi http://wiki.merproject.org/wiki/Community_Workspace/RaspberryPi]<br />
* [https://github.com/xbmc/xbmc-rbp https://github.com/xbmc/xbmc-rbp]<br />
<br />
==Puppy==<br />
<br />
Puppy Linux is designed to be a small tiny Linux distribution (<100MB). One distro version of Puppy for ARM is [http://distro.ibiblio.org/quirky/arm/test/raspi-sap-5.95-alpha1/sap-5.95-alpha1-readme.htm SAP6 Debian6 armel binaries] and another [http://puppylinux.org/wikka/PuppiPlan PuppiPlan] all under the [http://puppylinux.org/wikka/PARM Puppy] initiative. [http://en.wikipedia.org/wiki/Puppy_Linux Puppy Linux] is going back to his roots. Designed to run from 256MB ram. Making every bit count. Join the [http://www.murga-linux.com/puppy/viewtopic.php?p=526#526 Puppy geek adventure] for 2012. Woof Woof<br />
<br />
== OpenWrt ==<br />
<br />
OpenWrt is described as a Linux distribution for embedded devices. The Rpi is now supported by the Attitude Adjustment (12.09-beta) release available here:<br />
<br />
http://downloads.openwrt.org/attitude_adjustment/12.09-beta/brcm2708/generic/<br />
<br />
OpenWrt Wiki for R_pi<br />
http://wiki.openwrt.org/toh/raspberry_pi<br />
<br />
Related links:<br />
<br />
* http://www.zoobab.com/raspberry-pi-openwrt<br />
* http://thread.gmane.org/gmane.comp.embedded.openwrt.devel/14815<br />
* [https://forum.openwrt.org/viewtopic.php?pid=173937#p173937 openWRT Thread ] about Raspberry Pi status<br />
<br />
== RPi-Buildroot ==<br />
<br />
RPi-Buildroot is a set of Makefiles and patches that make it easy to generate a complete customized embedded Linux system for your Raspberry Pi. This distro is based on [http://buildroot.uclibc.org/ Buildroot] so it's perfect for somebody looking to build a trimmed down or task-specific system.<br />
<br />
Please note that this distro is intended for '''advanced users'''.<br />
<br />
*[https://github.com/gamaral/rpi-buildroot/blob/rpi/README.md More Information]<br />
*[https://github.com/gamaral/rpi-buildroot/ Git Repository]<br />
*[http://guillermoamaral.com/read/rpi-buildroot/ Test-drive SD card images and toolchain]<br />
*[http://guillermoamaral.com/read/mes/ Marshmallow Entertainment System]<br />
<br />
==Aros Hosted on Linux==<br />
<br />
[http://www.aros.org Aros] is an open source Amiga like operating system (OS) at the api level. This version runs as a task under Linux to take advantage of the drivers available inside the GNU Linux OS core. <br />
<br />
Related links<br />
<br />
*http://amigaworld.net/modules/newbb/viewtopic.php?topic_id=35843&forum=48<br />
*http://www.raspberrypi.org/archives/tag/aros<br />
*[http://www.youtube.com/results?search_query=raspberry+pi+aros&oq=raspberry+pi+aros&gs_l=youtube.3..0.614.4729.0.4969.11.9.0.0.0.0.370.1872.1j4j2j2.9.0...0.0...1ac.1.m-tiINLoemg Youtube videos]<br />
*http://www.amiga.org/forums/archive/index.php/t-62135.html<br />
<br />
<br />
=Other Distributions=<br />
<br />
These are other popular distributions that are often asked about for Raspberry Pi but are not available.<br />
<br />
==GeeXboX ARM==<br />
<br />
GeeXboX is a free and Open Source Media-Center purposed Linux distribution for embedded devices and desktop computers. GeeXboX is not an application, it’s a full-featured OS, that one can boot as a LiveCD, from a USB key, an SD/MMC card or install on its regular HDD. The GeeXboX distribution is lightweight and designed for one single goal: embed all major multimedia applications as to turn your computer into an HTPC.<br />
<br />
[http://www.geexbox.org/category/arm/ http://www.geexbox.org/category/arm/]<br />
<br />
==Ubuntu==<br />
<br />
[http://www.ubuntu.com/ Ubuntu] was initially planned to be the default distribution, but the current version of Ubuntu only supports ARMv7 onwards, not the ARMv6 architecture used by the Raspberry Pi's processor. Therefore Ubuntu does not work on Raspberry Pi, and there is no further information about this changing in the near future.<br />
<br />
A bug report on this subject was submitted to Ubuntu's bug tracker. The responses to that bug include an unofficial viewpoint from a Canonical employee, outlining the amount of work required to support ARMv6 (and therefore, potentially, Raspberry Pi). See [https://bugs.launchpad.net/ubuntu/+bug/848154 Bug 848154]<br />
<br />
[https://wiki.ubuntu.com/ARM https://wiki.ubuntu.com/ARM]<br />
<br />
=References= <br />
<references/><br />
<br />
{{Template:Raspberry Pi}}<br />
[[Category:RaspberryPi]]</div>Gamaral