-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.phasora
275 lines (213 loc) · 7.35 KB
/
README.phasora
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# meta-phasora
## i.MX8M Mini EVK based build
### Overview
This layer depends upon and customises the NXP i.MX EVK BSP support.
You should first install and familiarise yourself with the BSP [here](https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX)
You'll find the Yocto Project Quickstart [here](https://docs.yoctoproject.org/2.4.2/yocto-project-qs/yocto-project-qs.html) and the Reference Manual [here](https://docs.yoctoproject.org/ref-manual/index.html)
This layer customises the Linux kernel for Phasora specific hardware and customises the build for that hardware, e.g. Flutter UI
NOTE: We are currently using the `kirkstone` branch
#### Configuration files
`local.conf`
```
MACHINE ??= 'imx8mmevk'
DISTRO ?= 'fsl-imx-wayland'
DISTRO_FEATURES:append = 'gbm'
DISTRO_FEATURES:remove = 'x11 vulkan'
PACKAGE_CLASSES ?= 'package_rpm'
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
CONF_VERSION = "2"
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
# Switch to Debian packaging and include package-management in the image
PACKAGE_CLASSES = "package_deb"
EXTRA_IMAGE_FEATURES += "package-management"
INHERIT += " rm_work "
OE_TERMINAL = "screen"
# FIXME - Needs to go elsewhere
KERNEL_DEVICETREE:append:imx8mmevk = " freescale/imx8mm-evk-st7701.dtb "
```
`bblayers.conf`
```
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
${BSPDIR}/sources/meta-openembedded/meta-python \
\
${BSPDIR}/sources/meta-freescale \
${BSPDIR}/sources/meta-freescale-3rdparty \
${BSPDIR}/sources/meta-freescale-distro \
"
# i.MX Yocto Project Release layers
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-bsp"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-sdk"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-ml"
BBLAYERS += "${BSPDIR}/sources/meta-imx/meta-v2x"
BBLAYERS += "${BSPDIR}/sources/meta-nxp-demo-experience"
BBLAYERS += "${BSPDIR}/sources/meta-browser/meta-chromium"
BBLAYERS += "${BSPDIR}/sources/meta-clang"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-gnome"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-networking"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-filesystems"
BBLAYERS += "${BSPDIR}/sources/meta-qt6"
BBLAYERS += "${BSPDIR}/sources/meta-virtualization"
BBLAYERS += "${BSPDIR}/sources/meta-flutter"
BBLAYERS += "${BSPDIR}/sources/meta-phasora"
```
#### Building
`. ./setup-environment build`
`bitbake imx-image-multimedia`
```
Build Configuration:
BB_VERSION = "2.0.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "imx8mmevk"
DISTRO = "fsl-imx-wayland"
DISTRO_VERSION = "5.15-kirkstone"
TUNE_FEATURES = "aarch64 armv8a crc crypto"
TARGET_FPU = ""
meta
meta-poky
meta-oe
meta-multimedia
meta-python
meta-freescale
meta-freescale-3rdparty
meta-freescale-distro
meta-bsp
meta-sdk
meta-ml
meta-v2x
meta-nxp-demo-experience
meta-chromium
meta-clang
meta-gnome
meta-networking
meta-filesystems
meta-qt6
meta-virtualization = "<unknown>:<unknown>"
meta-flutter = "kirkstone:1724903a9dc96bfbf7f1a1ddee4931d4e46869cb"
meta-phasora = "main:052470f99685dd8354cd08c02209776c87c8bf15"
```
The build files will be in `tmp/deploy/images/imx8mmevk`
#### Flashing
Change the boot pin settings on the i.MX8M Mini (SW1101 1 UP, 2 DOWN = Download Mode)
```
cd tmp/deploy/images/imx8mmevk
sudo uuu -b emmc_all imx-boot imx-image-multimedia-imx8mmevk.wic.bz2
```
Change the boot pin settings on the i.MX8M Mini (SW1101 1 DOWN, 2 UP = eMMC Boot Mode)
#### Booting
u-boot will boot and then boot the kernel. With the `local.conf` above you will have ST7701 LCD controller enabled with a custom DTB.
If you need to set this manually break into the u-boot boot (press any key) and
```
setenv fdtfile imx8mm-evk-st7701.dtb
saveenv
```
Power cycle
The Linux kernel will boot to a login prompt and the display will come on with a desktop displaying
TBD: Note sometimes the display doesn't correctly initialise and it needs a power cycle
You can login with "root", no password
#### Initial setup
The board comes with calibration settings saved in 'TBD'
You can update these at any time by running the interactive calibration utility `weston-touchscreen-calibration`
You can also test the touchscreen calibration by running `weston-simple-touch`
The board boots to GUI mode. You need to be running in console mode to run Flutter applications. To change to console mode type
`systemctl isolate multi-user.target`
To go back to GUI mode type
`systemctl isolate graphical.target`
## Flutter
### Host Setup
TBD
### Setup workspace
### Add custom device
```
cd ~/workspace
. ./setup_env.sh
flutter custom-device add
```
*TBD*
The configuration file is here `~/workspace/.config/flutter/custom_devices.json` and should look like this
NOTE: The IP address of your target will be different and you can see this by running `ifconfig` on the board itself
```
{
"custom-devices": [
{
"id": "imx8mm",
"label": "imx8mm",
"sdkNameAndVersion": "",
"platform": null,
"enabled": true,
"ping": [
"ping",
"-c",
"1",
"-w",
"1",
"10.0.31.109"
],
"pingSuccessRegex": null,
"postBuild": null,
"install": [
"bash", "-c", "ssh -t -oBatchMode=yes root@10.0.31.109 mkdir -p \"/tmp/${appName}/data/flutter_assets\" && scp -oBatchMode=yes -r \"${localPath}\" root@10.0.31.109:/>
],
"uninstall": [
"ssh",
"-o",
"BatchMode=yes",
"root@10.0.31.109",
"rm -rf \"/tmp/${appName}\""
],
"runDebug": [
"bash", "-c", "ssh -t -oBatchMode=yes root@10.0.31.109 flutter-pi -r 90 -i /dev/input/event2 /tmp/${appName}"
],
"forwardPort": [
"ssh",
"-o",
"BatchMode=yes",
"-o",
"ExitOnForwardFailure=yes",
"-L",
"127.0.0.1:${hostPort}:127.0.0.1:${devicePort}",
"root@10.0.31.109",
"echo 'Port forwarding success'; read"
],
"forwardPortSuccessRegex": "Port forwarding success",
"screenshot": null
}
]
}
```
### Create hello world application
*TBD*
### Running Hello World application on target
```
cd ~/workspace
. ./setup_env.sh
cd ~/workspace/app/hello_world
# Copies across the files
flutter -d imx8mm install
# Runs the app in debugger mode
flutter -d imx8mm run
```
You should see the hello world application window display and you should be able to use the touchscreen to touch the button to increment the count