2015-02-24 23:42:22 +01:00
|
|
|
Raspberry Pi
|
2013-03-25 14:27:56 +01:00
|
|
|
|
|
|
|
Intro
|
|
|
|
=====
|
|
|
|
|
2015-02-24 23:42:22 +01:00
|
|
|
These instructions apply to all models of the Raspberry Pi:
|
|
|
|
- the original models A and B,
|
|
|
|
- the "enhanced" models A+ and B+,
|
2016-04-23 22:12:50 +02:00
|
|
|
- the model B2 (aka Raspberry Pi 2)
|
|
|
|
- the model B3 (aka Raspberry Pi 3).
|
2019-06-29 20:32:38 +02:00
|
|
|
- the model B4 (aka Raspberry Pi 4).
|
2021-05-19 23:51:14 +02:00
|
|
|
- the model CM4 (aka Raspberry Pi Compute Module 4 and IO Board).
|
2015-02-24 23:42:22 +01:00
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
How to build it
|
2013-03-25 14:27:56 +01:00
|
|
|
===============
|
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
Configure Buildroot
|
|
|
|
-------------------
|
|
|
|
|
2015-06-30 00:07:46 +02:00
|
|
|
There are two RaspberryPi defconfig files in Buildroot, one for each
|
|
|
|
major variant, which you should base your work on:
|
2013-11-06 00:28:18 +01:00
|
|
|
|
2015-06-30 00:07:46 +02:00
|
|
|
For models A, B, A+ or B+:
|
2015-01-10 14:14:58 +01:00
|
|
|
|
2015-06-30 00:07:46 +02:00
|
|
|
$ make raspberrypi_defconfig
|
2015-01-10 14:14:58 +01:00
|
|
|
|
2017-01-26 06:36:08 +01:00
|
|
|
For model Zero (model A+ in smaller form factor):
|
|
|
|
|
|
|
|
$ make raspberrypi0_defconfig
|
|
|
|
|
2021-11-11 21:04:39 +01:00
|
|
|
For model Zero 2 W (model B3 in smaller form factor):
|
|
|
|
|
|
|
|
$ make raspberrypizero2w_defconfig
|
|
|
|
|
2016-04-23 22:12:50 +02:00
|
|
|
For model 2 B:
|
2015-04-07 13:44:20 +02:00
|
|
|
|
|
|
|
$ make raspberrypi2_defconfig
|
|
|
|
|
2018-03-24 15:10:13 +01:00
|
|
|
For model 3 B and B+:
|
2016-04-23 22:12:50 +02:00
|
|
|
|
|
|
|
$ make raspberrypi3_defconfig
|
|
|
|
|
2021-05-19 23:51:12 +02:00
|
|
|
or for model 3 B and B+ (64 bit):
|
|
|
|
|
|
|
|
$ make raspberrypi3_64_defconfig
|
|
|
|
|
2019-06-29 20:32:38 +02:00
|
|
|
For model 4 B:
|
|
|
|
|
|
|
|
$ make raspberrypi4_defconfig
|
|
|
|
|
2021-05-19 23:51:13 +02:00
|
|
|
or for model 4 B (64 bit):
|
|
|
|
|
|
|
|
$ make raspberrypi4_64_defconfig
|
|
|
|
|
2021-05-19 23:51:14 +02:00
|
|
|
For model CM4 (on IO Board):
|
|
|
|
|
|
|
|
$ make raspberrypicm4io_defconfig
|
|
|
|
|
2021-05-19 23:51:15 +02:00
|
|
|
or for CM4 (on IO Board - 64 bit):
|
|
|
|
|
|
|
|
$ make raspberrypicm4io_64_defconfig
|
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
Build the rootfs
|
|
|
|
----------------
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
Note: you will need to have access to the network, since Buildroot will
|
|
|
|
download the packages' sources.
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
You may now build your rootfs with:
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
$ make
|
|
|
|
|
2015-12-31 14:28:08 +01:00
|
|
|
(This may take a while, consider getting yourself a coffee ;-) )
|
2013-11-06 00:28:18 +01:00
|
|
|
|
|
|
|
Result of the build
|
|
|
|
-------------------
|
2013-03-25 14:27:56 +01:00
|
|
|
|
|
|
|
After building, you should obtain this tree:
|
|
|
|
|
|
|
|
output/images/
|
2015-12-31 14:28:08 +01:00
|
|
|
+-- bcm2708-rpi-b.dtb [1]
|
|
|
|
+-- bcm2708-rpi-b-plus.dtb [1]
|
2021-11-11 21:04:38 +01:00
|
|
|
+-- bcm2708-rpi-cm.dtb [1]
|
|
|
|
+-- bcm2708-rpi-zero.dtb [1]
|
|
|
|
+-- bcm2708-rpi-zero-w.dtb [1]
|
2021-11-11 21:04:39 +01:00
|
|
|
+-- bcm2710-rpi-zero-2-w.dtb [1]
|
2015-12-31 14:28:08 +01:00
|
|
|
+-- bcm2709-rpi-2-b.dtb [1]
|
2016-04-23 22:12:50 +02:00
|
|
|
+-- bcm2710-rpi-3-b.dtb [1]
|
2018-03-24 15:10:13 +01:00
|
|
|
+-- bcm2710-rpi-3-b-plus.dtb [1]
|
2021-11-11 21:04:38 +01:00
|
|
|
+-- bcm2710-rpi-cm3.dtb [1]
|
2019-06-29 20:32:38 +02:00
|
|
|
+-- bcm2711-rpi-4-b.dtb [1]
|
2021-05-19 23:51:14 +02:00
|
|
|
+-- bcm2711-rpi-cm4.dtb [1]
|
2021-11-11 21:04:38 +01:00
|
|
|
+-- bcm2837-rpi-3-b.dtb [1]
|
2015-12-31 14:28:08 +01:00
|
|
|
+-- boot.vfat
|
|
|
|
+-- rootfs.ext4
|
2015-01-10 14:14:58 +01:00
|
|
|
+-- rpi-firmware/
|
2013-11-06 00:28:18 +01:00
|
|
|
| +-- bootcode.bin
|
2015-12-31 14:28:08 +01:00
|
|
|
| +-- cmdline.txt
|
2013-11-06 00:28:18 +01:00
|
|
|
| +-- config.txt
|
2021-09-21 22:21:32 +02:00
|
|
|
| +-- fixup.dat [1]
|
|
|
|
| +-- fixup4.dat [1]
|
|
|
|
| +-- start.elf [1]
|
|
|
|
| +-- start4.elf [1]
|
2017-01-26 06:36:06 +01:00
|
|
|
| `-- overlays/ [2]
|
2015-12-31 14:28:08 +01:00
|
|
|
+-- sdcard.img
|
2021-09-21 22:21:32 +02:00
|
|
|
+-- Image [1]
|
|
|
|
`-- zImage [1]
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2015-06-30 00:07:46 +02:00
|
|
|
[1] Not all of them will be present, depending on the RaspberryPi
|
|
|
|
model you are using.
|
|
|
|
|
2019-12-04 11:54:29 +01:00
|
|
|
[2] Only for the Raspberry Pi 3/4 Models (overlay miniuart-bt is needed
|
2016-05-02 22:25:44 +02:00
|
|
|
to enable the RPi3 serial console otherwise occupied by the bluetooth
|
|
|
|
chip). Alternative would be to disable the serial console in cmdline.txt
|
|
|
|
and /etc/inittab.
|
|
|
|
|
2015-12-31 14:28:08 +01:00
|
|
|
How to write the SD card
|
|
|
|
========================
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2015-12-31 14:28:08 +01:00
|
|
|
Once the build process is finished you will have an image called "sdcard.img"
|
|
|
|
in the output/images/ directory.
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2015-12-31 14:28:08 +01:00
|
|
|
Copy the bootable "sdcard.img" onto an SD card with "dd":
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2015-12-31 14:28:08 +01:00
|
|
|
$ sudo dd if=output/images/sdcard.img of=/dev/sdX
|
2013-03-25 14:27:56 +01:00
|
|
|
|
2013-11-06 00:28:18 +01:00
|
|
|
Insert the SDcard into your Raspberry Pi, and power it up. Your new system
|
2016-04-18 23:41:30 +02:00
|
|
|
should come up now and start two consoles: one on the serial port on
|
|
|
|
the P1 header, one on the HDMI output where you can login using a USB
|
|
|
|
keyboard.
|
2021-05-19 23:51:14 +02:00
|
|
|
|
|
|
|
How to write to CM4 eMMC memory
|
|
|
|
===============================
|
|
|
|
|
|
|
|
For CM4 modules without eMMC memory see above for booting from SD card,
|
|
|
|
for CM4 moduels with eMMC memory proceed as following:
|
|
|
|
|
|
|
|
- fit jumper on IO Board header J2 to disable eMMC boot
|
|
|
|
- connect IO Board micro USB port (J11 USB slave) to your host linux system
|
|
|
|
- power up CM4/IO Board (lsusb command should show a '0a5c:2711 Broadcom Corp.
|
|
|
|
BCM2711 Boot' device)
|
|
|
|
- run 'sudo ./host/bin/rpiboot', output should look like the following:
|
|
|
|
Waiting for BCM2835/6/7/2711...
|
|
|
|
Loading embedded: bootcode4.bin
|
|
|
|
Sending bootcode.bin
|
|
|
|
Successful read 4 bytes
|
|
|
|
Waiting for BCM2835/6/7/2711...
|
|
|
|
Loading embedded: bootcode4.bin
|
|
|
|
Second stage boot server
|
|
|
|
Loading embedded: start4.elf
|
|
|
|
File read: start4.elf
|
|
|
|
Second stage boot server done
|
|
|
|
|
|
|
|
- a USB mass storage device should show up (the CM4 eMMC memory), proceed
|
|
|
|
as described above to copy sdcard.img to it
|
|
|
|
- power down CM4/IO Board
|
|
|
|
- remove jumper on IO Board header J2 to re-enable eMMC boot
|
|
|
|
- power up CM4/IO Board
|