Difference between revisions of "R-Car/Boards/Kingfisher/Yocto-Gen3/v5.1.0"

From eLinux.org
Jump to: navigation, search
(Manual steps)
(LVDS Camera)
Line 517: Line 517:
 
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
 
$ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
 
</syntaxhighlight>
 
</syntaxhighlight>
$ media-ctl -d /dev/media0 -V "'ov5642 22-003c':0 [fmt:UYVY8_2X8/1280x720 field:none]"
 
  
 
# LI-OV10635-GMSL
 
# LI-OV10635-GMSL

Revision as of 00:18, 27 September 2021



Introduction

This page contains information on building and running Yocto on:

See also:

Topic

The new version of R-Car Starter Kit Premier is now on sale !!

  • Equipped with R-Car H3e-2G
    (En) https://www.renesas.com/jp/en/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
    (Zh) https://www.renesas.com/jp/zh/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
    (Jp) https://www.renesas.com/jp/ja/about/press-room/renesas-launches-r-car-gen3e-20-percent-higher-cpu-speed-automotive-infotainment-cockpit-and-digital
  • CPU performance is increased 20% by supporting up to 2GHz frequency over past products.
  • You can buy from here.

SW Release Information

Board name SW name Release date Note
R-Car Starter Kit ( Premier / Pro ) Yocto v5.5.0 (latest) [New!!] 2021/10/01
Yocto v3.21.0 (stable) 2019/07/09 R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/07/10.
meta-renesas was updated on 2021/08/03.
Kingfisher Infotainment Board Yocto v5.5.0 (latest) [New!!] 2021/10/01 To check for latest information, please refer to the meta-rcar/tree/v5.5.0.
Yocto v3.21.0 (stable) 2019/08/07 To check for latest information, please refer to the meta-rcar/tree/v3.21.0.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) is supported from 2020/08/02.
meta-renesas was updated on 2021/08/03.
Android 10 (stable) [New!!] 2021/07/26 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/11/25.
Android P (stable) 2020/09/29 R-Car Starter Kit Premier(R-Car H3) + Kingfisher is supported.
R-Car Starter Kit Pro(RTP8J77961ASKB0SK0SA05A) + Kingfisher is also supported from 2021/03/16.
CCPF-SK Board Yocto v5.1.0 (latest) [New!!] 2021/10/01 Prebuilt binary is availeble in Quick startup guide page.


Kingfisher Board Stock Information

  • Global Disty(Shimafuji Electric Incorporated) : Available
  • Japan Disty (Marutsuelec Co.,Ltd.) : Available
    • Click here for detail

    New Camera Support

  • Yocto v3.21.0 supports the new Entron S001A190CM0A camera.
    • Please refer to FAQ for how to purchase.

    Software revisions

    Software Revision
    Yocto Project 3.1.4
    aarch64-poky-linux-gcc (GCC) 9.3
    Wayland/Weston 1.18.0/8.0.0
    GStreamer 1.16.3
    Kernel Ver 5.10
    Userland 64/32bit 64
    U-Boot 2020.10
    OP_TEE 3.8.0
    OpenGL ES 3.2

    Host PC

    Ubuntu 16.04/20.04 LTS (64bit) is recommended as OS. 32bit version is not supported.

    Required packages

    1. Download evaluation version of proprietary graphics and multimedia drivers from Renesas.
      To download Multimedia and Graphics library and related Linux drivers, please use the following link:
      Download two files:
      • R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
      • R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip

      Graphic drivers are required for Wayland. Multimedia drivers are optional.
    2. Install required packages
      sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
      build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
      xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \
      libsdl1.2-dev pylint3 xterm
      
      Refer to Yocto Project Quick Start for more information.

    Building the BSP for Kingfisher

    Using build script

    1. Directory Structure
      |--build.sh
      `--proprietary
         |--R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
         `--R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
      
    2. Build script(build.sh)
      #!/bin/bash
      
      BOARD_LIST=("h3ulcb" "m3ulcb")
      TARGET_BOARD=$1
      PROPRIETARY_DIR=`pwd`/proprietary
      WORK=`pwd`/${TARGET_BOARD}
      
      POKY_COMMIT=424296bf9bb4bae27febf91bce0118df09ce5fa1
      META_OE_COMMIT=f2d02cb71eaff8eb285a1997b30be52486c160ae
      META_RENESAS_COMMIT=fd8ab2bb1b5ca98483c6f4aecf09a85c4d6bc016
      META_RCAR_BRANCH=v5.1.0
      
      GFX_MMP_LIB=R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
      GFX_MMP_DRIVER=R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
      
      Usage () {
          echo "Usage: $0 \${TARGET_BOARD_NAME}"
          echo "BOARD_NAME list: "
          for i in ${BOARD_LIST[@]}; do echo "  - $i"; done
          exit
      }
      
      # Check Param.
      if ! `IFS=$'\n'; echo "${BOARD_LIST[*]}" | grep -qx "${TARGET_BOARD}"`; then
          Usage
      fi
      
      mkdir -p ${WORK}
      cd ${WORK}
      
      # Clone basic Yocto layers in parallel
      git clone git://git.yoctoproject.org/poky &
      git clone git://git.openembedded.org/meta-openembedded &
      git clone git://github.com/renesas-rcar/meta-renesas &
      git clone git://github.com/CogentEmbedded/meta-rcar.git &
      
      # Wait for all clone operations
      wait
      
      # Switch to proper branches/commits
      cd ${WORK}/poky
      git checkout -b tmp ${POKY_COMMIT}
      cd ${WORK}/meta-openembedded
      git checkout -b tmp ${META_OE_COMMIT}
      cd ${WORK}/meta-renesas
      git checkout -b tmp ${META_RENESAS_COMMIT}
      cd $WORK/meta-rcar
      git checkout -b ${META_RCAR_BRANCH} remotes/origin/${META_RCAR_BRANCH}
      
      # Apply patch to update meta-renesas
      cd ${WORK}
      curl -sO  https://elinux.org/images/6/6a/Update-meta-rcar-for-Yv510-20210531.patch.zip
      unzip -qo Update-meta-rcar-for-Yv510-20210531.patch.zip
      cd ${WORK}/meta-renesas
      patch -N -p1 < ../Update-meta-rcar-for-Yv510-20210531.patch
      
      # Populate meta-renesas with proprietary software packages
      WORK_PROP_DIR=${WORK}/proprietary
      mkdir -p ${WORK_PROP_DIR}
      unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_LIB} -d ${WORK_PROP_DIR}
      unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_DRIVER} -d ${WORK_PROP_DIR}
      cd ${WORK}/meta-renesas
      sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f ${WORK_PROP_DIR}
      
      cd ${WORK}
      source poky/oe-init-build-env ${WORK}/build
      
      #cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/bsp/*.conf ./conf/
      #cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/gfx-only/*.conf ./conf/
      cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/mmp/*.conf ./conf/
      
      cd ${WORK}/build
      cp conf/local-wayland.conf conf/local.conf
      
      bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
      bitbake core-image-weston
      
    3. build
      ./build.sh <target_board_name>
      
      Note Note: target_board_name is "h3ulcb" or "m3ulcb".
      If the build completes successfully, all the necessary files are generated in a following directory:
      ./<target_board_name>/build/tmp/deploy/images/<target_board_name>
      

    Manual steps

    1. Create a directory and switch to it
      Warning! Yocto builds require a lot of disk space (up to 100 GB). Make sure you have got enough before starting the build.
      mkdir build
      cd build
      export WORK=`pwd`
      
    2. Clone basic Yocto layers:
      cd $WORK
      git clone git://git.yoctoproject.org/poky
      git clone git://git.openembedded.org/meta-openembedded
      git clone git://github.com/renesas-rcar/meta-renesas
      git clone git://github.com/CogentEmbedded/meta-rcar.git
      
    3. Switch to proper branches/commits
      cd $WORK/poky
      git checkout -b tmp 424296bf9bb4bae27febf91bce0118df09ce5fa1
      cd $WORK/meta-openembedded
      git checkout -b tmp f2d02cb71eaff8eb285a1997b30be52486c160ae
      cd $WORK/meta-renesas
      git checkout -b tmp fd8ab2bb1b5ca98483c6f4aecf09a85c4d6bc016
      cd $WORK/meta-rcar
      git checkout -b v5.1.0 remotes/origin/v5.1.0
      
      Another versions are not tested for compatibility.
      Legacy BSP instruction can be found here R-Car Kingfisher Yocto Gen3 legacy
    4. Apply patch to update meta-rcar(patch file: File:Update-meta-rcar-for-Yv510-20210531.patch.zip)
      cd ${WORK}
      curl -sO https://elinux.org/images/6/6a/Update-meta-rcar-for-Yv510-20210531.patch.zip
      unzip -qo Update-meta-rcar-for-Yv510-20210531.patch.zip
      cd ${WORK}/meta-renesas
      patch -N -p1 < ../Update-meta-rcar-for-Yv510-20210531.patch
      
    5. Create $WORK/../proprietary folder, then download proprietary driver modules to it.
      See also Required_packages
      You should see the following files:
      $ ls -1 $WORK/../proprietary/*.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip
      R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
      
    6. Populate meta-renesas with proprietary software packages.
      export PKGS_DIR=$WORK/../proprietary
      cd $PKGS_DIR
      unzip -qo R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20210428.zip 
      unzip -qo R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20210428.zip
      cd $WORK/meta-renesas
      sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f $PKGS_DIR
      unset PKGS_DIR
      
    7. Setup build environment
      cd $WORK
      source poky/oe-init-build-env $WORK/build
      
    8. Prepare default configuration files.
      cp $WORK/meta-renesas/meta-rcar-gen3/docs/sample/conf/<h3ulcb|m3ulcb>/poky-gcc/mmp/*.conf ./conf/
      cd $WORK/build
      cp conf/local-wayland.conf conf/local.conf
      
      NOTE: extra configuration examples are available in the following directory:
      $WORK/meta-rcar/meta-rcar-gen3-adas/docs/sample/conf/
      
    9. Add layer meta-rcar
      bitbake-layers add-layer ../meta-rcar/meta-rcar-gen3-adas
      
    10. Start the build
      bitbake core-image-weston
      
    11. Building image can take up to a few hours depending on your host system performance.
      After the build has been completed successfully, you should see the output similar to:
      NOTE: Tasks Summary: Attempted 4704 tasks of which 31 didn't need to be rerun and all succeeded.
      
      and the command prompt should return.
    12. Bitbake has generated all the necessary files in ./tmp/deploy/images directory.
      You can verify its content:
      -> % ls -1 `find ./tmp/deploy/images/h3ulcb/ -maxdepth 1 -type l -print`
      ./tmp/deploy/images/h3ulcb/Image
      ./tmp/deploy/images/h3ulcb/Image-h3ulcb.bin
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.ext4
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.manifest
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.tar.bz2
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.testdata.json
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.bmap
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.xz
      ./tmp/deploy/images/h3ulcb/core-image-weston-h3ulcb.wic.xz.sha256sum
      ./tmp/deploy/images/h3ulcb/modules-h3ulcb.tgz
      ./tmp/deploy/images/h3ulcb/r8a77950-ulcb-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a77950-ulcb-kf-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a77950-ulcb-kf.dtb
      ./tmp/deploy/images/h3ulcb/r8a77950-ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-kf-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a77951-ulcb-kf.dtb
      ./tmp/deploy/images/h3ulcb/r8a77951-ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb-kf-h3ulcb.dtb
      ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb-kf.dtb
      ./tmp/deploy/images/h3ulcb/r8a779m1-ulcb.dtb
      ./tmp/deploy/images/h3ulcb/u-boot-elf-h3ulcb.srec
      ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin
      ./tmp/deploy/images/h3ulcb/u-boot-h3ulcb.bin-r8a7795_h3ulcb
      ./tmp/deploy/images/h3ulcb/u-boot-initial-env-h3ulcb-r8a7795_h3ulcb
      ./tmp/deploy/images/h3ulcb/u-boot-initial-env-r8a7795_h3ulcb
      ./tmp/deploy/images/h3ulcb/u-boot.bin
      ./tmp/deploy/images/h3ulcb/u-boot.bin-r8a7795_h3ulcb
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn10-gmsl2-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn10-gmsl2.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn10-pca-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn10-pca.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11-gmsl2-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11-gmsl2.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11-pca-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11-pca.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-cn11.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-imx219-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-imx219.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-most-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-most.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-koe-tx31d200vm0baa-1280x480-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-koe-tx31d200vm0baa-1280x480.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-mitsubishi-aa104xd12-1024x768-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-mitsubishi-aa104xd12-1024x768.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-mitsubishi-aa121td01-1280x800-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-panel-mitsubishi-aa121td01-1280x800.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-sd3-h3ulcb.dtbo
      ./tmp/deploy/images/h3ulcb/ulcb-kf-sd3.dtbo
      
      Image is a Kernel image, *.dtb is a blob file, core-image-<image_type>-<board_name>.tar.bz2 is the rootfs, modules-<board_name>.tgz are kernel modules.
    13. You can now proceed with running Yocto images

    Relationship diagram between each SK board and DTB file in Yocto v5.1.0

    Board name SoC version Type Name DTB file
    H3SK 2.0 RTP0RC77951SKBX010SA00 r8a77951-ulcb-kf.dtb
    H3SK 2.0 RTP0RC77951SKBX010SA01 r8a77951-ulcb-kf.dtb
    H3SK 2.0/3.0 RTP0RC77951SKBX010SA03 r8a77951-ulcb-kf.dtb
    M3SK 1.0 RTP0RC7796SKBX0010SA09 r8a77960-ulcb-kf.dtb
    M3SK 3.0 RTP8J77961ASKB0SK0SA05A r8a77961-ulcb-kf.dtb

    Build SDK

    Refer to Build SDK on the Yocto-Gen3 page.

    Running Yocto images

    Refer to Running Yocto images on the Yocto-Gen3 page.
    [NOTE]

    DTB filename for Kingfisher contains suffix "-kf".
    Ex.) r8a77951-ulcb-kf.dtb
    If you want to know the combinatation of the board and dtb file, please refer to here.

    S/W support status

    Support list

    Functions Status
    WiFi ok
    Bluetooth ok
    Gyro ok
    GPS ok
    CAN ok
    Serial(CN4) ok
    LVDS Camera (CN10/CN11) ok
    CMOS Camera ok
    Raspberry Pi camera Rev 1.3 ok
    Raspberry Pi camera Rev 2 ok
    USB2.0(CN13) Host ok
    USB 2.0(CN13) Func(g_mass_storage) ok
    USB3.0(CN2) Host ok
    Multichannel Audio ok
    HDMI Out ok
    LVDS Out ok
    Mini PCIe ok (Atheros AR5418)
    M.2 ok
    MOST ok
    Radio (CN42) ok

    Note:

    "ok" - Function succeeded in the simple test as below.
    "NT" - Function wasn't tested

    How to test some capabilities

    WiFi

    To check wifi and scan available WAPs run:

    $ ifconfig wlan0 up
    $ iw dev wlan0 scan
    

    Bluetooth

    Ex 1)To check bluetooth and scan available BT devices run:

    $ hciconfig hci0 up
    $ hcitool -i hci0 scan
    

    Ex 2)BT-Audio

    root@h3ulcb:~# bluetoothctl 
    [NEW] Controller C8:DF:84:4C:84:98 h3ulcb [default]
    Agent registered
    [bluetooth]# power on
    Changing power on succeeded
    [bluetooth]# agent on
    Agent is already registered
    [bluetooth]# default-agent     
    Default agent request successful
    [bluetooth]# scan on
    Discovery started
    ..(snip)..  !!! <-- Please look for taget device !!!
    [bluetooth]# scan off
    ..(snip)..
    [bluetooth]# pair <MAC address of target device>
    ..(snip)..
    Request confirmation
    [agent] Confirm passkey 285311 (yes/no): yes
    ..(snip)..
    Pairing successful
    [bluetooth]# connect <MAC address of target device>
    ..(snip)..
    Connection successful
    ..(snip)..
    [Target device name]# quit
    

    Please play music on target device.

    Gyro

    $ cat /sys/bus/iio/devices/iio\:device0/*_raw (Accelerometer, Magnetometer)
    $ cat /sys/bus/iio/devices/iio\:device1/*_raw (Gyroscope)
    

    GPS

    $ cat /dev/ttySC2
    

    CAN

    Ex) loop back

    Connect the following pins of CN17 and CN18:
    CN17 1pin - CN18 1pin
    CN17 2pin - CN18 2pin
    (*)Note: SW2 ON of KF. (defalt:ON)
    
    KF CAN.jpg
    $ ip link set can0 up type can bitrate 125000
    $ ip link set can1 up type can bitrate 125000
    $ candump can0&
    $ cangen can1
    can0  08D   [3]  B5 F4 3C
    can0  34E   [3]  7C A1 70
    can0  717   [6]  95 C5 67 4A 41 42
    can0  7F1   [8]  CA B9 E9 3E AE 71 FC 52
    

    Serial

    Ex) loop back

    For KF M03: Connect the following pins on CN4:
    pin3(RxD) - pin5(TxD)
    pin4(RTS) - pin6(CTS)
    
    For KF M04 or later: Connect the following pins on CN4:
    pin2(TxD) - pin4(RxD)
    pin1(RTS) - pin3(CTS)
    
    $ stty -F /dev/ttySC3 -echo
    $ stty -F /dev/ttySC3
    speed 9600 baud; line = 0;
    -brkint -imaxbel
    -echo
    $ cat /dev/ttySC3 &
    $ echo  123435452345 > /dev/ttySC3
    123435452345
    

    LVDS Camera

    [Note]

    H3 can use CN10 and CN11
    M3 can use CN10
    • When you use a Leopard Imaging camera, add some parameters to bootargs.
    Leopard Imagin camera type name bootargs
    LI-OV10635-GMSL ov10635.dvp_order=0
    (IMI) RDACM21 ov490.dvp_order=1
    S001A190CM0A max9286.him=1 max9286.vsync=0 max9286.fsync_period=2420000 max9286.crossbar=0x01234567

    Ex1) 1 camera

    1. RDACM21-01
      $ media-ctl -r
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':1 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN0 output':0 [1]"
      $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      
    1. LI-OV10635-GMSL
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':1 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN0 output':0 [1]"
      $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      
    1. S001A190CM0A
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':1 [fmt:UYVY8_2X8/1280x728 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN0 output':0 [1]"
      $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=728,framerate=30/1 '!' waylandsink
      

    Ex2) 4 cameras

    1. RDACM21-01 x4
      $ media-ctl -r
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':1 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN0 output':0 [1]"
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':2 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':2 -> 'VIN1 output':0 [1]"
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':3 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':3 -> 'VIN2 output':0 [1]"
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':4 [fmt:UYVY8_2X8/1280x800 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':4 -> 'VIN3 output':0 [1]"
      $ gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      $ gst-launch-1.0 v4l2src device=/dev/video1 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      $ gst-launch-1.0 v4l2src device=/dev/video2 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      $ gst-launch-1.0 v4l2src device=/dev/video3 io-mode=mmap '!' video/x-raw,format=BGRA,width=1280,height=800,framerate=30/1 '!' waylandsink
      

    CMOS Camera

    Ex)

    $ media-ctl -d /dev/media0 -V "'ov5642 22-003c':0 [fmt:UYVY8_2X8/1280x720 field:none]"
    $ media-ctl -d /dev/media0 -l "'ov5642 22-003c':0 -> 'VIN5 output':0 [1]"
    $ gst-launch-1.0 v4l2src device=/dev/video5 '!' video/x-raw,format=BGRA,width=1280,height=720,framerate=30/1 '!' waylandsink
    

    Raspberry Pi camera Rev 1.3(OV5647) / 2(IMX219)

    • Ex) OV5647
      $ media-ctl -d /dev/media0 -p | grep ov5647
                      <- "ov5647 21-0036":0 [ENABLED,IMMUTABLE]
      - entity 13: ov5647 21-0036 (1 pad, 1 link)
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 fea80000.csi2':1 [fmt:SBGGR8_1X8/2592x1944 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 fea80000.csi2':1 -> 'VIN4 output':0 [1]"
      
      $ capture -d /dev/video4 -o -f bggr8 -W 2592 -H 1944 -c 1 -t 30 > /home/root/video.bggr
      or
      $ v4l2-ctl -d /dev/v4l-subdev2 -c test_pattern=1
      $ capture -d /dev/video4 -o -f bggr8 -W 2592 -H 1944 -c 1 -t 30 > /home/root/video.bggr
      
    • Ex) Display
      Ubuntu PC$ ./bayer2rgb  -i video.bggr -o video.rgb24 -w 2592 -v 1944 -b 8 -f BGGR
        * https://github.com/jdthomas/bayer2rgb.git
      Ubuntu PC$ rawtoppm -rgb 2592 1944 video.rgb24 > video24.ppm
      Ubuntu PC$ display video24.ppm
      
    • Ex) IMX219
      Load "ulcb-kf-imx219.dtbo" file using device tree overlay feature:
      See FAQ: How to use "Device_Tree_Overlays"
      $ media-ctl -d /dev/media0 -p | grep imx219
                      <- "imx219 21-0010":0 [ENABLED,IMMUTABLE]
      	- entity 13: imx219 21-0010 (1 pad, 1 link)
      $ media-ctl -d /dev/media0 -V "'rcar_csi2 fea80000.csi2':1 [fmt:SBGGR8_1X8/3264x2464 field:none]"
      $ media-ctl -d /dev/media0 -l "'rcar_csi2 fea80000.csi2':1 -> 'VIN4 output':0 [1]"
      
      $ capture -d /dev/video4 -o -f bggr8 -W 3264 -H 2464 -c 1 -t 30 > /home/root/video.bggr
      or
      $ v4l2-ctl -d /dev/v4l-subdev2 -c test_pattern=1
      $ capture -d /dev/video4 -o -f bggr8 -W 3264 -H 2464 -c 1 -t 30 > /home/root/video.bggr
      
    • Ex) Display
      Ubuntu PC$ ./bayer2rgb  -i video.bggr -o video.rgb24 -w 3264 -v 2464 -b 8 -f BGGR
        * https://github.com/jdthomas/bayer2rgb.git
      Ubuntu PC$ rawtoppm -rgb 3264 2464 video.rgb24 > video24.ppm
      Ubuntu PC$ display video24.ppm
      

    USB 2.0 Function

    Ex.) g_mass_storage

    1. Enable CONFIG_USB_MASS_STORAGE on linux kernel.
      Ex.) Using menuconfig:
      "Device Drivers -> USB support -> USB Gadget Support -> USB Gadget precomposed configurations"
           <M> Mass Storage Gadget
      
      See also: FAQ: How to change kernel config on Yocto
    2. Execute command
      root@m3ulcb:~# mount -t tmpfs -o size=400m tmpfs /tmp
      root@m3ulcb:~# dd if=/dev/zero of=/tmp/tmp.img bs=1M count=350
      350+0 records in
      350+0 records out
      367001600 bytes (367 MB, 350 MiB) copied, 0.595591 s, 616 MB/s
      root@m3ulcb:~# mkfs.ext3 -L storage /tmp/tmp.img
      mke2fs 1.45.4 (23-Sep-2019)
      Discarding device blocks: done
      Creating filesystem with 358400 1k blocks and 89760 inodes
      Filesystem UUID: 29bbef04-029c-4bf4-a4b3-010eaaa6d672
      Superblock backups stored on blocks:
              8193, 24577, 40961, 57345, 73729, 204801, 221185
      
      Allocating group tables: done
      Writing inode tables: done
      Creating journal (8192 blocks): done
      Writing superblocks and filesystem accounting information: done
      
      root@m3ulcb:~# modprobe libcomposite
      root@m3ulcb:~# modprobe usb_f_mass_storage
      root@m3ulcb:~# modprobe g_mass_storage file=/tmp/tmp.img
      [  576.540426] Mass Storage Function, version: 2009/09/11
      [  576.546092] LUN: removable file: (no medium)
      [  576.550947] LUN: file: /tmp/tmp.img
      [  576.554690] Number of LUNs=1
      [  576.558172] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
      [  576.565301] g_mass_storage gadget: userspace failed to provide iSerialNumber
      [  576.572498] g_mass_storage gadget: g_mass_storage ready
      root@m3ulcb:~#
      
    3. Connect CN13 to HostPC, then mount mass_storage.
      Ex.) HostPC :# mount /dev/sdb1 /mnt
      

    Multichannel Audio

    • Ex1) CN12/32/33 on KF
      $ speaker-test -c 8 -t wav -W /usr/share/sounds/alsa/
      $ arecord -c 6 -r 48000 -f S32_LE | aplay
      
    • Ex2)
      <KF>
      $ pactl set-default-sink pcm3168a_output
      $ speaker-test -c 8 -t wav -W /usr/share/sounds/alsa/
      <SK>
      $ pactl set-default-sink ak4613_output 
      $ amixer -c ak4613 sset "DVC Out" 10%
      $ speaker-test -c 2 -t wav -W /usr/share/sounds/alsa/
      
    • Ex3)
      <KF>
      $ paplay -d pcm3168a_output sample.wav
      <SK>
      $ amixer -c ak4613 sset "DVC Out" 10%
      $ paplay -d ak4613_output sample.wav
      

    Radio

    Ex) FM Radio

    Connect the antenna to CN42 on Kingfisher boards.
    Note Note:
    If radio module is used for the first time, updating radio module firmware is required.
    Updating firmware is not required after the second time.
    $ si_init
    $ si_firmware_update ( Update firmware of radio module.)
    $ si_fm
    $ si_preset <FM Radio frequency> ( In Tokyo, Japan, 91600 is Nippon Cultural Broadcasting. )
    

    M.2

    Ex) Transcend TS128GMTE850

    $ dmesg|grep nvme<br>
    [    1.559645] nvme nvme0: pci function 0000:01:00.0
    [    1.564386] nvme 0000:01:00.0: enabling device (0000 -> 0002)
    [    1.578702] nvme nvme0: 7/0/0 default/read/poll queues
    [    1.592894]  nvme0n1: p1 p2
    $ mount /dev/nvme0n1p1 /mnt/
    

    MOST

    Ex)

    1. Connect OS81092 board(Physical+ Interface Board OS81092) and CN22 of KF.
    2. Connect Audio board(OS81092 Audio Demo Board) and OS819092 board with exclusive cable.
    3. Connect Audio board and CN5 of SK with USB cable.
    4. Set to SW7 to "MOST" side
    5. Run the linux kernel
      1. Load "ulcb-kf-most.dtbo" file using device tree overlay feature:
      2. See FAQ: How to use "Device_Tree_Overlays"
    6. cd /usr/share/most/
    7. ./most_setup.sh
      $./most_setup.sh 
      -- Setting up cdev most_ctrl_rx: rx channel ca2 --
      -- Setting up cdev most_ctrl_tx: tx channel ca4 --
      -- Setting up sound rx0: rx channel ca6 --
      -- Setting up sound tx0: tx channel ca8 --
      -- Setting up sound tx1: tx channel ca12 --
      MOST setup complete
      
    8. ./setup-audio-50 &
      $./setup-audio-50 &
      root@h3ulcb:/usr/share/most#
      Configuration:
              Timing Slave (Audio Sink)
      ! ET_NS_MSVAL_ERROR a MSVAL Error is reported from the NS: 0x0010 MSVAL_ERR_STARTUP_FAILED
      MSVAL_E_SHUTDOWN
      App reset
      MSVAL_E_SHUTDOWN
      App reset
      ! ET_NS_MSVAL_ERROR a MSVAL Error is reported from the NS: 0x0011 MSVAL_ERR_STARTUP_BUSY
      ! ET_NS_MSVAL_ERROR a MSVAL Error is reported from the NS: 0x0011 MSVAL_ERR_STARTUP_BUSY
      ! ET_NS_MSVAL_ERROR a MSVAL Error is reported from the NS: 0x0011 MSVAL_ERR_STARTUP_BUSY
      ! ET_NS_MSVAL_ERROR a MSVAL Error is reported from the NS: 0x0010 MSVAL_ERR_STARTUP_FAILED
      MSVAL_E_SHUTDOWN
      App reset
      (snip)
      
    9. Push the "Switch" button on the Audio board
      -> MostAllowRemoteAccess(allow)
      -> SourceInfo.Status 1 (Inst_ID: 0x1, FB: 0x24, Adr: 0x400)
      -> SourceInfo.Status 2 (Inst_ID: 0x1, FB: 0x24, Adr: 0x400)
      -> Amplifier.Volume.Set 100
      
    10. Push the "Switch" button on the Audio board again
      <- FB_AuxIn_Allocate_StartResult Node: 0x01, Ifn: 0x02
      
    11. Push the "Switch" button on the Audio board again
      <- FB_AuxIn_Allocate_StartResult Node: 0x01, Ifn: 0x01
      
    12. ./most_play.sh /usr/share/sounds/alsa/Front_Left.wav
      $./most_play.sh /usr/share/sounds/alsa/Front_Left.wav
      Audio file  : /usr/share/sounds/alsa/Front_Left.wav
      Output index: 0
      ALSA device : hw:4,1
      Setting pipeline to PAUSED ...
      Pipeline is PREROLLING ...
      Redistribute latency...
      Pipeline is PREROLLED ...
      Setting pipeline to PLAYING ...
      New clock: GstAudioSinkClock
      

    DTS overlay

    Since the meta-rcar supports the DTS overlays then you can test option periferals without recompilation.

    Ex)
    => ext4load mmc 0 0x48080000 /boot/Image; ext4load mmc 0 0x48000000 /boot/r8a77951-ulcb-kf.dtb
     Ex1) test CN11
     => ext4load mmc 0 0x48040000 /boot/ulcb-kf-cn11.dtbo
     Ex2) test SD card(CN47) instead WiFi
     => ext4load mmc 0 0x48040000 /boot/ulcb-kf-sd3.dtbo
     Ex3) test Most
     => ext4load mmc 0 0x48040000 /boot/ulcb-kf-most.dtbo
    => fdt addr 0x48000000; fdt resize 8192; fdt apply 0x48040000
    => booti 0x48080000 - 0x48000000
    
    

    FAQ

    Failed to DRAM initialize (-1).

    If you face the following error please update(*) IPL and u-boot to the latest version.

    NOTICE:  BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.12
    NOTICE:  BL2: PRR is R-Car M3 ES1.0
    NOTICE:  BL2: Boot device is HyperFlash(80MHz)
    NOTICE:  BL2: LCM state is CM
    NOTICE:  BL2: AVS setting succeeded. DVFS_SetVID=0x52
    NOTICE:  BL2: DDR3200(rev.0.20)[COLD_BOOT]..1
    NOTICE:  BL2: Failed to DRAM initialize (-1).
    ERROR:   
    ERROR:   BL2: System WDT overflow, occurred address is 0xe630d3cc
    

    (*)How to update

    http://elinux.org/R-Car/Boards/Kingfisher#How_to_update_of_Sample_Loader_and_MiniMonitor
    http://elinux.org/R-Car/Boards/M3SK#Flashing_firmware
    http://elinux.org/R-Car/Boards/H3SK#Flashing_firmware

    How to get the SA001 Camera

    Refer to R-Car/Boards/Kingfisher#How_to_get_the_SA001_Camera.

    Known issues and limitations

    1. Refer to R-Car/Boards/Kingfisher#Known_Issues.
    2. Refer to R-Car/Boards/Yocto-Gen3/v5.1.0#Known_issues_and_limitations.
    3. [Known issue]Cropping and Scaling don't work at the same time.
      For example, if you run the following, you will get a black screen.
      $ gst-launch-1.0 v4l2src device=/dev/video0 crop-top=480 crop-left=270 crop-width=960 crop-height=544 '!' video/x-raw,format=BGRA,width=960,height=544,framerate=30/1 '!' waylandsink
      


    Q&A site

    https://renesasrulz.com/r-car-h3-m3-cockpit/

    FAQ site