diff options
Diffstat (limited to 'getting-started/machines')
-rw-r--r-- | getting-started/machines/R-Car-Starter-Kit-gen3.md | 420 |
1 files changed, 256 insertions, 164 deletions
diff --git a/getting-started/machines/R-Car-Starter-Kit-gen3.md b/getting-started/machines/R-Car-Starter-Kit-gen3.md index 9ac8ae0..523a6b9 100644 --- a/getting-started/machines/R-Car-Starter-Kit-gen3.md +++ b/getting-started/machines/R-Car-Starter-Kit-gen3.md @@ -1,31 +1,38 @@ -# Renesas R-Car Starter Kit gen 3 (h3ulcb, m3ulcb) Hardware setup -Here is a non exhaustive list of hardware parts that could be used to setup the Starter Kit gen 3 board development environment: -* Starter Kit gen 3 board with its power supply +# AGL Kickstart on Renesas R-Car Starter Kit Gen3 (h3ulcb, m3ulcb) + +Here is a non exhaustive list of hardware parts that could be used to setup the R-Car Starter Kit Gen3 board development environment: + +* Starter Kit Gen3 board with its power supply * mini USB-A cable for serial console * USB 2.0 Hub * Ethernet cable * HDMI type D (Micro connector) cable and associated display * micro-SD Card (at least 4GB) -* USB touch screen device like the GeChic 1502i +* USB touch screen device like the GeChic 1502i (optional) For more information and latest news, please check : -* For h3ulcb [Here][R-car h3ulcb] -* For m3ulcb [Here][R-car m3ulcb] + +* [elinux page for h3ulcb][R-car h3ulcb] +* [elinux page for m3ulcb][R-car m3ulcb] The following documents may also be helpful: -* Yocto-Gen3 on elinux [Link][R-car yocto] -# Building the AGL Demo Platform for R-Car Starter Kit gen 3 -Before set up Build Environment you need to setup the proprietary drivers. +* [Yocto-Gen3 on elinux][R-car yocto] + +# Building the AGL Demo Platform for R-Car Starter Kit Gen3 + +Before setting up the build environment, you need to download the proprietary drivers. + * Download Renesas graphics drivers with a "click through" license from Renesas website [Link][rcar demoboard] * Under the Target hardware: **R-Car H3/M3** section. #### Note: -* That you have to register with a free account on MyRenesas and accept the license condition before downloading them. + +* You have to register with a free account on MyRenesas and accept the license conditions before downloading them the drivers. The operation is fast and simple but nevertheless mandatory to access evaluation of non open-source drivers for free. Once you registered, you can download two zip files. -* The files must be store into directory ~/Downloads (or $XDG_DOWNLOAD_DIR). -Here after is an example of their names: +* The files must be stored into your download directory (usually $HOME/Downloads, pointed by $XDG_DOWNLOAD_DIR). +Here after is an example of the typical files downloaded at the time of writing: ``` chmod a+r $XDG_DOWNLOAD_DIR/*.zip ls -l $XDG_DOWNLOAD_DIR @@ -34,26 +41,32 @@ total 8220 -rw-r--r-- 1 XXX XXX 4619796 10 oct. 23:23 R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20160906.zip ``` -### Set up Build Environment: -* To build AGL demo platform for R-Car Starter Kit gen 3 board feature **agl-demo** and : - * for machine **h3ulcb** : - ``` - export MACHINE=h3ulcb - ``` - * for machine **m3ulcb** : - ``` - export MACHINE=m3ulcb - ``` +## Setting up the build environment: + +Define the type of R-Car Starter Kit board as a variable: + +* for machine **h3ulcb** (Starter Kit Premier/H3) : + + ``` +export MACHINE=h3ulcb + ``` + +* for machine **m3ulcb** (Starter Kit Pro/M3): + + ``` +export MACHINE=m3ulcb + ``` + + +Now, init your build environment: -* Now init your build environement: ``` cd $AGL_TOP source meta-agl/scripts/aglsetup.sh -m $MACHINE -b build agl-devel agl-demo agl-netboot agl-appfw-smack ``` -#### Note: -* **IMPORTANT** read the log to be sure to have any error during your setup. -In case graphical drivers were not found, you could notice an error message as follow: +**IMPORTANT NOTE**: Read the log to be sure you had no error during your setup. +In case of missing graphics drivers, you could notice an error message as follow: ``` [snip] @@ -73,9 +86,11 @@ Generating setup file: /home/working/workspace_agl_master/build_gen3/agl-init-bu ------------ aglsetup.sh: Done [snip] ``` -* If you encounters this issue, or any other unwanted behavior, you can fix the error mentioned and then clean up by removing the “$AGL_TOP/build” directory then launch the procedure again. -* After this command, the working directory is changed to $AGL_TOP/build. -* Users may want to check that the board is correctly selected in the environment: +If you encounter this issue, or any other unwanted behavior, you can fix the error mentioned and then clean up by removing the “$AGL_TOP/build” directory then re-launch the procedure again. + +After this command, the working directory is changed to $AGL_TOP/build. + +Users may want to check that the board is correctly selected in the environment: ``` grep -w -e "^MACHINE =" $AGL_TOP/build/conf/local.conf @@ -83,39 +98,46 @@ grep -w -e "^MACHINE =" $AGL_TOP/build/conf/local.conf or MACHINE = "m3ulcb" ``` -* Configure for Release or Development: -Development images require extra tools for developer convenience, in particular: - * a debugger (gdb) - * some tweaks, including a disabled root password - * a SFTP server - * the TCF Agent for easier application deployment and remote debugging - * ... - -We explicitely activate these Debug facilities by specifying the “agl-devel agl-netboot” feature. - -### Build your image: + +Configure for Release or Development: development images contain extra tools for developer convenience, in particular: + * a debugger (gdb) + * some tweaks, including a disabled root password + * a SFTP server + * the TCF Agent for easier application deployment and remote debugging + * some extra system tools (usb, bluetooth ...) + * ... + +We explicitely activate these debug facilities by specifying the “agl-devel agl-netboot” feature. + +## Build your image: + The process to build an image is simple: + ``` bitbake agl-demo-platform ``` -Once done, what may take up to few hours, you should get the end result in the directory: + +When finished (it may take few hours), you should get the final result: + ``` ls -l $AGL_TOP/build/tmp/deploy/images/$MACHINE ``` -#### Note: -* In case of failure of the build it is safe to first check that the Linux distribution chosen for your host has been validated for version 2.1 of Yocto. -# Booting AGL Demo Platform on R-Car Starter Kit gen 3 using a micro-SD card +#### Note +In case of failure of the build it is safe to first check that the Linux distribution chosen for your host has been validated for version 2.1 of Yocto. + +# Booting AGL Image on R-Car Starter Kit Gen3 boards using a microSD card + To boot the board using a micro-SD card, there are two operations that should be done prior to first initial boot: -* Create a SD-card with one ext3 partition, + +* Create a SD-card with one ext4 partition, * Set up the board to boot on the SD-card. -Then for each build, the SD-card is merely rewritten and used to boot the configured board. -## Deployment +Then, for each build, the SD-card is merely rewritten and used to boot the configured board. -### Format the SD-card on the host +## Prepare the SD-card on the host -* Plug microSD card and get its associated device by either running *dmesg | tail -15* or *lsblk*, for example: +Plug the microSD card and get its associated device by either running *dmesg | tail -15* or *lsblk*, for example: ``` dmesg | tail -15 @@ -125,7 +147,8 @@ dmesg | tail -15 [ 1971.462278] sd 6:0:0:0: [sdc] Assuming drive cache: write through [ 1971.463870] sdc: sdc1 sdc2 ``` -Here, the SD-card is attached to the device sdc. + +Here, the SD-card is attached to the device /dev/sdc. ``` lsblk @@ -141,14 +164,17 @@ lsblk ├─sdc1 8:33 1 40M 0 part └─sdc2 8:34 1 788M 0 part ``` -#### Note: -* **WARNING** This is a critical operation, each computer is different and device can change during time, so do this operation each time you incert the microSD card. -* In the **example** above, we see the first SATA drive as 'sda'. -* In the **example** above, 'sdc' corresponds to the microSD card.* -### Format the SD-card -* Create EXT3 partition on the SD-card using fdisk and set the MBR. - * For **example**, if the microSD card is */dev/sdc*: +** IMPORTANT NOTE **: This is a critical operation, each computer is different and removable devices can change from time to time: so you should repeat this operation each time you insert the microSD card to confirm the device name. + +In the example above, we see: +* the first SATA drive as 'sda'. +* 'sdc' corresponds to the microSD card, and is also marked as removable device by *lsblk* which is a good confirmation. + +### Partition and format the SD-card + +* Create an EXT4 partition on the SD-card using fdisk and set the MBR. +For example, if the microSD card is */dev/sdc*: ``` sudo fdisk /dev/sdc @@ -179,11 +205,10 @@ sudo fdisk /dev/sdc Calling ioctl() to re-read partition table. Syncing disks. ``` -* Initialize the ext3 partition using “mke2fs”: - * for **example** if the microSD card is associated with *sdc*: +* Initialize the ext4 partition using “mke2fs”; for example, if the microSD card is associated with *sdc*: ``` -sudo mke2fs -t ext3 /dev/sdc1 +sudo mke2fs -t ext4 /dev/sdc1 mke2fs 1.42.13 (17-May-2015) Creating filesystem with 3911168 4k blocks and 979200 inodes @@ -198,10 +223,12 @@ sudo mke2fs -t ext3 /dev/sdc1 ``` ### Copying the built image to the SD-card + Insert the SD-card into your build host: -* Your desktop system may probably offer a choice to mount the SD-card automatically in some directory. + +* Your desktop system probably offers a choice to mount the SD-card automatically in some directory. * In the next sample code, we'll suppose that the SD-card mount directory is stored in the variable $SDCARD. -* For example **example** the microSD card is associated with device *sdc*: +* For example, if the microSD card is associated with device *sdc*: ``` export SDCARD=/tmp/agl @@ -220,14 +247,15 @@ Make sure the filesystem is empty: ``` sudo rm -rf ${SDCARD:-bad_dir}/* ``` -*** IMPORTANT *** -Verify that **tar** version is 1.28 or newer: + +** IMPORTANT NOTE **: Verify that **tar** version is 1.28 or newer: this is required to create extended attributes correctly on the SD-card, and in particular SMACK labels used to enforce security. Check with the following command: ``` tar --version tar (GNU tar) 1.28 [snip] ``` + If your distribution is up to date on this dependency, you can use the host tool directly. Let's define a variable for the following steps: ``` @@ -263,112 +291,36 @@ Ensure the changes have been written to the disk: ``` sync ``` - Unmount the micrSD card: - -``` -sudo umount $SDCARD -``` -### Configure U-boot on the board -* Turn the board on using the power switch. -* Hit any key to stop autoboot (warning you have only few seconds). -* Check if you have correct parameters for booting your board: - * For machine m3ulcb: -``` -=> print - baudrate=115200 - bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext3 - 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/Image-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 -``` - * For machine h3ulcb: -``` -=> printenv - baudrate=115200 - bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext3 - 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/Image-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) +Unmount the microSD card: - Environment size: 557/131068 bytes -``` - -* If not copy line by line: - -``` -setenv bootargs console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext3 -setenv bootcmd run load_ker\; run load_dtb\; booti 0x48080000 - 0x48000000 -setenv load_ker ext4load mmc 0:1 0x48080000 /boot/Image -saveenv -``` - * For machine h3ulcb: -``` -setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb -``` - * For machine m3ulcb: ``` -setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/Image-r8a7796-m3ulcb.dtb +sudo umount $SDCARD ``` -* Now you can boot: - -``` -run bootcmd -``` +## Booting the board -### Booting the board * Turn the board off using the power switch. * Insert the microSD-card. * Verify that you have plugged in, at least, the following: - * External monitor on HDMI port - * Input device (keyboard, mouse, touchscreen...) on USB port. + * External monitor on HDMI port + * Input device (keyboard, mouse, touchscreen...) on USB port. * Turn the board on using the power switch. -After a few seconds, you'll see the AGL splash screen on the display and you'll be able to log in on the console terminal. -(login is 'root', no password) +After a few seconds, you'll see the AGL splash screen on the display and you'll be able to log in on the console terminal or in the graphic screen. -* For machine h3ulcb: +# Serial Console Setup -``` -Automotive Grade Linux 3.0.0+snapshot-20161201 h3ulcb ttySC0 +## Install a serial client on your computer. -h3ulcb login: root -``` - -* For machine m3ulcb: - -``` -Automotive Grade Linux 3.0.0+snapshot-20161201 m3ulcb ttySC0 - -m3ulcb login: root -``` - -### To access the shell (serial) -* Install a serial client on your computer. This can be “screen”, “picocom”, “minicom”. The lighter of the 3 is “picocom” (it has less dependencies). -* Plug a USB cable from your computer to the serial CP2102 USB port (mini USB-A). -With “dmesg” you can check the device created for the serial link. -To get it, you must switch the board on. + +## Plug a USB cable from your computer to the serial CP2102 USB port (mini USB-A). + +With “dmesg” you can check the device created for the serial link. Usually, it's /dev/ttyUSB0 but the number may vary depending on other USB serial ports connected to the host. To get it, you must switch the board on. For example: + ``` dmesg | tail [2097783.287091] usb 2-1.5.3: new full-speed USB device number 24 using ehci-pci @@ -381,22 +333,29 @@ dmesg | tail [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 link is attached to the device /dev/ttyUSB0. It is time to launch your serial client. Example: + ``` picocom -b 38400 /dev/ttyUSB0 ``` + or + ``` minicom -b 38400 -D /dev/ttyUSB0 ``` + or + ``` screen /dev/ttyUSB0 38400 ``` -Power on the board to see a shell on the console +## Power on the board to see a shell on the console + * For machine h3ulcb: ``` @@ -436,6 +395,7 @@ No ethernet found. Hit any key to stop autoboot: 0 => ``` + * For machine m3ulcb: ``` @@ -476,12 +436,81 @@ Hit any key to stop autoboot: 0 => ``` -### U-Boot screen configurations +## Configure U-boot parameters -Follow the steps below to configure boot from microSD card and to set screen resolution: +* Turn the board on using the power switch. +* Hit any key to stop autoboot (warning you have only few seconds). +* Check if you have correct parameters for booting your board: + * For machine m3ulcb: + ``` +=> print + baudrate=115200 + bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw 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/Image-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 + ``` -* Power up the board and, using your preferred terminal emulator. -* Type a character to abort the boot and enter the U-boot menu. + * For machine h3ulcb: + ``` +=> printenv + baudrate=115200 + bootargs=console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw 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/Image-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 + ``` + + * If not, copy line by line: + ``` +setenv bootargs console=ttySC0,115200 root=/dev/mmcblk1p1 rootwait rw rootfstype=ext4 +setenv bootcmd run load_ker\; run load_dtb\; booti 0x48080000 - 0x48000000 +setenv load_ker ext4load mmc 0:1 0x48080000 /boot/Image + ``` + * For machine h3ulcb: + ``` +setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/Image-r8a7795-h3ulcb.dtb + ``` + * For machine m3ulcb: + ``` +setenv load_dtb ext4load mmc 0:1 0x48000000 /boot/Image-r8a7796-m3ulcb.dtb + ``` + * Finally save boot environment: + ``` +saveenv + ``` + +* Now you can boot: + +``` +run bootcmd +``` + +### U-Boot screen configuration + +Follow the steps below to configure the boot from microSD card and to set screen resolution: + +* Power up the board +* Using your preferred terminal emulator, type a character to abort the boot and enter the U-boot menu * Type **print** to check the environment: ``` @@ -489,7 +518,7 @@ print ``` * Verify that the ethaddr environment variable is set to the same MAC address value shown on the label on top of the RJ45 Ethernet connector. -* If not please set it using the following command: +* If not, set it using the following command: ``` setenv ethaddr <MAC address> @@ -506,14 +535,14 @@ setenv ethaddr 2e:09:0a:00:75:b5 ``` setenv bootargs_console 'console=ttySC6,38400 ignore_loglevel' setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60' -setenv bootargs_root 'root=/dev/mmcblk0p1 rootdelay=3 rw rootfstype=ext3 rootwait' +setenv bootargs_root 'root=/dev/mmcblk0p1 rootdelay=3 rw rootfstype=ext4 rootwait' setenv bootmmc '1:1' setenv bootcmd_sd 'ext4load mmc ${bootmmc} 0x40007fc0 boot/uImage+dtb' setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root}; run bootcmd_sd; bootm 0x40007fc0' ``` **WARNINGS:** -* If no display shows up when booting, e.g. for a non-full HD screen, replace **1920x1080** value in the **bootargs_video** variable with lower screen resolution such as **1024x768**. - Unfortunately for the moment there are no universally supported setting. +If no display shows up when booting, e.g. for a non-full HD screen, replace **1920x1080** value in the **bootargs_video** variable with lower screen resolution such as **1024x768**. + Unfortunately at the moment, there is no universally supported setting. For Renesas h3ulcb use screen resolution **1024x768** and set **bootmmc** to **2:1**. @@ -532,14 +561,77 @@ saveenv reset ``` -### More Documentation -Detailed guide on how to build AGL for Renesas boards and using AGL SDK inside a ready-to-use Docker container. +## Console boot + +After booting, you should see the wayland display on the external monitor and a login prompt on the console, such as: + +* For machine h3ulcb: + +``` +Automotive Grade Linux 3.0.0+snapshot-20161201 h3ulcb ttySC0 + +h3ulcb login: root +``` + +* For machine m3ulcb: + +``` +Automotive Grade Linux 3.0.0+snapshot-20161201 m3ulcb ttySC0 + +m3ulcb login: root +``` + +Logging in on the console is easy: +* login is 'root' +* password is empty (not asked) + +## Network access + +If the board is connected to a local network using ethernet and if a DHCP server is able to distribute IP addresses, +you can then determine the Gen3 board IP address and log in using ssh: + +``` +m3ulcb login: root +Last login: Tue Dec 6 09:55:15 UTC 2016 on tty2 +root@m3ulcb:~# ip -4 a +1: lo: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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:~# +``` + +Here, IP address is 10.0.0.27. Logging in using SSH is easy: +``` +$ 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)" +``` + +# More Documentation + +Detailed guides on how to build AGL for Renesas boards and using AGL SDK inside a ready-to-use Docker container: + * [AGL-Devkit-Build-your-1st-AGL-Application.pdf][Iot.bzh AGL-Devkit-Build-your-1st-AGL-Application] Generic guide on how to build various application types (HTML5, native, Qt, QML, …) for AGL. * [AGL-Devkit-HowTo_bake_a_service.pdf][Iot.bzh AGL_Phase2-Devkit-HowTo_bake_a_service] Generic guide on how to add a new service in the BSP. +* [AGL-Kickstart-on-Renesas-Porter-Board.pdf][Iot.bzh AGL-Kickstart-on-Renesas-Porter-Board] +* [AGL-Devkit-Image-and-SDK-for-Porter.pdf][Iot.bzh AGL-Devkit-Image-and-SDK-for-Porter] +* [AGL Developer Website](http://docs.automotivelinux.org) [R-car m3ulcb]: http://elinux.org/R-Car/Boards/M3SK [R-car h3ulcb]: http://elinux.org/R-Car/Boards/H3SK [R-car yocto]: http://elinux.org/R-Car/Boards/Yocto-Gen3 [rcar demoboard]: https://www.renesas.com/en-eu/solutions/automotive/rcar-demoboard.html +[Iot.bzh AGL-Kickstart-on-Renesas-Porter-Board]: http://docs.automotivelinux.org/docs/devguides/en/dev/reference/iotbzh2016/sdk/AGL-Kickstart-on-Renesas-Porter-board.pdf +[Iot.bzh AGL-Devkit-Image-and-SDK-for-Porter]: http://docs.automotivelinux.org/docs/devguides/en/dev/reference/iotbzh2016/sdk/AGL-Devkit-Image-and-SDK-for-porter.pdf +[Iot.bzh AGL-Devkit-Build-your-1st-AGL-Application]: http://docs.automotivelinux.org/docs/devguides/en/dev/reference/iotbzh2016/sdk/AGL-Devkit-Build-your-1st-AGL-Application.pdf +[Iot.bzh AGL_Phase2-Devkit-HowTo_bake_a_service]: http://docs.automotivelinux.org/docs/devguides/en/dev/reference/iotbzh2016/bsp/AGL_Phase2-Devkit-HowTo_bake_a_service.pdf |