R-Car/Boards/Stout

Introduction
This is the official Wiki for Renesas R-Car H2 ADAS Starter Kit (Stout) board.

Refer to R-Car page for Renesas R-Car SoC family

Hardware
For more information go to R-Car/Boards/Stout:Hardware

Hardware Features

 * R-Car H2 SoC:
 * ARM®Cortex®-A15 Quad
 * ARM®Cortex®-A7 Quad
 * GPU: PowerVR Series 6 G6400
 * Renesas 2D graphics processor
 * IMR and IMP (Image Processing)
 * Various hardware IP blocks for video and audio processing
 * EthernetAVB
 * 2 GB DDR3 memory (dual channel)
 * 64 MB Spansion S25FL512S SPI Flash
 * MicroSD slot
 * HDMI type A output
 * Max. resolutions support TBD
 * USB 2.0 with type A connector
 * Video input
 * Dialog Semiconductor DA9063 Power Regulator
 * Power supply: 15V, 1.2A
 * Serial port (console) connected via ft232rl
 * Ethernet (100 Mbps)
 * 440-pin expansion connector
 * Dimensions: 95x95 mm

Where to buy
Stout board (Y-R-CAR-ADAS-SKH2-BOARD) is distributed by RS Components, RS Components product ID: 885-6016

Click to order

Expansion boards
ADAS Surround View Kit is designed by Renesas. It integrates Stout board and Maxim Integrated expansion board (as well as four IMI RDCAM20 OV10635-based / MAX9272 cameras and toy car chassis).

See ADAS Surround View Kit wiki page for details

R-Car H2 SoC Documentation
http://www.renesas.com/applications/automotive/cis/cis_highend/rcar_h2/index.jsp

TBD Add here link to public R-Car H2 datasheet

Official Stout board documentation
The manual is available for download from the official Renesas ADAS Solution Kits Page

Most important is on-board CPLD configuration and pin-muxing settings (please get familiar with Hardware Guide)

Quick Start How To
This sections describes steps that are necessary to run a "Hello, World!" application using Yocto build. Both X11 and Wayland are supported.

Build Yocto image
Refer to R-Car/Boards/Yocto for steps necessary for making a Yocto image.

Connect 15 V power supply to the board
Use 15 V power supply with two pins plug (FRIWO Texas plug, http://www.friwo-shop.de/en/accessories/secondary-adapters/194/texas-plug?c=7383 ). The power supply should be able to provide 15V with max 1.2A. Voltage input range is higher (12V to 18V)

Connect to serial console
Use a microUSB cable to connect the PC to R-Car H2 Stout board. CN9 ("DEBUG") must be used on Stout side. It is routed to the R-Car H2 SCIFA0 port via a ft232rl interface converter chip.

On Linux, ft232rl drivers can be found on FTDI website.

Default serial port settings are 38400 8N1. Any standard terminal emulator program can be used.

On Linux:

picocom
sudo picocom -b 38400 DEVICE replace DEVICE with the proper tty device name, for example /dev/ttyUSB0. Running dmesg | tail can help locating proper device. After the successful connection, picocom should display: picocom v1.7

port is       : /dev/ttyUSB0 flowcontrol   : none baudrate is   : 38400 parity is     : none databits are  : 8 escape is     : C-a local echo is : no noinit is      : no noreset is     : no nolock is      : no send_cmd is    : sz -vv receive_cmd is : rz -vv imap is       : omap is       : emap is       : crcrlf,delbs,

Terminal ready

Use Ctrl+A, Ctrl+Q to exit picocom.

minicom
sudo minicom -b 38400 -D DEVICE replace DEVICE with the proper tty device name, for example /dev/ttyUSB0. Running dmesg | tail can help locating proper device. After the successful connection, minicom should display: Welcome to minicom 2.6.2

OPTIONS: I18n Compiled on Aug 7 2013, 13:32:48. Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys Use Ctrl+A, Q to exit minicom.

Power on the board and go to U-Boot prompt
First, switch on power. Red LED (LED 8) should lit up indicating that 15V is available. Than press the "on/off" button, board should start and red led (Led 4) should lit up. Then you should see the following output in the terminal: R8A7790-stout SPI_LOADER V0.29 2015.05.31 DEVICE S25FL512

U-Boot 2013.01.01-g000c6fa-dirty (Jun 02 2015 - 17:04:46)

CPU: Renesas Electronics R8A7790 rev 3.0 Board: R8A7790-stout board

DRAM: 1 GiB CPLD version:             0x20150427 H2 Mode setting (MD0..28): 0x09e32028 Multiplexer settings:     0x00004062 HDMI setting:             0x00000007 DIPSW (SW3):              0x00000000 MMC:  sh-sdhi: 0, sh-sdhi: 1 SF: Detected S25FL512S with page size 256 KiB, total 64 MiB In:   serial Out:  serial Err:  serial Net:  sh_eth Hit any key to stop autoboot: 0 =>

Configure U-Boot to boot over TFTP + NFS or from a micro SD card
Refer to Yocto pages for steps necessary for running Yocto.

QSPI Flash Memory Map
R-Car H2 SoC can be booted from various sources (e.g. Serial flash ROM, External ROM, HSCIF - see R-Car H2 documentation for details).

Stout board relies on QSPI Flash as a default boot device. In a standard configuration 64MB Flash stores QSPI Loader (initial loader), U-Boot and (optionally) Linux kernel. Typical (not optimized) Linux kernel boot sequence consists of following stages:   R-Car H2 SoC internal loader pulls and starts QSPI Loader   QSPI Loader initializes external memory, pulls and starts U-Boot in external memory   U-Boot starts Linux kernel  

Default memory map for QSPI flash looks as follows:

Bootcode binaries
Following binary files may be useful for initial Stout board bootcode setup:   QSPI Loader:   Second stage loader description (QSPI Loader-specific information): (hardcoded to:  0xe8080000  and 0x40000). See below: printf '\x00\x00\x08\xE8\x00\x00\x04\x00' | dd of=u-bootInfo.bin bs=1 seek=0 count=8 conv=notrunc   U-Boot binaries:  
 * "\x00\x00\x08\xE8" - address in RAM (xe8080000 little endian), "\x00\x00\x04\x00" (0x40000) - address of U-Boot (second stage loader, 0x80000) as an offset from the second QSPI Flash sector (0x40000)

Programming QSPI Flash with the help of JTAG
In case bootcode in QSPI Flash is corrupted it could be re-programmed with the help of JTAG debugger. A few options are possible, one of them is to download functional U-Boot binary to the RAM (for example at address 0xe8080000) and then follow the instructions below: Programming QSPI Flash with the help of U-Boot. Alternatively JTAG debugger may provide tools/software for QSPI Flash programming

Programming QSPI Flash with the help of U-Boot
This section provides an example of QSPI Flash programming using U-Boot running in the external RAM.

'''NOTE: There is a risk of damaging bootloader (making board non-bootable), follow instructions carefully. Use JTAG programmer to restore original bootloader in case of errors/failures'''

Make sure TFTP server is configured properly at the host side (see instructions here)

Updating U-Boot
  Pull U-Boot image (u-boot-stout.bin) into memory using tftp => tftp 0x41000000 u-boot-stout.bin  Erase and write one sector of flash (assuming U-Boot binary fits into one sector) => sf probe => sf erase 0x80000 0x40000 ... => sf write 0x41000000 0x80000 0x40000 </li> </ol>

Updating second stage bootloader descriptor (if necessary)
=> tftp 0x41000000 u-bootInfo.bin => sf probe => sf erase 0x40000 0x40000 => sf write 0x41000000 0x40000 8

Updating QSPI Loader
=> tftp 0x41000000 R8A7790STOUT_SPI_LOADER.bin ... => sf probe => sf erase 0 0x40000 ... => sf write 0x41000000 0 0x40000

CPLD tips
ADAS Starter Kit (Stout board) has CPLD to allow easy switching between different functions/pinmux configurations. Detailed list of combinations/functions is provided in the User's Manual.

Most important tips/tricks include:

=> cpld read 1
 * read current CPLD settings:

=> cpld write 1 0x4062
 * single camera (VIN0) + uSD card (SD0) (PoR default):

=> cpld write 1 0x4966
 * 4 VINs (four cameras):

=> cpld write 1 0x4964
 * 3 VINs and GigE interface:

Visit ADAS Starter Kit (Stout board) CPLD page for details

FAQ
TBD