You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/asciidoc/accessories/sense-hat.adoc
+9-3
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ Taken from this https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=109064&
64
64
65
65
Install the necessary software and run the calibration program as follows:
66
66
67
+
[,bash]
67
68
----
68
69
sudo apt update
69
70
sudo apt install octave -y
@@ -75,7 +76,7 @@ RTIMULibCal
75
76
76
77
You will then see this menu:
77
78
78
-
....
79
+
----
79
80
Options are:
80
81
81
82
m - calibrate magnetometer with min/max
@@ -84,7 +85,7 @@ Options are:
84
85
x - exit
85
86
86
87
Enter option:
87
-
....
88
+
----
88
89
89
90
Press lowercase `m`. The following message will then show; press any key to start.
90
91
@@ -101,8 +102,10 @@ Press lowercase `m`. The following message will then show; press any key to star
101
102
102
103
After it starts, you will see something similar to this scrolling up the screen:
103
104
105
+
----
104
106
Min x: 51.60 min y: 69.39 min z: 65.91
105
107
Max x: 53.15 max y: 70.97 max z: 67.97
108
+
----
106
109
107
110
Focus on the two lines at the very bottom of the screen, as these are the most recently posted measurements from the program.
108
111
Now you have to move the Astro Pi around in every possible way you can think of. It helps if you unplug all non-essential cables to avoid clutter.
@@ -115,8 +118,11 @@ In addition to those steps, you can also do the ellipsoid fit by performing the
115
118
116
119
When you're done, copy the resulting `RTIMULib.ini` to /etc/ and remove the local copy in `~/.config/sense_hat/`:
117
120
121
+
[,bash]
122
+
----
118
123
rm ~/.config/sense_hat/RTIMULib.ini
119
124
sudo cp RTIMULib.ini /etc
125
+
----
120
126
121
127
You are now done.
122
128
@@ -187,4 +193,4 @@ NOTE: These steps may not work on Raspberry Pi 2 Model B Rev 1.0 and Raspberry P
187
193
i2cset -y -f 1 0x46 0xf3 0
188
194
----
189
195
190
-
WARNING: Please note that this operation is potentially dangerous, and is not needed for the everyday user. The steps above are provided for debugging purposes only. If an error occurs, the HAT may no longer be automatically detected.
196
+
WARNING: Please note that this operation is potentially dangerous, and is not needed for the everyday user. The steps above are provided for debugging purposes only. If an error occurs, the HAT may no longer be automatically detected.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/config_txt/boot.adoc
+8-4
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,18 @@ These options specify the firmware files transferred to the VideoCore GPU prior
12
12
These provide a shortcut to some alternative `start_file` and `fixup_file` settings, and are the recommended methods for selecting firmware configurations.
13
13
14
14
`start_x=1` implies
15
-
`start_file=start_x.elf`
16
-
`fixup_file=fixup_x.dat`
15
+
----
16
+
start_file=start_x.elf
17
+
fixup_file=fixup_x.dat
18
+
----
17
19
18
20
On the Pi 4, if the files `start4x.elf` and `fixup4x.dat` are present, these files will be used instead.
19
21
20
22
`start_debug=1` implies
21
-
`start_file=start_db.elf`
22
-
`fixup_file=fixup_db.dat`
23
+
----
24
+
start_file=start_db.elf
25
+
fixup_file=fixup_db.dat
26
+
----
23
27
24
28
`start_x=1` should be specified when using the camera module. Enabling the camera via `raspi-config` will set this automatically.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/config_txt/conditional.adoc
+3-1
Original file line number
Diff line number
Diff line change
@@ -49,15 +49,17 @@ The conditional model filters are applied according to the following table.
49
49
50
50
These are particularly useful for defining different `kernel`, `initramfs`, and `cmdline` settings, as the Pi 1 and Pi 2 require different kernels. They can also be useful to define different overclocking settings, as the Pi 1 and Pi 2 have different default speeds. For example, to define separate `initramfs` images for each:
51
51
52
+
----
52
53
[pi1]
53
54
initramfs initrd.img-3.18.7+ followkernel
54
55
[pi2]
55
56
initramfs initrd.img-3.18.7-v7+ followkernel
56
57
[all]
58
+
----
57
59
58
60
Remember to use the `[all]` filter at the end, so that any subsequent settings aren't limited to Pi 2 hardware only.
59
61
60
-
It is important to note that the Raspberry Pi Zero W will see the contents of [pi0w] AND [pi0]. Likewise, a Raspberry Pi 3B Plus sees [pi3+] AND [pi3], and a Raspberry Pi 400 sees [pi400] AND [pi4]. If you want a setting to apply only to Pi Zero, Pi 3B or Pi 4B, you need to follow it (order is important) with a setting in the [pi0w], [pi3+] or [pi400] section that reverts it.
62
+
It is important to note that the Raspberry Pi Zero W will see the contents of `[pi0w]` AND `[pi0]`. Likewise, a Raspberry Pi 3B Plus sees `[pi3+]` AND `[pi3]`, and a Raspberry Pi 400 sees `[pi400]` AND `[pi4]`. If you want a setting to apply only to Pi Zero, Pi 3B or Pi 4B, you need to follow it (order is important) with a setting in the `[pi0w]`, `[pi3+]` or `[pi400]` section that reverts it.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/configuration/device-tree.adoc
+3-3
Original file line number
Diff line number
Diff line change
@@ -234,7 +234,7 @@ It is interesting to dump the contents of the DTB file to see what the compiler
234
234
235
235
[,console]
236
236
----
237
-
$ fdtdump 1st.dtbo
237
+
fdtdump 1st.dtbo
238
238
/dts-v1/;
239
239
// magic: 0xd00dfeed
240
240
// totalsize: 0x207 (519)
@@ -732,10 +732,10 @@ There are some new commands for managing overlays:
732
732
[[part3.5.1]]
733
733
===== The `dtoverlay` command
734
734
735
-
`dtoverlay` is a command line utility that loads and removes overlays while the system is running, as well as listing the available overlays and displaying their help information:
735
+
`dtoverlay` is a command line utility that loads and removes overlays while the system is running, as well as listing the available overlays and displaying their help information.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/linux_kernel/configuring.adoc
+10-2
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,32 @@ Configuration is most commonly done through the `make menuconfig` interface. Alt
8
8
9
9
The `menuconfig` tool requires the `ncurses` development headers to compile properly. These can be installed with the following command:
10
10
11
-
$ sudo apt install libncurses5-dev
11
+
[,bash]
12
+
----
13
+
sudo apt install libncurses5-dev
14
+
----
12
15
13
16
You'll also need to download and prepare your kernel sources, as described in the xref:linux_kernel.adoc#choosing_sources[build guide]. In particular, ensure you have installed the xref:linux_kernel.adoc#default_configuration[default configuration].
14
17
15
18
=== Using `menuconfig`
16
19
17
20
Once you've got everything set up and ready to go, you can compile and run the `menuconfig` utility as follows:
18
21
19
-
$ make menuconfig
22
+
[,bash]
23
+
----
24
+
make menuconfig
25
+
----
20
26
21
27
If you're cross-compiling a 32-bit kernel:
22
28
29
+
[,bash]
23
30
----
24
31
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
25
32
----
26
33
27
34
Or, if you are cross-compiling a 64-bit kernel:
28
35
36
+
[,bash]
29
37
----
30
38
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/linux_kernel/headers.adoc
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ If you are compiling a kernel module or similar, you will need the Linux Kernel
4
4
5
5
If you have cloned the entire kernel from github, the headers are already included in the source tree. If you don't need all the extra files, it is possible to install only the kernel headers from the Raspberry Pi OS repo.
6
6
7
-
[source]
7
+
[,bash]
8
8
----
9
-
$ sudo apt install raspberrypi-kernel-headers
9
+
sudo apt install raspberrypi-kernel-headers
10
10
----
11
11
12
12
NOTE: It can take quite a while for this command to complete, as it installs a lot of small files. There is no progress indicator.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/linux_kernel/patching.adoc
+11-12
Original file line number
Diff line number
Diff line change
@@ -6,44 +6,43 @@ Patchsets are often provided with newer hardware as a temporary measure, before
6
6
7
7
=== Version Identification
8
8
9
-
It's important to check what version of the kernel you have when downloading and applying patches. In a kernel source directory, the following command will show you the version the sources relate to:
9
+
It's important to check what version of the kernel you have when downloading and applying patches. In a kernel source directory, running `head Makefile -n 3` will show you the version the sources relate to:
10
10
11
11
[source]
12
12
----
13
-
$ head Makefile -n 3
14
13
VERSION = 3
15
14
PATCHLEVEL = 10
16
15
SUBLEVEL = 25
17
16
----
18
-
17
+
19
18
In this instance, the sources are for a 3.10.25 kernel. You can see what version you're running on your system with the `uname -r` command.
20
19
21
20
=== Applying Patches
22
21
23
22
How you apply patches depends on the format in which the patches are made available. Most patches are a single file, and applied with the `patch` utility. For example, let's download and patch our example kernel version with the real-time kernel patches:
In our example we simply download the file, uncompress it, and then pass it to the `patch` utility using the `cat` tool and a Unix pipe.
33
32
34
33
Some patchsets come as mailbox-format patchsets, arranged as a folder of patch files. We can use Git to apply these patches to our kernel, but first we must configure Git to let it know who we are when we make these changes:
35
34
36
-
[source]
35
+
[,bash]
37
36
----
38
-
$ git config --global user.name "Your name"
39
-
$ git config --global user.email "your email in here"
37
+
git config --global user.name "Your name"
38
+
git config --global user.email "your email in here"
40
39
----
41
40
42
41
Once we've done this we can apply the patches:
43
42
44
-
[source]
43
+
[,bash]
45
44
----
46
-
$ git am -3 /path/to/patches/*
45
+
git am -3 /path/to/patches/*
47
46
----
48
47
49
48
If in doubt, consult with the distributor of the patches, who should tell you how to apply them. Some patchsets will require a specific commit to patch against; follow the details provided by the patch distributor.
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/raspberry-pi/boot-net.adoc
+5-3
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,12 @@ If you put all your files into the root of your tftp directory then all followin
27
27
28
28
The first thing to check is that the OTP bit is correctly programmed. To do this, you need to add `program_usb_boot_mode=1` to config.txt and reboot (with a standard SD card that boots correctly into Raspberry Pi OS). Once you've done this, you should be able to do:
29
29
30
-
$ vcgencmd otp_dump | grep 17:
31
-
17:3020000a
30
+
[,bash]
31
+
----
32
+
vcgencmd otp_dump | grep 17:
33
+
----
32
34
33
-
If row 17 contains that value then the OTP is correctly programmed. You should now be able to remove the SD card, plug in Ethernet,
35
+
If row 17 contains `3020000a` then the OTP is correctly programmed. You should now be able to remove the SD card, plug in Ethernet,
34
36
and then the Ethernet LEDs should light up around 5 seconds after the Pi powers up.
35
37
36
38
To capture the ethernet packets on the server, use tcpdump on the tftpboot server (or DHCP server if they are different). You will need to capture the packets there otherwise you will not be able to see packets that get sent directly because network switches are not hubs!
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/raspberry-pi/bootmodes.adoc
+3-4
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,14 @@ For information on enabling the UART on the Pi4 bootloader, please see xref:rasp
22
22
23
23
It is possible to enable an early stage UART to debug booting issues (useful with the above bootcode.bin only boot mode). To do this, make sure you've got a recent version of the firmware (including bootcode.bin). To check if UART is supported in your current firmware:
24
24
25
-
[source]
25
+
[,bash]
26
26
----
27
-
$ strings bootcode.bin | grep BOOT_UART
28
-
BOOT_UART=0
27
+
strings bootcode.bin | grep BOOT_UART
29
28
----
30
29
31
30
To enable UART from bootcode.bin use:
32
31
33
-
[source]
32
+
[,bash]
34
33
----
35
34
sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" bootcode.bin
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/raspberry-pi/frequency-management.adoc
+5-4
Original file line number
Diff line number
Diff line change
@@ -35,18 +35,19 @@ In addition, a more stepped CPU governor is also used to produce finer-grained c
35
35
36
36
The default CPU governor is `ondemand`, the governor can be manually changed with the `cpufreq-set` command (from the `cpufrequtils` package) to reduce idle power consumption:
37
37
38
+
[,bash]
38
39
----
39
-
$ sudo apt install cpufrequtils
40
-
$ sudo cpufreq-set -g powersave
40
+
sudo apt install cpufrequtils
41
+
sudo cpufreq-set -g powersave
41
42
----
42
43
43
44
=== Measuring Temperatures
44
45
45
46
Due to the architecture of the SoCs used on the Raspberry Pi range, and the use of the upstream temperature monitoring code in the Raspberry Pi OS distribution, Linux-based temperature measurements can be inaccurate. However, the `vcgencmd` command provides an accurate and instantaneous reading of the current SoC temperature as it communicates with the GPU directly:
Copy file name to clipboardExpand all lines: documentation/asciidoc/computers/raspberry-pi/raspberry-pi-industrial.adoc
+24-7
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@ The Raspberry Pi is often used as part of another product. This documentation de
6
6
7
7
There are a number of OTP values that can be used. To see a list of all the xref:raspberry-pi.adoc#otp-register-and-bit-definitions[OTP values], you can use:
8
8
9
+
[,bash]
9
10
----
10
-
pi@raspberrypi:~ $ vcgencmd otp_dump
11
+
vcgencmd otp_dump
11
12
----
12
13
13
14
Some interesting lines from this dump are:
@@ -22,8 +23,14 @@ To program these bits, you will need to use the vcmailbox. This is a Linux drive
22
23
23
24
The vcmailbox application can be used directly from the command line on a Raspberry Pi Raspberry Pi OS build. An example usage would be:
0 commit comments