renesas: refactoring documentation
[AGL/documentation.git] / docs / 0_Getting_Started / 2_Building_AGL_Image / 5_3_RCar_Gen_3.md
1 ---
2 title: Building for Supported Renesas Boards
3 ---
4
5 AGL supports building for several automotive
6 [Renesas](https://www.renesas.com/us/en/solutions/automotive.html) board kits.
7 Renesas is the number one supplier of vehicle control microcontrollers and
8 System on a Chip (SoC) products for the automotive industry.
9
10 This section provides the build and deploy steps you need to create an
11 image for the following Renesas platforms:
12
13 * [Renesas R-Car Starter Kit Pro Board](https://www.elinux.org/R-Car/Boards/M3SK)
14 * [Renesas R-Car Starter Kit Premier Board](https://www.elinux.org/R-Car/Boards/H3SK)
15 * [Renesas Salvator-X Board](https://www.elinux.org/R-Car/Boards/Salvator-X)
16 * [Renesas Kingfisher Infotainment Board](https://elinux.org/R-Car/Boards/Kingfisher)
17
18 **NOTE:** You can find similar information for the Pro and Premier board kits on the
19 [R-Car/Boards/Yocto-Gen3](https://elinux.org/R-Car/Boards/Yocto-Gen3) page on [elinux.org](https://elinux.org).
20 The information on this page describes setup and build procedures for both of these
21 Renesas development kits.
22
23 Additionally, the AGL Reference Hardware platform is based on the same Renesas
24 H3 processor used on the Renesas R-Car Starter Kit Premier and Salvator-X boards,
25 so support for it leverages the Starter Kit Premier (also known as "h3ulcb")
26 build.
27 For more information on the AGL reference hardware platform, please refer to its
28 [manual](https://wiki.automotivelinux.org/_media/eg-rhsa/rh_manual_ver.1.0.pdf),
29 or the Reference Hardware System Architecture Expert Group
30 [wiki page](https://wiki.automotivelinux.org/eg-rhsa).
31
32 ## 1. Prepare your build
33
34 ### 1.1 Downloading Proprietary Drivers
35
36 Before setting up the build environment, you need to download proprietary drivers from the
37 [R-Car H3/M3 Software library and Technical document](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
38 site.
39
40 Follow these steps to download the drivers you need:
41
42 1. **Determine the Files You Need:**
43
44     Run the ``setup_mm_packages.sh`` script as follows to
45     display the list of ZIP files containing the drivers you need.
46     Following is an example:
47
48     ```sh
49     grep -rn ZIP_.= $AGL_TOP/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
50     ```
51
52     The script's output identifies the files you need to download from the page.
53
54 2. **Get Your Board Support Package (BSP) Version:**
55
56     Be sure to have the correct BSP version of the R-Car Starter Kit
57     based on the version of the AGL software you are using.
58     Find the appropriate download links on the
59     [R-Car H3/M3 Software library and Technical document](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
60     site.
61     The file pairs are grouped according to the Yocto Project version you are
62     using with the AGL software.
63
64     Use the following table to map the Renesas version to your AGL software:
65
66     | AGL Version | Renesas version |
67     |:-:|:-:|
68     | AGL master | 4.7.0 |
69
70 3. **Download the Files:**
71
72     Start the download process by clicking the download link.
73     If you do not have an account with Renesas, you will be asked to register a free account.
74     You must register and follow the "Click Through" licensing process
75     in order to download these proprietary files.
76
77     If needed, follow the instructions to create the free account by providing the required
78     account information.
79     Once the account is registered and you are logged in, you can download the files.
80
81     **NOTE:** You might have to re-access the
82     [original page](https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software)
83     that contains the download links you need after creating the account and logging in.
84
85 4. **Create an Environment Variable to Point to Your Download Area:**
86
87     Create and export an environment variable named `XDG_DOWNLOAD_DIR` that points to
88     your download directory.
89     Here is an example:
90
91     ```sh
92     export XDG_DOWNLOAD_DIR=$HOME/Downloads
93     ```
94
95 5. **Be Sure the Files Have Rights:**
96
97     Be sure you have the necessary rights for the files you downloaded.
98     You can use the following command:
99
100     ```sh
101     chmod a+rw $XDG_DOWNLOAD_DIR/*.zip
102     ```
103
104 6. **Check to be Sure the Files are Downloaded and Have the Correct Rights:**
105
106     Do a quick listing of the files to ensure they are in the download directory and
107     they have the correct access rights.
108     Here is an example:
109
110     ```sh
111     $ ls -l $XDG_DOWNLOAD_DIR/*.zip
112     -rw-rw-r-- 1 scottrif scottrif 4662080 Nov 19 14:48 /home/scottrif/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
113     -rw-rw-r-- 1 scottrif scottrif 3137626 Nov 19 14:49 /home/scottrif/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
114     ```
115
116 ### 1.2. Getting More Software
117
118 1. **Get the `bmaptool`:**
119
120     Download this tool from the
121     [bmap-tools](https://build.opensuse.org/package/show/isv:LinuxAutomotive:AGL_Master/bmap-tools)
122     repository.
123     The site has pre-built packages (DEB or RPM) for the supported host
124     operating systems.
125
126 ### 1.3. Getting Your Hardware Together
127
128 Gather together this list of hardware items, which is not exhaustive.
129 Having these items ahead of time saves you from having to try and
130 collect hardware during development:
131
132 * Supported Starter Kit Gen3 board with its 5V power supply.
133 * Micro USB-A cable for serial console.
134     This cable is optional if you are using Ethernet and an SSH connection.
135 * USB 2.0 Hub.  The hub is optional but makes it easy to connect multiple USB devices.
136 * Ethernet cable.  The cable is optional if you are using a serial console.
137 * HDMI type D (Micro connector) cable and an associated display.
138 * 4 Gbyte minimum MicroSD Card.  It is recommended that you use a class 10 type.
139 * USB touch screen device such as the GeChic 1502i/1503i.  A touch screen device is optional.
140
141 **NOTE:** The Salvator-X Board has NDA restrictions.
142 Consequently, less documentation is available for this board both here and across the
143 Internet.
144
145 ### 1.4. Making Sure Your Build Environment is Correct
146
147 The
148 "[Initializing Your Build Environment](./3_Initializing_Your_Build_Environment.md)"
149 section presented generic information for setting up your build environment
150 using the `aglsetup.sh` script.
151 If you are building an image for a supported Renesas board,
152 you need to take steps to make sure your build host is set up correctly.
153
154 1. **Define Your Board:**
155
156     Depending on your Renesas board, define and export a `MACHINE` variable as follows:
157
158     | Board | `MACHINE` Setting |
159     |:-:|:-:|
160     | Starter Kit Pro/M3  | `MACHINE`=m3ulcb |
161     | Starter Kit Pro/M3 + kingfisher support | `MACHINE`=m3ulcb-kf |
162     | Starter Kit Pro/M3 without graphic driver (using pixman)  | `MACHINE`=m3ulcb-nogfx |
163     | Starter Kit Premier/H3  | `MACHINE`=h3ulcb |
164     | Starter Kit Premier/H3  + kingfisher support  | `MACHINE`=h3ulcb-kf |
165     | Starter Kit Premier/H3  without graphic driver (using pixman)  | `MACHINE`=h3ulcb-nogfx |
166     | Salvator-X  | `MACHINE`=h3-salvator-x |
167     | AGL Reference Hardware | `MACHINE`=h3ulcb |
168     | AGL Reference Hardware  without graphic driver (using pixman)  | `MACHINE`=h3ulcb-nogfx |
169
170     For example, the following command defines and exports the `MACHINE` variable
171     for the Starter Kit Premier/H3 Board:
172
173     ```sh
174     export MACHINE=h3ulcb
175     ```
176
177 ### 1.5. **Run the `aglsetup.sh` Script:**
178
179 Use the following commands to run the AGL Setup script:
180
181 ```sh
182 cd $AGL_TOP
183 source meta-agl/scripts/aglsetup.sh -m $MACHINE -b build agl-devel agl-demo
184 ```
185
186 If building for the AGL Reference Hardware (with `MACHINE` set to "h3ulcb" or
187 "h3ulcb-nogfx"), add `agl-refhw-h3`, for example:
188
189 ```sh
190 cd $AGL_TOP
191 source meta-agl/scripts/aglsetup.sh -m $MACHINE -b build agl-devel agl-demo agl-refhw-h3
192 ```
193
194 **NOTE:**
195 You can check if your logs match what is expected in the [troubleshooting section](#4-troubleshooting).
196
197 Running the `aglsetup.sh` script automatically places you in the
198 working directory (i.e. `$AGL_TOP/build`).
199 You can change this default behavior by adding the "-f" option to the
200 script's command line.
201
202 In the previous command, the "-m" option sets your machine to the previously
203 defined `MACHINE` variable.
204 The "-b" option defines your Build Directory, which is the
205 default `$AGL_TOP/build`.
206 Finally, the AGL features are provided to support building the AGL Demo image
207 for the Renesas board.
208
209 You can learn more about the AGL Features in the
210 "[Initializing Your Build Environment](./3_Initializing_Your_Build_Environment.md)"
211 section.
212
213 ## 2. Using BitBake
214
215 This section shows the `bitbake` command used to build the AGL image.
216 Before running BitBake to start your build, it is good to be reminded that AGL
217 does provide pre-built images for developers that work with supported hardware.
218 You can find these pre-built images on the
219 [AGL Download web site](https://download.automotivelinux.org/AGL/release).
220
221 Start the build using the `bitbake` command.
222
223 **NOTE:** An initial build can take many hours depending on your
224 CPU and and Internet connection speeds.
225 The build also takes approximately 100G-bytes of free disk space.
226
227 For this example, the target is "agl-demo-platform":
228
229 ```sh
230 bitbake agl-demo-platform
231 ```
232
233 The build process puts the resulting image in the Build Directory:
234
235 ```sh
236 <build_directory>/tmp/deploy/images/$MACHINE
237 ```
238
239 ## 3. Deploying the AGL Demo Image
240
241 To boot your image on the Renesas board, you need to do three things:
242
243 1. [Update all firmware on the board.](#4-troubleshooting)
244 2. Prepare the MicroSD card to you can boot from it.
245 3. Boot the board.
246
247 **NOTE:** For subsequent builds, you only have to re-write the MicroSD
248 card with a new image.
249
250 ### 3.1. Booting the Image Using a MicroSD Card
251
252 1. Preparing the MicroSD Card
253
254     Plug the MicroSD card into your Build Host.
255     After plugging in the device, use the `dmesg` command as follows to
256     discover the device name:
257
258     ```sh
259     $ dmesg | tail -4
260     [ 1971.462160] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
261     [ 1971.462277] sd 6:0:0:0: [sdc] No Caching mode page found
262     [ 1971.462278] sd 6:0:0:0: [sdc] Assuming drive cache: write through
263     [ 1971.463870]  sdc: sdc1 sdc2
264     ```
265
266     In the previous example, the MicroSD card is attached to the device `/dev/sdc`.
267     You can also use the `lsblk` command to show all your devices.
268     Here is an example that shows the MicroSD card as `/dev/sdc`:
269
270     ```sh
271     $ lsblk
272     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
273     sda      8:0    0 167,7G  0 disk
274     ├─sda1   8:1    0   512M  0 part /boot/efi
275     ├─sda2   8:2    0 159,3G  0 part /
276     └─sda3   8:3    0   7,9G  0 part [SWAP]
277     sdb      8:16   0 931,5G  0 disk
278     └─sdb1   8:17   0 931,5G  0 part /media/storage
279     sdc      8:32   1  14,9G  0 disk
280     ├─sdc1   8:33   1    40M  0 part
281     └─sdc2   8:34   1   788M  0 part
282     ```
283
284     **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
285     be sure you are actually writing to the removable MicroSD card and not some other
286     device.
287     Each computer is different and removable devices can change from time to time.
288     Consequently, you should repeat the previous operation with the MicroSD card to
289     confirm the device name every time you write to the card.
290
291     To summarize this example so far, we have the following:
292
293     * The first SATA drive is `/dev/sda`.
294
295     * `/dev/sdc` corresponds to the MicroSD card, and is also marked as a removable device.
296     You can see this in the output of the `lsblk` command where "1" appears in the "RM" column
297     for that device.
298
299     Now that you have identified the device you are going to be writing the image on,
300     you can use the `bmaptool` to copy the image to the MicroSD card.
301
302     Your desktop system might offer a choice to mount the MicroSD automatically
303     in some directory.
304     For this example, assume that the MicroSD card mount directory is stored in the
305     `$SDCARD` variable.
306
307     Following are example commands that write the image to the MicroSD card:
308
309     ```sh
310     cd $AGL_TOP/build/tmp/deploy/images/$MACHINE
311     bmaptool copy ./agl-demo-platform-$MACHINE.wic.xz <boot_device_name>
312     ```
313
314     Alternatively, you can leave the image in an uncompressed state and write it
315     to the MicroSD card:
316
317     ```sh
318     sudo umount <boot_device_name>
319     xzcat ./agl-demo-platform-$MACHINE.wic.xz | sudo dd of=<boot_device_name> bs=4M
320     sync
321     ```
322
323 2. Booting the Board
324
325     Follow these steps to boot the board:
326
327     1. Use the board's power switch to turn off the board.
328
329     2. Insert the MicroSD card into the board.
330
331     3. Verify that you have plugged in the following:
332
333         * An external monitor into the board's HDMI port
334
335         * An input device (e.g. keyboard, mouse, touchscreen, and so forth) into the board's USB ports.
336
337     4. Use the board's power switch to turn on the board.
338
339     After a few seconds, you will see the AGL splash screen on the display and you
340     will be able to log in at the console's terminal or using the graphic screen.
341
342 ### 3.2. Setting Up the Serial Console
343
344 Setting up the Serial Console involves the following:
345
346 * Installing a serial client on your build host
347 * Connecting your build host to your Renesas board's serial port
348 * Powering on the board to get a shell at the console
349 * Configuring U-Boot parameters
350 * Logging into the console
351 * Determining the board's IP address
352
353 1. Installing a Serial Client on Your Build Host
354
355     You need to install a serial client on your build host.
356     Some examples are:
357
358     * [GNU Screen](https://en.wikipedia.org/wiki/GNU_Screen)
359     * [picocom](https://linux.die.net/man/8/picocom)
360     * [Minicom](https://en.wikipedia.org/wiki/Minicom)
361
362     Of these three, "picocom" has the least dependencies and is therefore
363     considered the "lightest" solution.
364
365 2. Connecting Your Build Host to Your Renesas Board's Serial Port
366
367     You need to physically connect your build host to the Renesas board using
368     a USB cable from the host to the serial CP2102 USP port (i.e. Micro USB-A port)
369     on the Renesas board.
370
371     Once you connect the board, determine the device created for the serial link.
372     Use the ``dmesg`` command on your build host.
373     Here is an example:
374
375     ```sh
376     dmesg | tail 9
377     [2097783.287091] usb 2-1.5.3: new full-speed USB device number 24 using ehci-pci
378     [2097783.385857] usb 2-1.5.3: New USB device found, idVendor=0403, idProduct=6001
379     [2097783.385862] usb 2-1.5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
380     [2097783.385864] usb 2-1.5.3: Product: FT232R USB UART
381     [2097783.385866] usb 2-1.5.3: Manufacturer: FTDI
382     [2097783.385867] usb 2-1.5.3: SerialNumber: AK04WWCE
383     [2097783.388288] ftdi_sio 2-1.5.3:1.0: FTDI USB Serial Device converter detected
384     [2097783.388330] usb 2-1.5.3: Detected FT232RL
385     [2097783.388658] usb 2-1.5.3: FTDI USB Serial Device converter now attached to ttyUSB0
386     ```
387
388     The device created is usually "/dev/ttyUSB0".
389     However, the number might vary depending on other USB serial ports connected to the host.
390
391     To use the link, you need to launch the client.
392     Here are three commands, which vary based on the serial client, that show
393     how to launch the client:
394
395     ```sh
396     picocom -b 115200 /dev/ttyUSB0
397     ```
398
399     or
400
401     ```sh
402     minicom -b 115200 -D /dev/ttyUSB0
403     ```
404
405     or
406
407     ```sh
408     screen /dev/ttyUSB0 115200
409     ```
410
411 3. Powering on the Board to Get a Shell at the Console
412
413     Both the Pro and Premier kits (e.g.
414     [m3ulcb](https://elinux.org/R-Car/Boards/M3SK) and
415     [h3ulcb](https://elinux.org/R-Car/Boards/H3SK#Hardware)) have nine
416     switches (SW1 through SW9).
417     To power on the board, "short-press" SW8, which is the power switch.
418
419     Following, is console output for the power on process for each kit:
420
421     **h3ulcb**:
422
423     ```text
424     NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.7
425     NOTICE:  BL2: PRR is R-Car H3 ES1.1
426     NOTICE:  BL2: LCM state is CM
427     NOTICE:  BL2: DDR1600(rev.0.15)
428     NOTICE:  BL2: DRAM Split is 4ch
429     NOTICE:  BL2: QoS is Gfx Oriented(rev.0.30)
430     NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52
431     NOTICE:  BL2: Lossy Decomp areas
432     NOTICE:       Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
433     NOTICE:       Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
434     NOTICE:       Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
435     NOTICE:  BL2: v1.1(release):41099f4
436     NOTICE:  BL2: Built : 19:20:52, Jun  9 2016
437     NOTICE:  BL2: Normal boot
438     NOTICE:  BL2: dst=0xe63150c8 src=0x8180000 len=36(0x24)
439     NOTICE:  BL2: dst=0x43f00000 src=0x8180400 len=3072(0xc00)
440     NOTICE:  BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
441     NOTICE:  BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
442     NOTICE:  BL2: dst=0x49000000 src=0x8640000 len=1048576(0x100000)
443
444
445     U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
446
447     CPU: Renesas Electronics R8A7795 rev 1.1
448     Board: H3ULCB
449     I2C:   ready
450     DRAM:  3.9 GiB
451     MMC:   sh-sdhi: 0, sh-sdhi: 1
452     In:    serial
453     Out:   serial
454     Err:   serial
455     Net:   Board Net Initialization Failed
456     No ethernet found.
457     Hit any key to stop autoboot:  0
458     =>
459     ```
460
461 ### 3.3. Setting-up U-boot
462
463 Configuring U-Boot Parameters
464
465 Follow these steps to configure the board to use the MicroSD card as the
466 boot device and also to set the screen resolution:
467
468 1. As the board is powering up, press any key to stop the autoboot process.
469 You need to press a key quickly as you have just a few seconds in which to
470 press a key.
471
472 2. Once the autoboot process is interrupted, use the board's serial console to
473 enter `printenv` to check if you have correct parameters for booting your board:
474
475     Here is an example using the **h3ulcb** board:
476
477     ```sh
478     => printenv
479     baudrate=115200
480     bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait ro rootfstype=ext4
481     bootcmd=run load_ker; run load_dtb; booti 0x48080000 - 0x48000000
482     bootdelay=3
483     fdt_high=0xffffffffffffffff
484     initrd_high=0xffffffffffffffff
485     load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb.dtb
486     load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
487     stderr=serial
488     stdin=serial
489     stdout=serial
490     ver=U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
491
492     Environment size: 648/131068 bytes
493     ```
494
495 3. To boot your board using the MicroSD card, be sure your environment is set up
496 as follows:
497
498     ```sh
499     setenv bootargs console=ttySC0,115200 ignore_loglevel vmalloc=384M video=HDMI-A-1:1920x1080-32@60 root=/dev/mmcblk1p1 rw rootfstype=ext4 rootwait rootdelay=2
500     setenv bootcmd run load_ker\; run load_dtb\; booti 0x48080000 - 0x48000000
501     setenv load_ker ext4load mmc 0:1 0x48080000 /boot/Image
502     ```
503
504 4. Loading dtb :
505
506     **NOTE** : Refer [here](https://elinux.org/R-Car/Boards/Yocto-Gen3-CommonFAQ/Which_dtb_file_is_required_to_boot_linux_on_the_R-Car_Starter_Kit_board_%3F) for more information.
507
508     Make sure your ``load_dtb`` is set as follows :
509
510     | Renesas Boards | DTB Name |
511     |:-:|:-:|
512     | **H3SK v2.0(DDR 4GB)** | r8a7795-h3ulcb.dtb |
513     | **H3SK v2.0(DDR 8GB)/v3.0(DDR 8GB)** | r8a7795-h3ulcb-4x2g.dtb |
514     | **M3SK v1.0** | r8a7796-m3ulcb.dtb |
515     | **M3SK v3.0** | r8a7796-m3ulcb-2x4g.dtb |
516     | **H3SK with a Kingfisher board** | r8a7795-h3ulcb-kf.dtb |
517     | **M3SK with a Kingfisher board** | r8a7796-m3ulcb-kf.dtb |
518     | **AGL Reference Hardware board** | r8a7795-agl-refhw.dtb |
519
520     ```sh
521     setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb-kf.dtb
522     ```
523
524 5. Save the boot environment:
525
526     ```sh
527     saveenv
528     ```
529
530 6. Boot the board:
531
532     ```sh
533     run bootcmd
534     ```
535
536 ## 4. Troubleshooting
537
538 ### 4.1. Checking Your Configuration
539
540 Aside from environment variables and parameters you establish through
541 running the `aglsetup.sh` script, you can ensure your build's configuration
542 is just how you want it by examining the `local.conf` configuration file.
543
544 You can find this configuration file in the Build Directory (e.g.
545 `$TOP_DIR/build/conf/local.conf`).
546
547 In general, the defaults along with the configuration fragments the
548 `aglsetup.sh` script applies in the `local.conf` file are good enough.
549 However, you can customize aspects by editing the `local.conf` file.
550 See the
551 "[Customizing Your Build](4_Customizing_Your_Build.md)"
552 section for common configurations you might want to consider.
553
554 **NOTE:** For detailed explanations of the configurations you can make
555 in the ``local.conf`` file, consult the
556 [Yocto Project Documentation](https://www.yoctoproject.org/docs/).
557
558 A quick way to see if you have the `$MACHINE` variable set correctly
559 is to use the following command:
560
561 ```sh
562 grep -w -e "^MACHINE =" $AGL_TOP/build/conf/local.conf
563 ```
564
565 Depending on the Renesas board you are using, you should see output
566 as follows:
567
568 ```sh
569 MACHINE = "h3ulcb"
570 ```
571
572 or
573
574 ```sh
575 MACHINE = "m3ulcb"
576 ```
577
578 or
579
580 ```sh
581 MACHINE = "h3-salvator-x"
582 ```
583
584 If you ran the `aglsetup.sh` script as described in the
585 "[Making Sure Your Build Environment is Correct](./5_3_RCar_Gen_3.md#4-making-sure-your-build-environment-is-correct)"
586 section earlier, the "agl-devel", "agl-demo", "agl-netboot", "agl-appfw-smack", and
587 "agl-localdev" AGL features will be in effect.
588 These features provide the following:
589
590 * A debugger (gdb)
591 * Some tweaks, including a disabled root password
592 * A SFTP server
593 * The TCF Agent for easier application deployment and remote debugging
594 * Some extra system tools such as USB and bluetooth
595 * Support for the AGL demo platform
596 * Network boot support through TFTP and NBD protocols
597 * [IoT.bzh](https://iot.bzh/en/) Application Framework plus
598 [SMACK](https://en.wikipedia.org/wiki/Smack_(software)) and
599 [Cynara](https://wiki.tizen.org/Security:Cynara)
600 * Support for local development including `localdev.inc` when present
601
602 ### 4.2. Check the Script's Log:
603
604 Running the `aglsetup.sh` script creates the `setup.log` file, which is in
605 the `build/conf` folder.
606 You can examine this log to see the results of the script.
607 For example, suppose the graphics drivers were missing or could not be extracted
608 when you ran the script.
609 In case of missing graphics drivers, you could notice an error message
610 similar to the following:
611
612 ```text
613 [snip]
614 --- fragment /home/working/workspace_agl_master/meta-agl/templates/machine/h3ulcb/50_setup.sh
615 /home/working/workspace_agl_master /home/working/workspace_agl_master/build_gen3
616 The graphics and multimedia acceleration packages for
617 the R-Car Gen3 board can be downloaded from:
618 https://www.renesas.com/en-us/solutions/automotive/rcar-demoboard-2.html
619
620 These 2 files from there should be store in your'/home/devel/Downloads' directory.
621     R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
622     R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
623 /home/working/workspace_agl_master/build_gen3
624 --- fragment /home/working/workspace_agl_master/meta-agl/templates/base/99_setup_EULAconf.sh
625 --- end of setup script
626 OK
627 Generating setup file: /home/working/workspace_agl_master/build_gen3/agl-init-build-env ... OK
628 ------------ aglsetup.sh: Done
629 [snip]
630 ```
631
632 If you encounter this issue, or any other unwanted behavior, you can fix the error
633 mentioned, remove the `$AGL_TOP/build` directory, and then re-launch the
634 `aglsetup.sh` again.
635
636 Here is another example that indicates the driver files could not be extracted from the downloads directory:
637
638 ```text
639 ~/workspace_agl/build/conf $ cat setup.log
640 --- beginning of setup script
641 --- fragment /home/working/workspace_agl/meta-agl/templates/base/01_setup_EULAfunc.sh
642 --- fragment /home/working/workspace_agl/meta-agl/templates/machine/h3ulcb/50_setup.sh
643 ~/workspace_agl ~/workspace_agl/build
644 ERROR: FILES "+/home/working/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
645 ERROR: FILES "+/home/working/Downloads/R-car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
646 The graphics and multimedia acceleration packages for
647 the R-Car Gen3 board BSP can be downloaded from:
648 <https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software>
649
650 These 2 files from there should be stored in your
651 '/home/working/Downloads' directory.
652     R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
653     R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
654 ERROR: Script /home/working/workspace_agl/build/conf/setup.sh failed
655 [snip]
656 ```
657
658 ### 4.3. Updating the Board's Firmware
659
660 Follow these steps to update the firmware:
661
662 1. **Update the Sample Loader and MiniMonitor:**
663
664     You only need to make these updates one time per device.
665
666     Follow the procedure found on the
667     eLinux.org wiki to update to at least version 3.02,
668     which is mandatory to run the AGL image
669     ([R-car loader update](https://elinux.org/R-Car/Boards/Kingfisher#How_to_update_of_Sample_Loader_and_MiniMonitor)).
670
671 2. **Update the Firmware Stack:**
672
673     You only need to update the firmware stack if you are
674     using the Eel or later (5.0) version of AGL software.
675
676     M3 and H3 Renesas board are AArch64 platforms.
677     As such, they have a firmware stack that is divided across: **ARM Trusted Firmware**, **OP-Tee** and **U-Boot**.
678
679     If you are using the Eel (5.0) version or later of the AGL software, you must update
680     the firmware using the **[h3ulcb] [R-car h3ulcb firmware update](http://elinux.org/R-Car/Boards/H3SK#Flashing_firmware)**
681     or **[m3ulcb] [R-car m3ulcb firmware update](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)** links from the
682     [Embedded Linux Wiki](https://www.elinux.org/Main_Page) (i.e. `elinux.org`).
683
684     The table in the wiki lists the files you need to flash the firmware.
685     You can find these files in the following directory:
686
687     ```sh
688     $AGL_TOP/build/tmp/deploy/images/$MACHINE
689     ```
690
691     **NOTE:** The Salvator-X firmware update process is not documented on eLinux.
692     **NOTE:** The AGL Reference Hardware board generally should not require a
693     firmware update to be usable, and has a slightly different update procedure.
694     If you do need to update the firmware, the procedure is documented
695     [here](https://git.automotivelinux.org/AGL/meta-agl-refhw/tree/meta-agl-refhw-gen3/docs/ReferenceHW_Rcar_gen3.md).
696
697 ### 4.4. Logging Into the Console
698
699 Once the board boots, you should see the
700 [Wayland display](https://en.wikipedia.org/wiki/Wayland_(display_server_protocol))
701 on the external monitor.
702 A login prompt should appear as follows depending on your board:
703
704 **h3ulcb** or **AGL Reference Hardware**:
705
706 ```text
707 Automotive Grade Linux ${AGL_VERSION} h3ulcb ttySC0
708
709 h3ulcb login: root
710 ```
711
712 At the prompt, login by using `root` as the login.
713 The password is "empty" so you should not be prompted for the password.
714
715 ### 4.5. Determining the Board's IP Address
716
717 If your board is connected to a local network using Ethernet and
718 if a DHCP server is able to distribute IP addresses,
719 you can determine the board's IP address and log in using `ssh`.
720
721 Here is an example for the **h3ulcb** board:
722
723 ```sh
724 h3ulcb login: root
725 Last login: Tue Dec  6 09:55:15 UTC 2016 on tty2
726 root@h3ulcb:~# ip -4 a
727 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
728     inet 127.0.0.1/8 scope host lo
729     valid_lft forever preferred_lft forever
730 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
731     inet 10.0.0.27/24 brd 10.0.0.255 scope global eth0
732     valid_lft forever preferred_lft forever
733 root@h3ulcb:~#
734 ```
735
736 In the previous example, IP address is 10.0.0.27.
737 Once you know the address, you can use `ssh` to login.
738 Following is an example that shows logging into SSH and then
739 displaying the contents of the `/etc/os-release` file:
740
741 ```sh
742 $ ssh root@10.0.0.27
743 Last login: Tue Dec  6 10:01:11 2016 from 10.0.0.13
744 root@h3ulcb:~# cat /etc/os-release
745 ID="poky-agl"
746 NAME="Automotive Grade Linux"
747 VERSION="11.0.0+snapshot-20210128 (koi)"
748 VERSION_ID="11.0.0-snapshot-20210128"
749 PRETTY_NAME="Automotive Grade Linux 11.0.0+snapshot-20210128 (koi)"
750 ```
751
752 ## 5. Supplementary Information
753
754 ### 5.1. R-Car Generation 3 Information
755
756 Refer to the [R-Car](https://elinux.org/R-Car) page on the
757 [elinux.org](https://elinux.org) website for more information.
758
759 ### 5.2. Proprietary libraries for meta-rcar-gen3
760
761 The meta-rcar-gen3 layer of meta-renesas supports Graphic GLES(GSX)
762 libraries, proprietary multimedia libraries, and ICCOM software.
763
764 ### 5.3. Build with Renesas multimedia libraries
765
766 Multimedia portions depend on GLES portions.
767
768 * A. Configuration for Multimedia features
769
770     * Please copy proprietary libraries to the directory of recipes.
771
772     * Please set local.conf the following.
773
774         **Enable multimedia features. This provides package group of plug-ins of the GStreamer, multimedia libraries and kernel drivers.**
775
776         ```sh
777         MACHINE_FEATURES:append = " multimedia"
778         ```
779
780 * B. Configuration for optional codecs and middleware
781
782     * Please copy proprietary libraries to the directory of recipes.
783
784     * Add features to `DISTRO_FEATURES:append` to local.conf
785
786         **Additional configuration in OMX module**:
787
788         ```text
789         " h263dec_lib"       - for OMX Media Component H263 Decoder Library
790         " h264dec_lib"       - for OMX Media Component H264 Decoder Library
791         " h264enc_lib"       - for OMX Media Component H.264 Encoder Library
792         " h265dec_lib"       - for OMX Media Component H265 Decoder Library
793         " mpeg2dec_lib"      - for OMX Media Component MPEG2 Decoder Library
794         " mpeg4dec_lib"      - for OMX Media Component MPEG4 Decoder Library
795         " vc1dec_lib"        - for OMX Media Component VC-1 Decoder Library
796         " divxdec_lib"       - for OMX Media Component DivX Decoder Library
797         " rvdec_lib"         - for OMX Media Component RealVideo Decoder Library
798         " alacdec_lib"       - for OMX Media Component ALAC Decoder Library
799         " flacdec_lib"       - for OMX Media Component FLAC Decoder Library
800         " aaclcdec_lib"      - for OMX Media Component AAC-LC Decoder Library
801         " aaclcdec_mdw"      - for AAC-LC 2ch Decoder Middleware for Linux
802         " aacpv2dec_lib"     - for OMX Media Component aacPlus V2 Decoder Library
803         " aacpv2dec_mdw"     - for aacPlus V2 Decoder Middleware for Linux
804         " mp3dec_lib"        - for OMX Media Component MP3 Decoder Library
805         " mp3dec_mdw"        - for MP3 Decoder Middleware for Linux
806         " wmadec_lib"        - for OMX Media Component WMA Standard Decoder Library
807         " wmadec_mdw"        - for WMA Standard Decoder Middleware for Linux
808         " dddec_lib"         - for OMX Media Component Dolby(R) Digital Decoder Library
809         " dddec_mdw"         - for Dolby(R) Digital Decoder Middleware for Linux
810         " aaclcenc_lib"      - for OMX Media Component AAC-LC Encoder Library
811         " vp8dec_lib"        - for OMX Media Component VP8 Decoder Library for Linux
812         " vp8enc_lib"        - for OMX Media Component VP8 Encoder Library for Linux
813         " vp9dec_lib"        - for OMX Media Component VP9 Decoder Library for Linux
814         " aaclcenc_mdw"      - for AAC-LC Encoder Middleware for Linux
815         " cmsbcm"            - for CMS Basic Color Management Middleware for Linux
816         " cmsblc"            - for CMS CMM3 Backlight Control Middleware for Linux
817         " cmsdgc"            - for CMS VSP2 Dynamic Gamma Correction Middleware for Linux
818         " dtv"               - for ISDB-T DTV Software Package for Linux
819         " dvd"               - for DVD Core-Middleware for Linux
820         " adsp"              - for ADSP driver, ADSP interface and ADSP framework for Linux
821         " avb"               - for AVB Software Package for Linux
822         ```
823
824         Example:
825
826         ```sh
827         DISTRO_FEATURES:append = " h264dec_lib h265dec_lib mpeg2dec_lib aaclcdec_lib aaclcdec_mdw"
828         ```
829
830 * C. Configuration for test packages
831
832     Must ensure that Multimedia features have been enabled.
833     (Please refer to III/A to enable Multimedia.)
834
835     * Please add feature to `DISTRO_FEATURES:append` to local.conf.
836
837         **Configuration for multimedia test package**
838
839         ```sh
840         DISTRO_FEATURES:append = " mm-test"
841         ```
842
843 ### 5.4. Enable Linux ICCOM driver and Linux ICCOM library
844
845 For Linux ICCOM driver and Linux ICCOM library
846
847 * Please copy proprietary libraries to the directory of recipes.
848
849 * Please set the following in local.conf:
850
851     ```sh
852     DISTRO_FEATURES:append = "iccom"
853     ```