1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
---
title: Building for Raspberry Pi 4
---
The
[Raspberry Pi](https://www.raspberrypi.org/help/what-%20is-a-raspberry-pi/) is a small computer that is ideal for learning computing and computer languages.
The AGL Project supports building images for the
[Raspberry Pi 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) board.
These board comes in a variety of models.
See the
[Raspberry Pi Product Page](https://www.raspberrypi.org/products/) for more information.
This section describes the steps you need to take to build the
AGL demo image for the Raspberry Pi 4 board.
## 1. Making Sure Your Build Environment is Correct
The
"[Initializing Your Build Environment](./04_Initializing_Your_Build_Environment.md)"
section presented generic information for setting up your build environment
using the `aglsetup.sh` script.
If you are building the AGL demo image for a Raspberry Pi 4 board, you need to specify some
specific options when you run the script :
**Qt based IVI demo :**
```sh
$ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b raspberrypi4 agl-demo agl-devel
$ echo "# reuse download directories" >> $AGL_TOP/site.conf
$ echo "DL_DIR = \"$HOME/downloads/\"" >> $AGL_TOP/site.conf
$ echo "SSTATE_DIR = \"$AGL_TOP/sstate-cache/\"" >> $AGL_TOP/site.conf
$ ln -sf $AGL_TOP/site.conf conf/
```
**HTML5 based IVI demo :**
```sh
$ source meta-agl/scripts/aglsetup.sh -f -m raspberrypi4 -b raspberrypi4 agl-demo agl-devel agl-profile-graphical-html5
$ echo "# reuse download directories" >> $AGL_TOP/site.conf
$ echo "DL_DIR = \"$HOME/downloads/\"" >> $AGL_TOP/site.conf
$ echo "SSTATE_DIR = \"$AGL_TOP/sstate-cache/\"" >> $AGL_TOP/site.conf
$ ln -sf $AGL_TOP/site.conf conf/
```
In each case, the "-m" option specifies the machine and the list of AGL features used with script are appropriate for development of
the AGL demo image suited for Raspberry Pi 4.
## 2. Configuring the Build to Include Packages Under a Commercial License
Before launching the build, it is good to be sure your build
configuration is set up correctly (`/build/conf/local.conf` file).
The "[Customizing Your Build](./05_Customizing_Your_Build.md)"
section highlights some common configurations that are useful when
building any AGL image.
For the Raspberry Pi platforms, you need to take an additional
configuration step if you want to include any packages under a
commercial license.
For example, suppose you want to include an implementation of the
[OpenMAX](https://www.khronos.org/openmax/) Intagration Library
(`libomxil`) under a commercial license as part of your AGL image.
If so, you must include the following two lines in your
`/build/conf/local.conf` file:
```sh
# For libomxil
LICENSE_FLAGS_WHITELIST = "commercial"
IMAGE_INSTALL_append = "libomxil"
```
## 3. Using BitBake
This section shows the `bitbake` command used to build the AGL image.
Start the build using the `bitbake` command.
**NOTE:** An initial build can take many hours depending on your
CPU and and Internet connection speeds.
The build also takes approximately 100G-bytes of free disk space.
**Qt Based IVI demo :**
The target is `agl-ivi-demo-qt`.
```sh
$ time bitbake agl-ivi-demo-qt
```
By default, the build process puts the resulting image in the Build Directory and further exporting that as `$IMAGE_NAME`.
Here is example for the Raspberry Pi 4 board for Qt Based demo:
```sh
<build_dir>/tmp/deploy/images/raspberrypi4/agl-ivi-demo-qt-raspberrypi4.rootfs.wic.xz
$ export IMAGE_NAME=agl-ivi-demo-qt-raspberrypi4.rootfs.wic.xz
```
**HTML5 Based IVI demo :**
The target is `agl-ivi-demo-html5`.
```sh
$ time bitbake agl-ivi-demo-html5
```
By default, the build process puts the resulting image in the Build Directory and further exporting that as `$IMAGE_NAME`.
Here is example for the Raspberry Pi 4 board for HTML5 Based demo:
```sh
<build_dir>/tmp/deploy/images/raspberrypi4/agl-ivi-demo-html5-raspberrypi4-64.rootfs.wic.xz
$ export IMAGE_NAME=agl-ivi-demo-html5-raspberrypi4-64.rootfs.wic.xz
```
## 4. Deploying the AGL Demo Image
Deploying the AGL demo image consists of copying the image on a MicroSD card,
plugging the card into the Raspberry Pi board, and then booting the board.
Follow these steps to copy the image to a MicroSD card and boot
the image on the Raspberry Pi 4 board:
1. Plug your MicroSD card into your Build Host (i.e. the system that has your build output).
2. Extract the image into the SD card of Raspberry Pi 4 :
**NOTE:** For Raspberry Pi 4, the image is at `<build-dir>/tmp/deploy/images/raspberrypi4/${IMAGE_NAME}`.
Be sure you are root, provide the actual device name for *sdcard_device_name*, and the actual image name for *image_name*.
```sh
$ lsblk
$ sudo umount <sdcard_device_name>
$ xzcat ${IMAGE_NAME} | sudo dd of=<sdcard_device_name> bs=4M
$ sync
```
**IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
be sure you are actually writing to the removable MicroSD card and not some other
device.
Each computer is different and removable devices can change from time to time.
Consequently, you should repeat the previous operation with the MicroSD card to
confirm the device name every time you write to the card.
To summarize this example so far, we have the following:
The first SATA drive is `/dev/sda` and `/dev/sdc` corresponds to the MicroSD card, and is also marked as a removable device.You can see this in the output of the `lsblk` command where "1" appears in the "RM" column for that device.
3. SSH into Raspberry Pi :
- Connect Raspberry Pi to network : `Homescreen > Settings`, IP address mentioned here.
- SSH :
```sh
$ ssh root@<Raspberry-Pi-ip-address>
```
4. Serial Debugging :
When things go wrong, you can take steps to debug your Raspberry Pi.
For debugging, you need a 3.3 Volt USB Serial cable to fascilitate
communication between your Raspberry Pi board and your build host.
You can reference the following diagram for information on the following steps:
![](images/RaspberryPi2-ModelB-debug-serial-cable.png)
1. Connect the TTL cable to the Universal Asynchronous Receiver-Transmitter
(UART) connection on your Raspberry Pi board.
Do not connect the USB side of the cable to your build host at this time.
**CAUTION:** No warranty is provided using the following procedure.
Pay particular attention to the collors of your cable as they could
vary depending on the vendor.
2. Connect the cable's BLUE wire to pin 6 (i.e. Ground) of the UART.
3. Connect the able's GREEN RX line to pin 8 (i.e. the TXD line) of
the UART.
4. Connect the cable's RED TX line to pin 10 (i.e. the RXD line) of
the UART.
5. Plug the USB connector of the cable into your build host's USB port.
6. Use your favorite tool for serial communication between your build host
and your Raspberry Pi.
For example, if your build host is a native Linux machine (e.g. Ubuntu)
you could use `screen` as follows from a terminal on the build host:
```sh
$ sudo screen /dev/ttyUSB0 115200
```
5. SOTA
Follow the step below to build AGL for Raspberry Pi with enabled software over
the air (SOTA) updates:
1. Include **agl-sota** feature.
2. In **bblayers.conf** replace meta-updater-qemux86-64 with
**meta-updater-raspberrypi**.
3. In **local.conf** set `SOTA_PACKED_CREDENTIALS` and `OSTREE_BRANCHNAME`.
More details are available [here](https://docs.ota.here.com/getstarted/dev/raspberry-pi.html).
|