Differences between revisions 60 and 75 (spanning 15 versions)
Revision 60 as of 2020-12-14 08:30:46
Size: 11338
Editor: ?TimKenHan
Comment:
Revision 75 as of 2021-06-28 09:17:28
Size: 9922
Editor: ZugSchlus
Comment: move the Overclocking chapter to RaspberryPi2
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
<<TableOfContents(3)>> <<TableOfContents(4)>>
Line 11: Line 11:
All Raspberry Pi models before the 4 (1A, 1B, 1A+, 1B+, Zero, Zero W, 2, 3) boot from their GPU (not from the CPU!), so they require a non-free binary blob to boot. This binary blob is available in the non-free Debian repository, packaged as the [[https://tracker.debian.org/pkg/raspi-firmware|raspi-firmware]] package (or raspi3-firmware until Debian 10). All Raspberry Pi models before the 4 (1A, 1B, 1A+, 1B+, Zero, Zero W, 2, 3) boot from their GPU (not from the CPU!), so they require a non-free binary blob to boot. This binary blob is available in the non-free Debian repository, packaged as the DebianPackage:raspi-firmware package (or DebianPackage:raspi3-firmware until Debian 10).
Line 13: Line 13:
=== Debian and Raspbian === === Raspberry Pi OS (formerly Raspbian) and Debian ===
Line 15: Line 15:
The most often used distribution across all raspberries is [[http://www.raspbian.org/|Raspbian]] (also known as Raspberry Pi OS). This is, first of all, for historical reasons (booting a mainline Linux kernel was not supported on Raspberries until late 2018), but also because of other non-free components that are shipped as part of Raspbian (such as Oracle Java and Wolfram Mathematica). The most often used distribution across all raspberries is [[https://www.raspberrypi.org/software/|Raspberry Pi OS]] (originally known as ''Raspbian''), a derivative of Debian. This is, first of all, for historical reasons (booting a mainline Linux kernel was not supported on Raspberries until late 2018), but also because of other non-free components that are shipped as part of Raspberry Pi OS (such as Oracle Java, Wolfram Mathematica, and several games such as a Pi-specific Minecraft version).
Line 17: Line 17:
Raspbian builds a single image for all of the Raspberry families, so you will get an [[ArmHardFloatPort|armhf]] 32-bit, hard floating-point system, but built for the ARMv6 ISA (with VFP2), unlike Debian's ARMv7 ISA (with VFP3) port. Raspberry Pi OS builds a single image for all of the Raspberry families, so you will get an [[ArmHardFloatPort|armhf]] 32-bit, hard floating-point system, but built for the ARMv6 ISA (with VFP2), unlike Debian's ARMv7 ISA (with VFP3) port.
Line 19: Line 19:
Raspbian is ''not'' affiliated with the Debian project, although it derives from it. You can also run regular Debian on your Raspberries! (keep reading...) Raspberry Pi OS is ''not'' affiliated with the Debian project, although it derives from it. You can also run regular Debian on your Raspberries! (keep reading...)
Line 21: Line 21:
=== Raspberry Pi 1 (A, B, A+, B+, Zero, Zero W) === === Raspberry Pi Models ===
Line 23: Line 23:
The systems now known as Raspberry Pi model 1 models A and B were announced in February 2012. This family was expanded by very similar models A+ and B+. In 2015, the Zero model was announced, using the same CPU as the 1 family but with a smaller form factor, followed by the Zero W, which adds wireless connectivity. ==== Raspberry Pi 4 and Raspberry Pi 400 ====
Line 25: Line 25:
The first generation Raspberry systems work using [[ArmEabiPort|Debian armel]].
The Raspberry Pi 1's processor falls uncomfortably between the processor families that Debian has chosen to target, between [[ArmEabiPort|armel]] and [[ArmHardFloatPort|armhf]]. While Raspbian solves this to some degree an unofficial port will always give less certainty than an official one.
Announced in 2019, this system adds a second HDMI port, more memory, true Gigabit Ethernet and USB3. [[https://raspi.debian.net/tested-images/|RPi4 SD card images became available]], combining Debian 10 and a kernel from ''backports''.
Line 28: Line 27:
The Zero uses the same SoC/CPU as the first version, so they should function identically. More technical details about Raspberry Pi 4 support are available on the [[RaspberryPi4]] page.
Line 30: Line 29:
=== Raspberry Pi 2 === ===== Raspberry Pi 400 =====

The Raspberry Pi 400, announced in November 2020, is quite similar to the Raspberry Pi 4 B models. Pi 4 images work on the Pi 400, although a different DTB (not yet available/mainlined as of Linux 5.10) is needed for some hardware support, i.e. for WiFi connectivity.

==== Raspberry Pi 3 (3, 3A+, 3B+) ====

The Raspberry Pi 3 was announced in 2016, and is the first 64-bit member of the family. Some models include wireless connectivity. This family will work with [[Arm64Port|Debian arm64]]. For further details and information on how to run with this hardware, go to the RaspberryPi3 page.

==== Raspberry Pi 2 ====
Line 38: Line 45:
=== Raspberry Pi 3 (3, 3A+, 3B+) === ==== Raspberry Pi 1 (A, B, A+, B+, Zero, Zero W) ====
Line 40: Line 47:
The Raspberry Pi 3 was announced in 2016, and is the first 64-bit member of the family. Some models include wireless connectivity. This family will work with [[Arm64Port|Debian arm64]]. For further details and information on how to run with this hardware, go to the RaspberryPi3 page. The systems now known as Raspberry Pi model 1 models A and B were announced in February 2012. This family was expanded by very similar models A+ and B+. In 2015, the Zero model was announced, using the same CPU as the 1 family but with a smaller form factor, followed by the Zero W, which adds wireless connectivity.
Line 42: Line 49:
=== Raspberry Pi 4 and Raspberry Pi 400 === The first generation Raspberry systems work using [[ArmEabiPort|Debian armel]].
The Raspberry Pi 1's processor falls uncomfortably between the processor families that Debian has chosen to target, between [[ArmEabiPort|armel]] and [[ArmHardFloatPort|armhf]]. While Raspberry Pi OS solves this to some degree an unofficial port will always give less certainty than an official one.
Line 44: Line 52:
Announced in 2019, this system adds a second HDMI port, more memory, true Gigabit Ethernet and USB3. [[https://raspi.debian.net/tested-images/|RPi4 SD card images became available]], combining Debian 10 and a kernel from ''backports''.

Known problems are
 * DebianBug:968188 4K display resolution is not recognized with Raspberry Pi 4B
 * DebianBug:968181 DRM unavailable on Rapsberry Pi 4B
 
More technical details about Raspberry Pi 4 support are available on the [[RaspberryPi4]] page.

The Raspberry Pi 400, announced in November 2020, is extremely similar to the Raspberry Pi 4 B models. What works on the Pi 4 B models also works on the Pi 400.
The Zero uses the same SoC/CPU as the first version, so they should function identically.
Line 64: Line 64:
 * A binary blob used by the GPU must be present on the SD card for the system to boot.  * All models before the Raspberry Pi 4 boot from the GPU. This needs a binary blob used by the GPU present on the boot medium for the system to boot. 2021-06, the binary blob for the GPU is non-free. Even starting the machine requires a large (2MB) blob of non-free, unsupportable software. (Editor Question: isnt this also true for the 4?)
Line 68: Line 68:
A number of similar boards are available, generally at slightly higher prices but also usually with more powerful processors. Some examples are given below, more can be found in the CheapServerBoxHardware list. Other issues:
 * The 3D driver for the Raspberry Pi, while Free Software, is just a shim that passes OpenGL commands directly to the non-free software running on the GPU (does this also apply for the vc4 driver in the Raspi 4?). This means that any issues with OpenGL cannot be fixed nor performance improved. This is better than some other GPUs because the ARM part can be rebuilt. More recently (when?) an alternative driver (what's the name of that driver?) has become available that drives the 3D core in the GPU directly from the ARM rather than passing messages to the VPU core in the GPU which in turn drove the 3D core.
 * The CPU in the Raspberry Pi 1 and Zero implements the ARMv6 ISA (with VFP2) and is thus incompatible with the Debian armhf port baseline of ARMv7+VFP3 and ARM hardware-floating-point ports for other distributions, which all have the same baseline. It is compatible with Debian armel (armv4t, soft(emulated) FP), but floating-point tasks will be slow when running the Debian armel port. (This doesn't stand for newer families)
Line 70: Line 72:
 * [[http://www.hardkernel.com/main/products/prdt_info.php|ODROID-C1]] Amlogic S805 (4× Cortex-A5 @ 1.5 GHz, Mali-450), $35 (most directly Pi-alike)
 * [[CubieBoard|Cubieboard]] Allwinner A10 (Cortex A8, Mali400), $49
 * [[https://en.wikipedia.org/wiki/Banana_Pi|Banana Pi]] Allwinner A20 1GHz ARM Cortex-A7 Dual-Core, Pi-like improved, $45
 * [[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/|Olimex OLinuxIno WIFI]] Cortex A8, €55
 * [[http://rhombus-tech.net/|EOMA68 modules]] (Sampling March 2013, so not in full production yet), Allwinner A10 (Cortex A8, Mali400)
 * [[http://beagleboard.org/bone|Beaglebone black]] omap3, $45
 * [[https://www.olimex.com/Products/OLinuXino/iMX233/iMX233-OLinuXino-MINI/|OlinuxIno Mini]] imx233 (ARM926, i.e Debian armel), €35

== Raspberry Pi issues ==

The Raspberry Pi issues relate to technical problems, software freedom and hype:

 * The CPU in the Raspberry Pi 1 and Zero implements the ARMv6 ISA (with VFP2) and is thus incompatible with the Debian armhf port baseline of ARMv7+VFP3 and ARM hardware-floating-point ports for other distributions, which all have the same baseline. It is compatible with Debian armel (armv4t, soft(emulated) FP), but floating-point tasks will be slow when running the Debian armel port. (This doesn't stand for newer families)
 * The Raspberry Pi (all models before the 4) boots from its GPU and only non-free software is currently available for the GPU, even starting the machine requires a large (2MB) blob of non-free, unsupportable software
 * The 3D driver for the Raspberry Pi, while Free Software, is just a shim that passes OpenGL commands directly to the non-free software running on the GPU. This means that any issues with OpenGL cannot be fixed nor performance improved. This is better than some other GPUs because the ARM part can be rebuilt. More recently an alternative driver has become available that drives the 3D core in the GPU directly from the ARM rather than passing messages to the VPU core in the GPU which in turn drove the 3D core.
A number of similar boards are available, generally at slightly higher prices but also usually with more powerful processors. Some examples can be found in the CheapServerBoxHardware list.
Line 88: Line 76:
The binary blob needed to boot the Raspberry Pi can be downloaded using the rpi-update script available from https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update and has been packaged as [[https://tracker.debian.org/pkg/raspi3-firmware|raspi3-firmware]] in the non-free repository of Debian (but should soon be renamed to just ''raspi-firmware'', as it's not model-3-specific). It can be used with vmdebootstrap to create a bootable SD card image, according to
[[http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html|a recipe from Petter Reinholdtsen]].
The binary blob needed to boot the Raspberry Pi can be downloaded using the rpi-update script available from https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update and has been packaged as DebianPackage:raspi-firmware in the non-free repository of Debian bullseye. It can be used with vmdebootstrap to create a bootable SD card image, according to
[[http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html|a recipe from Petter Reinholdtsen]]. In Debian buster, the Raspberry Pi firmware package is called DebianPackage:raspi3-firmware.
Line 91: Line 79:
See more information at this independent documentation project based on a combination of static analysis
and trial and error on real hardware: https://github.com/hermanhermitage/videocoreiv/
There is an independent documentation project based on a combination of static analysis and trial and error on real hardware available on https://github.com/hermanhermitage/videocoreiv/, but this has not seen any progress since early 2019 (2021-06).
Line 94: Line 81:
Broadcom publicly released some code, licensed as 3-Clause BSD, to aid the making of an open source GPU driver.
The [[https://github.com/christinaa/rpi-open-firmware|"rpi-open-firmware"]] effort to replace the VPU firmware blob started in 2016. See more at https://news.ycombinator.com/item?id=11703842
Unfortunately development of rpi-open-firmware is currently [[https://github.com/christinaa/rpi-open-firmware/issues/37|stalled]].
Since then, Broadcom publicly released some code, licensed as 3-Clause BSD, to aid the making of an open source GPU driver.
The [[https://github.com/christinaa/rpi-open-firmware|"rpi-open-firmware"]] effort to replace the VPU firmware blob started in 2016. See more at https://news.ycombinator.com/item?id=11703842 .
Unfortunately development of rpi-open-firmware is currently (2021-06) [[https://github.com/christinaa/rpi-open-firmware/issues/37|stalled]].
Line 98: Line 85:
A [[https://github.com/librerpi/rpi-open-firmware|revival attempt]] seems to be underway. A [[https://github.com/librerpi/rpi-open-firmware|revival attempt]] seems to be underway (2021-06).
Line 104: Line 91:

(Editor's Question 2021-06: This seems to be unnecessary when using the Tested Debian Images from raspi.debian.net, is this still current information?)
Line 121: Line 110:
== Overclocking Pi 2 ==

Overclocking is quite easy and convenient, and doesn't invalidate your warranty if you don't change voltage.
It happens that the actual L2 speed of the Raspberry Pi 2 is severelly underclocked, making the device much more slower that it should actually be. There has been reports of users using ''overclocked'' speeds of the processor and the L2 for months without a single issue, but you must be carefull in respecting a good proportion between L2 speed and processor, and overclocking the RAM is generally not recommended.

Try this setting, it has demonstrated to be stable and doubles the speed of this small machine in general. Edit {{{/boot/config.txt}}} and substitute or add these lines:{{{
arm_freq=1000
core_freq=500
sdram_freq=400
over_voltage=0
over_voltage_sdram_p=0
over_voltage_sdram_i=0
over_voltage_sdram_c=0
}}}

Unfortunatelly, the options shown when running {{{raspi-config}}} are not quite stable even they are slower than this recommended option.

Can I put Debian on my Raspberry Pi?

Yes. To quickly get a ready-to-use image, visit RaspberryPiImages. To know more, please read on.

Booting via a binary blob

All Raspberry Pi models before the 4 (1A, 1B, 1A+, 1B+, Zero, Zero W, 2, 3) boot from their GPU (not from the CPU!), so they require a non-free binary blob to boot. This binary blob is available in the non-free Debian repository, packaged as the raspi-firmware package (or raspi3-firmware until Debian 10).

Raspberry Pi OS (formerly Raspbian) and Debian

The most often used distribution across all raspberries is Raspberry Pi OS (originally known as Raspbian), a derivative of Debian. This is, first of all, for historical reasons (booting a mainline Linux kernel was not supported on Raspberries until late 2018), but also because of other non-free components that are shipped as part of Raspberry Pi OS (such as Oracle Java, Wolfram Mathematica, and several games such as a Pi-specific Minecraft version).

Raspberry Pi OS builds a single image for all of the Raspberry families, so you will get an armhf 32-bit, hard floating-point system, but built for the ARMv6 ISA (with VFP2), unlike Debian's ARMv7 ISA (with VFP3) port.

Raspberry Pi OS is not affiliated with the Debian project, although it derives from it. You can also run regular Debian on your Raspberries! (keep reading...)

Raspberry Pi Models

Raspberry Pi 4 and Raspberry Pi 400

Announced in 2019, this system adds a second HDMI port, more memory, true Gigabit Ethernet and USB3. RPi4 SD card images became available, combining Debian 10 and a kernel from backports.

More technical details about Raspberry Pi 4 support are available on the RaspberryPi4 page.

Raspberry Pi 400

The Raspberry Pi 400, announced in November 2020, is quite similar to the Raspberry Pi 4 B models. Pi 4 images work on the Pi 400, although a different DTB (not yet available/mainlined as of Linux 5.10) is needed for some hardware support, i.e. for WiFi connectivity.

Raspberry Pi 3 (3, 3A+, 3B+)

The Raspberry Pi 3 was announced in 2016, and is the first 64-bit member of the family. Some models include wireless connectivity. This family will work with Debian arm64. For further details and information on how to run with this hardware, go to the RaspberryPi3 page.

Raspberry Pi 2

The second generation systems were announced on 2014. The only member of this family is the Raspberry Pi 2.

Second-generation raspberries (model 2 only) works with Debian armhf will work.

You can refer to the RaspberryPi2 page, which aims to collect more detailed information how to run Debian nicely on this hardware.

Raspberry Pi 1 (A, B, A+, B+, Zero, Zero W)

The systems now known as Raspberry Pi model 1 models A and B were announced in February 2012. This family was expanded by very similar models A+ and B+. In 2015, the Zero model was announced, using the same CPU as the 1 family but with a smaller form factor, followed by the Zero W, which adds wireless connectivity.

The first generation Raspberry systems work using Debian armel. The Raspberry Pi 1's processor falls uncomfortably between the processor families that Debian has chosen to target, between armel and armhf. While Raspberry Pi OS solves this to some degree an unofficial port will always give less certainty than an official one.

The Zero uses the same SoC/CPU as the first version, so they should function identically.

Should I buy a Raspberry Pi?

That is a decision that you will have to make given your application, below are some pros and cons that you should consider.

Pros:

  • Large and active community
  • Low price for the capabilities offered

Cons:

  • 3D acceleration is not integrated with X or other standard mechanisms. Therefore 3D applications will currently require Pi specific builds. As of November 2020, there is work in progress to integrate it into both the Linux kernel and Mesa for the Raspberry Pi 4.
  • All models before the Raspberry Pi 4 boot from the GPU. This needs a binary blob used by the GPU present on the boot medium for the system to boot. 2021-06, the binary blob for the GPU is non-free. Even starting the machine requires a large (2MB) blob of non-free, unsupportable software. (Editor Question: isnt this also true for the 4?)
  • While some hardware documentation has been released the documentation is sorely lacking.
  • While schematics are available the board design is closed and the main processor is not available for purchase by the general public.

Other issues:

  • The 3D driver for the Raspberry Pi, while Free Software, is just a shim that passes OpenGL commands directly to the non-free software running on the GPU (does this also apply for the vc4 driver in the Raspi 4?). This means that any issues with OpenGL cannot be fixed nor performance improved. This is better than some other GPUs because the ARM part can be rebuilt. More recently (when?) an alternative driver (what's the name of that driver?) has become available that drives the 3D core in the GPU directly from the ARM rather than passing messages to the VPU core in the GPU which in turn drove the 3D core.
  • The CPU in the Raspberry Pi 1 and Zero implements the ARMv6 ISA (with VFP2) and is thus incompatible with the Debian armhf port baseline of ARMv7+VFP3 and ARM hardware-floating-point ports for other distributions, which all have the same baseline. It is compatible with Debian armel (armv4t, soft(emulated) FP), but floating-point tasks will be slow when running the Debian armel port. (This doesn't stand for newer families)

A number of similar boards are available, generally at slightly higher prices but also usually with more powerful processors. Some examples can be found in the CheapServerBoxHardware list.

Binary blob needed to boot

The binary blob needed to boot the Raspberry Pi can be downloaded using the rpi-update script available from https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update and has been packaged as raspi-firmware in the non-free repository of Debian bullseye. It can be used with vmdebootstrap to create a bootable SD card image, according to a recipe from Petter Reinholdtsen. In Debian buster, the Raspberry Pi firmware package is called raspi3-firmware.

There is an independent documentation project based on a combination of static analysis and trial and error on real hardware available on https://github.com/hermanhermitage/videocoreiv/, but this has not seen any progress since early 2019 (2021-06).

Since then, Broadcom publicly released some code, licensed as 3-Clause BSD, to aid the making of an open source GPU driver. The "rpi-open-firmware" effort to replace the VPU firmware blob started in 2016. See more at https://news.ycombinator.com/item?id=11703842 . Unfortunately development of rpi-open-firmware is currently (2021-06) stalled.

A revival attempt seems to be underway (2021-06).

QEMU User Emulation for Raspberry Pi Development

See RaspberryPi/qemu-user-static for information on how you can mount, edit, and run a Raspberry Pi disk image on a host Debian machine using QemuUserEmulation (much faster/simpler than than full system emulation)

Initramfs

(Editor's Question 2021-06: This seems to be unnecessary when using the Tested Debian Images from raspi.debian.net, is this still current information?)

Initramfs for custom loading of modules at boot does work, but you must update it everytime you use rpi-update, this way:

mkinitramfs -o /boot/initrd

In the Raspberry Pi 2 you must also include this in /boot/config.txt:

initramfs initrd followkernel
ramfsfile=initrd
ramfsaddr=-1

And this is /boot/cdmline.txt:

root=/dev/mmcblk0p2 initrd=-1 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 elevator=deadline rootwait

Because rpi-update is not the official way that Debian updates the Initramfs, you may find weird things happening when you update rpi, so if your system becomes unbootable because there is a needed module in the initrd that you need (like encryption), you must boot with another up to date sdcard, chroot into the new environment, mounting first /boot and /dev, and then update the initrd manually. This just happens because of the privative special way of booting of the Raspberry Pi, out of any reasonable standard.

Giving more power to the USB devices

If you are running a lot of devices, you may need a lot of power. Actually, the Pi 2 can give up to 1.2A to the devices, but it is severely limited by default to 600mA, so if you connect a lot of devices, they are going to be reseting themselves or limiting in some ways because of lack of energy. There is an option to actually double the amount of energy you can give to the devices, but you must also use a good 2A adapter. Just edit /boot/config.txt and add this:

max_usb_current=1
safe_mode_gpio=4

This way I am able to run a very energy consuming 4G modem and a Wifi dongle at the same time without issues.

Also, you not only need a good and reliable adapter, but also a good cable. The shorter and thicker the better.