/tmp/deploy/images/$MACHINE
```
## 7. Booting the Image Using a MicroSD Card
To boot your image on the Renesas board, you need to do three things:
1. Update all firmware on the board.
2. Prepare the MicroSD card to you can boot from it.
3. Boot the board.
**NOTE:** For subsequent builds, you only have to re-write the MicroSD
card with a new image.
### Updating the Board's Firmware
Follow these steps to update the firmware:
1. **Update the Sample Loader and MiniMonitor:**
You only need to make these updates one time per device.
Follow the procedure found on the
eLinux.org wiki to update to at least version 3.02,
which is mandatory to run the AGL image ([R-car loader update](https://elinux.org/R-Car/Boards/Kingfisher#How_to_update_of_Sample_Loader_and_MiniMonitor)).
2. **Update the Firmware Stack:**
You only need to update the firmware stack if you are
using the Eel or later (5.0) version of AGL software.
M3 and H3 Renesas board are AArch64 platforms.
As such, they have a firmware stack that is divided across: **ARM Trusted Firmware**, **OP-Tee** and **U-Boot**.
If you are using the Eel (5.0) version or later of the AGL software, you must update
the firmware using the **[h3ulcb][R-car h3ulcb firmware update](http://elinux.org/R-Car/Boards/H3SK#Flashing_firmware)**
or **[m3ulcb][R-car m3ulcb firmware update](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)** links from the
[Embedded Linux Wiki](https://www.elinux.org/Main_Page) (i.e. `elinux.org`).
The table in the wiki lists the files you need to flash the firmware.
You can find these files in the following directory:
```bash
$AGL_TOP/build/tmp/deploy/images/$MACHINE
```
**NOTE:** The Salvator-X firmware update process is not documented on eLinux.
### Preparing the MicroSD Card
Plug the MicroSD card into your Build Host.
After plugging in the device, use the `dmesg` command as follows to
discover the device name:
$ dmesg | tail -4
[ 1971.462160] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 1971.462277] sd 6:0:0:0: [sdc] No Caching mode page found
[ 1971.462278] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 1971.463870] sdc: sdc1 sdc2
In the previous example, the MicroSD card is attached to the device `/dev/sdc`.
You can also use the `lsblk` command to show all your devices.
Here is an example that shows the MicroSD card as `/dev/sdc`:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 167,7G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 159,3G 0 part /
└─sda3 8:3 0 7,9G 0 part [SWAP]
sdb 8:16 0 931,5G 0 disk
└─sdb1 8:17 0 931,5G 0 part /media/storage
sdc 8:32 1 14,9G 0 disk
├─sdc1 8:33 1 40M 0 part
└─sdc2 8:34 1 788M 0 part
**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`.
* `/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.
Now that you have identified the device you are going to be writing the image on,
you can use the `bmaptool` to copy the image to the MicroSD card.
Your desktop system might offer a choice to mount the MicroSD automatically
in some directory.
For this example, assume that the MicroSD card mount directory is stored in the
`$SDCARD` variable.
Following are example commands that write the image to the MicroSD card:
```bash
cd $AGL_TOP/build/tmp/deploy/images/$MACHINE
bmaptool copy ./agl-demo-platform-$MACHINE.wic.xz $SDCARD
```
Alternatively, you can leave the image in an uncompressed state and write it
to the MicroSD card:
```bash
sudo umount /dev/sdc
xzcat ./agl-demo-platform-$MACHINE.wic.xz | sudo dd of=$SDCARD bs=4M
sync
```
### Booting the Board
Follow these steps to boot the board:
1. Use the board's power switch to turn off the board.
2. Insert the MicroSD card into the board.
3. Verify that you have plugged in the following:
* An external monitor into the board's HDMI port
* An input device (e.g. keyboard, mouse, touchscreen, and so forth) into the board's USB ports.
4. Use the board's power switch to turn on the board.
After a few seconds, you will see the AGL splash screen on the display and you
will be able to log in at the console's terminal or using the graphic screen.
## 8. Setting Up the Serial Console
Setting up the Serial Console involves the following:
* Installing a serial client on your build host
* Connecting your build host to your Renesas board's serial port
* Powering on the board to get a shell at the console
* Configuring U-Boot parameters
* Logging into the console
* Determining the board's IP address
### Installing a Serial Client on Your Build Host
You need to install a serial client on your build host.
Some examples are
[GNU Screen](https://en.wikipedia.org/wiki/GNU_Screen),
[picocom](https://linux.die.net/man/8/picocom),
and
[Minicom](https://en.wikipedia.org/wiki/Minicom).
Of these three, "picocom" has less dependencies and is therefore
considered the "lightest" solution.
### Connecting Your Build Host to Your Renesas Board's Serial Port
You need to physically connect your build host to the Renesas board using
a USB cable from the host to the serial CP2102 USP port (i.e. Micro USB-A port)
on the Renesas board.
Once you connect the board, determine the device created for the serial link.
Use the ``dmesg`` command on your build host.
Here is an example:
dmesg | tail 9
[2097783.287091] usb 2-1.5.3: new full-speed USB device number 24 using ehci-pci
[2097783.385857] usb 2-1.5.3: New USB device found, idVendor=0403, idProduct=6001
[2097783.385862] usb 2-1.5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2097783.385864] usb 2-1.5.3: Product: FT232R USB UART
[2097783.385866] usb 2-1.5.3: Manufacturer: FTDI
[2097783.385867] usb 2-1.5.3: SerialNumber: AK04WWCE
[2097783.388288] ftdi_sio 2-1.5.3:1.0: FTDI USB Serial Device converter detected
[2097783.388330] usb 2-1.5.3: Detected FT232RL
[2097783.388658] usb 2-1.5.3: FTDI USB Serial Device converter now attached to ttyUSB0
The device created is usually "/dev/ttyUSB0".
However, the number might vary depending on other USB serial ports connected to the host.
To use the link, you need to launch the client.
Here are three commands, which vary based on the serial client, that show
how to launch the client:
```bash
picocom -b 115200 /dev/ttyUSB0
```
or
```bash
minicom -b 115200 -D /dev/ttyUSB0
```
or
```bash
screen /dev/ttyUSB0 115200
```
### Powering on the Board to Get a Shell at the Console
Both the Pro and Premier kits (e.g.
[m3ulcb](https://elinux.org/R-Car/Boards/M3SK) and
[h3ulcb](https://elinux.org/R-Car/Boards/H3SK#Hardware)) have nine
switches (SW1 through SW9).
To power on the board, "short-press" SW8, which is the power switch.
Following, is console output for the power on process for each kit:
h3ulcb:
NOTICE: BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.7
NOTICE: BL2: PRR is R-Car H3 ES1.1
NOTICE: BL2: LCM state is CM
NOTICE: BL2: DDR1600(rev.0.15)
NOTICE: BL2: DRAM Split is 4ch
NOTICE: BL2: QoS is Gfx Oriented(rev.0.30)
NOTICE: BL2: AVS setting succeeded. DVFS_SetVID=0x52
NOTICE: BL2: Lossy Decomp areas
NOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
NOTICE: BL2: v1.1(release):41099f4
NOTICE: BL2: Built : 19:20:52, Jun 9 2016
NOTICE: BL2: Normal boot
NOTICE: BL2: dst=0xe63150c8 src=0x8180000 len=36(0x24)
NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=3072(0xc00)
NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
NOTICE: BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
NOTICE: BL2: dst=0x49000000 src=0x8640000 len=1048576(0x100000)
U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
CPU: Renesas Electronics R8A7795 rev 1.1
Board: H3ULCB
I2C: ready
DRAM: 3.9 GiB
MMC: sh-sdhi: 0, sh-sdhi: 1
In: serial
Out: serial
Err: serial
Net: Board Net Initialization Failed
No ethernet found.
Hit any key to stop autoboot: 0
=>
m3ulcb:
NOTICE: BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.14
NOTICE: BL2: PRR is R-Car M3 Ver1.0
NOTICE: BL2: Board is Starter Kit Rev1.0
NOTICE: BL2: Boot device is HyperFlash(80MHz)
NOTICE: BL2: LCM state is CM
NOTICE: BL2: AVS setting succeeded. DVFS_SetVID=0x52
NOTICE: BL2: DDR1600(rev.0.22)NOTICE: [COLD_BOOT]NOTICE: ..0
NOTICE: BL2: DRAM Split is 2ch
NOTICE: BL2: QoS is default setting(rev.0.17)
NOTICE: BL2: Lossy Decomp areas
NOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570
NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0
NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0
NOTICE: BL2: v1.3(release):4eef9a2
NOTICE: BL2: Built : 00:25:19, Aug 25 2017
NOTICE: BL2: Normal boot
NOTICE: BL2: dst=0xe631e188 src=0x8180000 len=512(0x200)
NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)
NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)
NOTICE: BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000)
NOTICE: BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)
U-Boot 2015.04-dirty (Aug 25 2017 - 10:55:49)
CPU: Renesas Electronics R8A7796 rev 1.0
Board: M3ULCB
I2C: ready
DRAM: 1.9 GiB
MMC: sh-sdhi: 0, sh-sdhi: 1
In: serial
Out: serial
Err: serial
Net: ravb
Hit any key to stop autoboot: 0
=>
## 9. Setting-up U-boot
### Configuring U-Boot Parameters
Follow these steps to configure the board to use the MicroSD card as the
boot device and also to set the screen resolution:
1. As the board is powering up, press any key to stop the autoboot process.
You need to press a key quickly as you have just a few seconds in which to
press a key.
2. Once the autoboot process is interrupted, use the board's serial console to
enter **printenv** to check if you have correct parameters for booting your board:
Here is an example using the **h3ulcb** board:
=> printenv
baudrate=115200
bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait ro rootfstype=ext4
bootcmd=run load_ker; run load_dtb; booti 0x48080000 - 0x48000000
bootdelay=3
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb.dtb
load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 2015.04 (Jun 09 2016 - 19:21:52)
Environment size: 648/131068 bytes
Here is a second example using the **m3ulcb** board:
=> printenv
baudrate=115200
bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait ro rootfstype=ext4
bootcmd=run load_ker; run load_dtb; booti 0x48080000 - 0x48000000
bootdelay=3
fdt_high=0xffffffffffffffff
filesize=cdeb
initrd_high=0xffffffffffffffff
load_dtb=ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb.dtb
load_ker=ext4load mmc 0:1 0x48080000 /boot/Image
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 2015.04 (Nov 30 2016 - 18:25:18)
Environment size: 557/131068 bytes
3. To boot your board using the MicroSD card, be sure your environment is set up
as follows:
```bash
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
setenv bootcmd run load_ker\; run load_dtb\; booti 0x48080000 - 0x48000000
setenv load_ker ext4load mmc 0:1 0x48080000 /boot/Image
```
4. Depending on the board type, the BSP version, and the existence of
a Kingfisher board, make sure your ``load_dtb`` is set as follows:
**h3ulcb with BSP version greater than or equal to 2.19**:
```bash
setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-es1-h3ulcb.dtb
```
**h3ulcb with BSP version less than 2.19**:
```bash
setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-h3ulcb.dtb
```
**m3ulcb**:
```bash
setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb.dtb
```
**m3ulcb with a Kingfisher board**:
```bash
setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7796-m3ulcb-kf.dtb
```
**h3ulcb with a Kingfisher board**:
```bash
setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/r8a7795-es1-h3ulcb-kf.dtb
```
5. Save the boot environment:
```bash
saveenv
```
6. Boot the board:
```bash
run bootcmd
```
## 10. Troubleshooting
### Logging Into the Console
Once the board boots, you should see the
[Wayland display](https://en.wikipedia.org/wiki/Wayland_(display_server_protocol))
on the external monitor.
A login prompt should appear as follows depending on your board:
**h3ulcb**:
```bash
Automotive Grade Linux ${AGL_VERSION} h3ulcb ttySC0
h3ulcb login: root
```
**m3ulcb**:
```bash
Automotive Grade Linux ${AGL_VERSION} m3ulcb ttySC0
m3ulcb login: root
```
At the prompt, login by using `root` as the login.
The password is "empty" so you should not be prompted for the password.
### Determining the Board's IP Address
If your board is connected to a local network using Ethernet and
if a DHCP server is able to distribute IP addresses,
you can determine the board's IP address and log in using `ssh`.
Here is an example for the m3ulcb board:
m3ulcb login: root
Last login: Tue Dec 6 09:55:15 UTC 2016 on tty2
root@m3ulcb:~# ip -4 a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
3: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 10.0.0.27/24 brd 10.0.0.255 scope global eth0
valid_lft forever preferred_lft forever
root@m3ulcb:~#
In the previous example, IP address is 10.0.0.27.
Once you know the address, you can use `ssh` to login.
Following is an example that shows logging into SSH and then
displaying the contents of the `/etc/os-release` file:
$ ssh root@10.0.0.27
Last login: Tue Dec 6 10:01:11 2016 from 10.0.0.13
root@m3ulcb:~# cat /etc/os-release
ID="poky-agl"
NAME="Automotive Grade Linux"
VERSION="3.0.0+snapshot-20161202 (chinook)"
VERSION_ID="3.0.0-snapshot-20161202"
PRETTY_NAME="Automotive Grade Linux 3.0.0+snapshot-20161202 (chinook)"
**NOTE:** More generics troubleshooting can be found here : [Generic issues](../troubleshooting.html)