Difference between revisions of "Raspberry Pi"

From ArchWiki
Jump to: navigation, search
(Installation: rm)
m
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{delete|Archlinuxarm is a seperate project.  The lead dev for alarm does not support this page.}}
 
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
 +
{{Article summary start}}
 +
{{Article summary text|Raspberry Pi is a minimalist computer built for the [[Wikipedia:ARMv6|ARMv6 architecture]]. [http://www.raspberrypi.org/ More information about this project] and [http://uk.farnell.com/raspberry-pi technical specification].}}
 +
{{Article summary heading|Related}}
 +
{{Article summary wiki|Beginners%27_Guide}} - This article is not meant to be an exhaustive setup guide and assumes that the reader has setup an Arch system before. Arch newbies are encouraged to read the Beginners'_Guide if unsure how to preform standard tasks such as creating users, managing the system, etc.
 +
[http://elinux.org/RPiconfig RPi Config] - Excellent source of info relating to under-the-hood tweaks.
 +
 +
[http://elinux.org/RPI_vcgencmd_usage RPi vcgencmd usage] - Overview of firmware command vcgencmd.
 +
{{Article summary end}}
 +
 +
== Article Preface ==
 
{{Note|Support for the ARM architecture is provided on http://archlinuxarm.org/ }}
 
{{Note|Support for the ARM architecture is provided on http://archlinuxarm.org/ }}
 +
{{Note|Posts to the official Arch Linux Forum related to ARM specific issues will be promptly closed.}}
  
How mature is Raspberry Pi (RPI). A brief overview.
+
== Installing Arch Linux ARM ==
  
== What is Raspberry Pi ==
+
See the [http://archlinuxarm.org/platforms/armv6/raspberry-pi#qt-platform_tabs-ui-tabs2 archlinuxarm documentation].
  
It is a minimalist computer built for ARMv6 architecture. [http://www.raspberrypi.org/ More information about this project] and [http://uk.farnell.com/raspberry-pi technical specification].
+
== Audio ==
 +
{{Note| The requisite module '''snd-bcm2835''' should be autoloaded by default.}}
  
== Installing Arch Linux ARM ==
+
Install the needed packages:
 +
pacman -S alsa-utils alsa-firmware alsa-lib alsa-plugins
  
In this manual will describe only essential moments for different RPI. Other procedures are the same instructions for ArchLinux. The only exception is the basic initialization and installation of equipment. It is further assumed that the configuration is performed on a machine running Archlinux.
+
Optionally adjust the default volume using `alsamixer` and ensure that the sole source "PCM" is not muted (denoted by double MM if muted).
  
=== Backup Cards ===
+
Select an audio source for output:
If you own an official card provided with your RPI ([http://uk.farnell.com/samsung/raspberry-pi-prog-4gb-sdcard/memory-sdcard-raspberry-pi-4gb/dp/2113756 for example]) recommend before installing Arch ARM Linux to backup using {{ic|dd}}. The path must be specified to the device {{ic|/dev/sdX}} not for another partition {{ic|/dev/sdc1}}
+
amixer cset numid=3 x
  
# dd if=/dev/sdX of=$HOME/backup_RPi.img
+
Where 'x' corresponds to:
 +
*0 for Auto
 +
*1 for Headphones
 +
*3 for HDMI
  
{{Note | There is a bit copy of the card. The resulting file is the same size as your card.}}
+
=== Caveats for HDMI Audio ===
{{Note | card may not be installed.}}
+
Some applications require a setting in {{ic|/boot/config.txt}} to force audio over HDMI:
{{Warning | Bad parameters can damage your data.}}
+
hdmi_drive=2
  
=== Installation ===
+
== Onboard Hardware Sensors ==
 +
=== Temperature ===
 +
Temperatures sensors for the board itself are including as part of the '''raspberrypi-firmware-tools''' package.  the RPi offers a sensor of the BCM2835 SoC (CPU/GPU):
  
Installation is similar to backing card. Download the image file from [http://archlinuxarm.org/platforms/armv6/raspberry-pi Arch Linux ARM]
+
/opt/vc/bin/vcgencmd measure_temp
 +
temp=49.8'C
  
  # dd bs=1M if=/path/to/archlinux.img of=/dev/sdX
+
Alternatively, simply read from the filesystem:
 +
  % cat /sys/class/thermal/thermal_zone0/temp               
 +
49768
  
After inserting the card into the slot on the PPi should boot the base system Arch Linux ARM.
+
=== Voltage ===
 +
Four different voltages can be monitored via {{ic|/opt/vc/bin/vcgencmd}} as well:
  
=== Home ===
+
% /opt/vc/bin/vcgencmd measure_volts <id>
  
The downloaded image file is approximately 2 gigabytes of which is /boot 94 megabytes and / 1.8 gigabytes. If you used a larger card to 2GB, so I recommend the rest of the card to connect as /home (or /usr). Clearance must be formatted using the example [[Gparted]]. At the first possible opportunity (after booting RPI or after mounting the card in the computer) need to be adjusted {{ic | /etc/fstab}}
+
*core for core voltage
 +
*sdram_c for sdram Core voltage
 +
*sdram_i for sdram I/O voltage
 +
*sdram_p for sdram PHY voltage
  
# sudo vim /etc/fstab
+
== Overclocking/Underclocking ==
 +
The Raspberry Pi can be overclocked by editing {{ic|/boot/config.txt}}, for example:
 +
 +
arm_freq=800
 +
arm_freq_min=100
 +
core_freq=300
 +
core_freq_min=75
 +
sdram_freq=400
 +
over_voltage=0
  
For example, add
+
The optional xxx_min lines define the min usage of their respective settings.  When the system is not under load, the values will drop down to those specified.  Consult the [[http://elinux.org/RPiconfig#Overclocking Overclocking]] article on elinux for additional options and examples.
  
/dev/mmcblk0p3 /home ext4 defaults 0 0
+
A reboot is needed for new settings to take effect.
  
== Video ==
+
{{Note|The overclocked setting for CPU clock applies only when the governor throttles up the CPU, i.e. under load.}}
  
The generic {{pkg|xf86-video-fbdev}} driver can be used.
+
Users may query the current frequency of the CPU via this command:
 +
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
  
 
== Serial Console ==
 
== Serial Console ==
Line 48: Line 81:
  
 
Change loglevel to 5 to see boot messages
 
Change loglevel to 5 to see boot messages
  # loglevel=5
+
  loglevel=5
  
Change speed from 11520 to 38400
+
Change speed from 115200 to 38400
  # console=ttyAMA0,38400 kgdboc=ttyAMA0,38400
+
  console=ttyAMA0,38400 kgdboc=ttyAMA0,38400
  
 
Start getty service
 
Start getty service
  # systemctl start getty@ttyAMA0
+
  systemctl start getty@ttyAMA0
  
 
Enable on boot
 
Enable on boot
  #systemctl enable getty@ttyAMA0.service
+
  systemctl enable getty@ttyAMA0.service
  
 
Creating the proper service link:
 
Creating the proper service link:
  # ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyAMA0.service
+
  ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyAMA0.service
  
 
Then connect :)
 
Then connect :)
  # screen /dev/ttyUSB0 38400
+
  screen /dev/ttyUSB0 38400
 +
 
 +
== Video ==
 +
pacman -S xf86-video-fbdev
 +
 
 +
Adjustments are likely required to correct proper overscan/underscan and are easily achieved in {{ic|boot/config.txt}} in which many tweaks are set.  To fix, simply uncomment the corresponding lines and setup per the commented instructions:
 +
 
 +
# uncomment the following to adjust overscan. Use positive numbers if console
 +
# goes off screen, and negative if there is too much border
 +
#overscan_left=16
 +
overscan_right=8
 +
overscan_top=-16
 +
overscan_bottom=-16
 +
 
 +
Users wishing to use the analog video out should consult [https://raw.github.com/Evilpaul/RPi-config/master/config.txt this] config file which contains options for non-NTSC outputs.
  
Referenced from these [http://www.raspberrypi.org/phpBB3/viewtopic.php?f=53&t=19186] posts [https://bbs.archlinux.org/viewtopic.php?id=144847]
+
A reboot is needed for new settings to take effect.

Revision as of 19:36, 8 April 2013

Summary help replacing me
Raspberry Pi is a minimalist computer built for the ARMv6 architecture. More information about this project and technical specification.
Related
Beginners'_Guide - This article is not meant to be an exhaustive setup guide and assumes that the reader has setup an Arch system before. Arch newbies are encouraged to read the Beginners'_Guide if unsure how to preform standard tasks such as creating users, managing the system, etc.

RPi Config - Excellent source of info relating to under-the-hood tweaks.

RPi vcgencmd usage - Overview of firmware command vcgencmd.

Article Preface

Note: Support for the ARM architecture is provided on http://archlinuxarm.org/
Note: Posts to the official Arch Linux Forum related to ARM specific issues will be promptly closed.

Installing Arch Linux ARM

See the archlinuxarm documentation.

Audio

Note: The requisite module snd-bcm2835 should be autoloaded by default.

Install the needed packages:

pacman -S alsa-utils alsa-firmware alsa-lib alsa-plugins

Optionally adjust the default volume using `alsamixer` and ensure that the sole source "PCM" is not muted (denoted by double MM if muted).

Select an audio source for output:

amixer cset numid=3 x

Where 'x' corresponds to:

  • 0 for Auto
  • 1 for Headphones
  • 3 for HDMI

Caveats for HDMI Audio

Some applications require a setting in /boot/config.txt to force audio over HDMI:

hdmi_drive=2

Onboard Hardware Sensors

Temperature

Temperatures sensors for the board itself are including as part of the raspberrypi-firmware-tools package. the RPi offers a sensor of the BCM2835 SoC (CPU/GPU):

/opt/vc/bin/vcgencmd measure_temp
temp=49.8'C

Alternatively, simply read from the filesystem:

% cat /sys/class/thermal/thermal_zone0/temp                
49768

Voltage

Four different voltages can be monitored via /opt/vc/bin/vcgencmd as well:

% /opt/vc/bin/vcgencmd measure_volts <id>
  • core for core voltage
  • sdram_c for sdram Core voltage
  • sdram_i for sdram I/O voltage
  • sdram_p for sdram PHY voltage

Overclocking/Underclocking

The Raspberry Pi can be overclocked by editing /boot/config.txt, for example:

arm_freq=800
arm_freq_min=100
core_freq=300
core_freq_min=75
sdram_freq=400
over_voltage=0

The optional xxx_min lines define the min usage of their respective settings. When the system is not under load, the values will drop down to those specified. Consult the [Overclocking] article on elinux for additional options and examples.

A reboot is needed for new settings to take effect.

Note: The overclocked setting for CPU clock applies only when the governor throttles up the CPU, i.e. under load.

Users may query the current frequency of the CPU via this command:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

Serial Console

Edit the default /boot/cmdline.txt

Change loglevel to 5 to see boot messages

loglevel=5

Change speed from 115200 to 38400

console=ttyAMA0,38400 kgdboc=ttyAMA0,38400

Start getty service

systemctl start getty@ttyAMA0

Enable on boot

systemctl enable getty@ttyAMA0.service

Creating the proper service link:

ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyAMA0.service

Then connect :)

screen /dev/ttyUSB0 38400

Video

pacman -S xf86-video-fbdev

Adjustments are likely required to correct proper overscan/underscan and are easily achieved in boot/config.txt in which many tweaks are set. To fix, simply uncomment the corresponding lines and setup per the commented instructions:

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
overscan_right=8
overscan_top=-16
overscan_bottom=-16

Users wishing to use the analog video out should consult this config file which contains options for non-NTSC outputs.

A reboot is needed for new settings to take effect.