R-Car/Boards/Kingfisher/Android/Android P

From eLinux.org
< R-Car‎ | Boards/Kingfisher‎ | Android
Revision as of 22:42, 30 September 2020 by Y.H. (talk | contribs) (Building from the source: Separate chapter "Host PC" from "Required Packages")
Jump to: navigation, search


This page contains information on building and running Android on:

Note Note: Only R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.


SW Release Information

Board name SW name Release date Note
R-Car Starter Kit ( Premier / Pro ) Yocto v4.1.0 2020/08/06 This version does not support MMP.
GFX(except for Wayland/weston) is supported from 2020/09/23.
Yocto v3.21.0 2019/07/09 New R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/07/10.
Kingfisher Infotainment Board Android P [New!!] 2020/09/29 Only R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
Yocto v3.21.0 2019/08/07 To check for latest information, please refer to the meta-rcar.
New R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/08/02.
Yocto v4.1.0 2020/10/23 This version does not support MMP.

The URL for downloading "Multimedia and Graphics library and related Linux drivers" has changed.
[OLD] https://www.renesas.com/us/en/solutions/automotive/rcar-download/rcar-demoboard.html
[NEW] https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software

Building from the source

Host PC

Ubuntu 16.04 LTS (64bit) is recommended as an OS for building Android(Ubuntu 18.04 and 20.04 are also supported).
Building Android BSP requires a lot of RAM at least 16GB.
32bit version is not supported.

Required packages

# Install basic dependencies
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk git-core gnupg flex bison \
gperf build-essential zip curl zlib1g-dev gcc-multilib ccache \
g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev \
libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils liblz4-tool \
xsltproc unzip python-networkx python-wand python-crypto liblz4-tool bc

Detailed environment configuration description can be found in Google Android setup guide:

Downloading repo tool

$ mkdir <your work directory>
$ cd <your work directory>
$ export workdirectory=$(pwd)
$ curl http://commondatastorage.googleapis.com/\
git-repo-downloads/repo > ./repo
$ chmod +x ./repo
$ export PATH=$(pwd):${PATH}

Unpack Android Package

Unpack the Renesas Android package to workspace.
# DL from below URL to your ${workdirectory}

Download file:
  • R-Car_H3_INF_Software_package_for_Android_P_v5.3.0.zip(Gen3_Android_v5.3.0.zip)
$ cd ${workdirectory}
$ unzip Gen3_Android_v5.3.0.zip
$ unzip OSS_Package/Gen3_Android_v5.3.0.zip -d OSS_Package
$ unzip Software/SV00_Android530Software_001.zip -d Software
$ unzip OSS_Package/Gen3_Android_v5.3.0/RENESAS_RCH3_Android_P_2019_08E.zip

Preparing OpenMAX (OMX), Graphics(GFX) library package

Copy Proprietary Software Packages (OMX and GFX) to pkgs_dir:

$ cd ${workdirectory}/RENESAS_RCH3_Android_P_2019_08E
$ export workspace=$(pwd)
$ cp -r ${workdirectory}/Software/proprietary/pkgs_dir . 
 |  |--INFRTM0RC7795GQGG0001SA90C_1_1_0.zip 
 |  |--RCH3G001A9001ZDO_1_1_0.zip 
 |  |--RCG3VUDRA9001ZDO_3_0_19.zip 
 |  |--RTM0AC0000XCMCTL30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XV263D30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XV264D30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XV264E30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XV265D30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XVCMND30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XVCMNE30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XVM4VD30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XVVP8D30SA90C_3_0_19.zip 
 |  |--RTM0AC0000XVVP8E30SA90C_3_0_19.zip

Unpacking Android sources

$ cd ${workspace}
$ chmod +x walkthrough.sh
$ HAVE_ADSP=NO ./walkthrough.sh H3

Building the BSP for R-Car Starter Kit Premier(H3)

Please check additional build options and apply any if needed prior to starting the build process.

$ cd ${workspace}/mydroid
# Set Android build environment
$ export TARGET_BOARD_PLATFORM=r8a7795

# Please set H3_OPTION variables. 
# 4GB DDR case
$ export H3_OPTION=4GB
# 8GB DDR case
$ export H3_OPTION=8GB

$ source build/envsetup.sh
$ lunch kingfisher-userdebug
$ make

Copying images file

$ export images_dir=<your_images_dir>
$ mkdir ${images_dir}
$ cp \
out/target/product/kingfisher/boot.img \
out/target/product/kingfisher/dtb.img \
out/target/product/kingfisher/dtbo.img \
out/target/product/kingfisher/vbmeta.img \
out/target/product/kingfisher/system.img \
out/target/product/kingfisher/vendor.img \
out/target/product/kingfisher/bootloader.img \
out/target/product/kingfisher/bootloader_hf.img \
out/target/product/kingfisher/product.img \
out/target/product/kingfisher/bl2_hf.srec \
out/target/product/kingfisher/bl31_hf.srec \
out/target/product/kingfisher/bootparam_sa0_hf.srec \
out/target/product/kingfisher/cert_header_sa6_hf.srec \
out/target/product/kingfisher/tee_hf.srec \
out/target/product/kingfisher/u-boot-elf_hf.srec \
device/renesas/common/fastboot.sh \
device/renesas/common/functions.sh \
device/renesas/common/ipl_emmc_flash.sh \
device/renesas/common/ipl_hf_flash.sh \
out/host/linux-x86/bin/adb \
out/host/linux-x86/bin/mke2fs \
out/host/linux-x86/bin/fastboot ${images_dir}

Flashing binaries

Flashing IPL

Flashing SREC bootloader files

It's needed to update the Loader, ARM Trusted firmware, Certification, OP-Tee and u-boot in the QSPI Flash memory as it's described in R-Car/Boards/H3SK#Flashing_firmware.

Flashing images using fastboot

Note: this step should be done after successful IPL and U-Boot flashing.

# 0. Connect host and board via USB debug port and start minicom:
$ sudo minicom -D /dev/ttyUSB0

# 1. Turn on the device and interrupt autoboot by pressing any key when device starts booting up.

# 2. Erase bootloader in eMMC 
=> mmc dev 1 1 
=> mw.b 4f000000 0 200000 
=> mmc write 4f000000 0 1000 
=> mmc dev 1 2 
=> mw.b 4f000000 0 200000 
=> mmc write 4f000000 0 1000 
=> reset 
# Please interrupt autoboot 

# 3. Reset default environment:
=> env default -a

# 4. Set ethernet hardware address (written on Ethernet port):
=> setenv ethaddr <board MAC addr>

# 5. Set board serial number of R-Car Starter Kit
=> editenv serialno 
Edit: serialno=xxxxxxxx 
# Padding 0 for a total of 8 digits
=> editenv bootargs 
=> video=VGA-1:d init_time=xxxxxxxxxx 
#”video” variable needs to set parameter related to display configuration.
#”init_time” variable needs to set UNIX time. 
#You can get it by executing “date +%s” command on host PC. 
#The board don't have any RTC. 
#If time and date is not accurate, a few issues will be happened. 

# 6. Save changes:
=> saveenv

# 7. And reboot the device:
=> reset

# 8. After reboot activate fastboot mode by running “fastboot” in u-boot environment:
=> fastboot
# Next commands are performed on host side:
$ cd ${images_dir}
$ chmod a+x ./fastboot 
$ chmod a+x ./fastboot.sh 

# 9. Create GPT table on eMMC:
$ sudo ./fastboot oem format

# 10. Reboot device into bootloader:
$ sudo ./fastboot reboot-bootloader

# 11. Go to images directory and execute:
$ sudo ./fastboot.sh --noresetenv

Booting device

1) Connect Monitor to microHDMI(CN4) port in Starter Kit board(Mandatory).
2) Connect Starter Kit board to host PC via debug port(CN12).
3) Connect usb cable to Kingfisher OTG(CN13) for adb debug.
4) (Optional) Connect Ethernet cable(CN7).
5) Power on device.
6) Wait until Android boot is completed.


Screen configuration

Resolution parameters

By default HWComposer selects resolutions not higher than Full HD with display aspect ratio.

#  Turn on the device and interrupt autoboot using minicom.
# Edit environment variable:
=> editenv bootargs
# Set video resolution:
# for display connected to Starter Kit:
# for display connected to Kingfisher
# for LVDS display on Kingfisher
# Save changes:
=> saveenv

Measuring FPS on HWC level

To enable fps show:

$ adb shell setprop debug.hwc.showfps 1

Fps values can be found in logcat log like:

hwcomposer: fps: 22.0 (23 frame per 1.043099 sec)

To disable fps show:

$ adb shell setprop debug.hwc.showfps 0

Microphone level amplification

By default, audio volume may be low when recording from the microphone. This can be affected by using a microphone preamplifier integrated into KF extension.
Microphone preamplifier is equipped with three switches (SW3, SW4 and SW5). Every switch contains two toggles, responsible for the left and right audio channels. Turning on the toggle will provide the microphone amplification by 20dB.

Known issues

  1. Suspend to RAM is not supported.
  2. UI is displayed with distortions on some displays if an interlaced resolution is set.

See also:

Q&A site


FAQ page