RZ-A/Boards/Stream-it



=RZ Stream it! Board= https://www.renesas.com/en-eu/solutions/key-technology/human-interface/rz-stream-it.html

The Stream it kit is intended to showcase the graphics and image capture capabilities of the RZ/A1L as well as 3rd party middleware (non-OS and RTOS). However, the board can be used to run XIP Linux as well.

The board contains a RZ/A1L with 3MB of internal RAM. However, on Stream it V1 boards, there is a footprint to solder down an external SDRAM device. On Stream it V2 board, a 32Mbyte SDRAM comes soldered down already. While it is possible to boot and run XIP Linux using only 3MB of RAM (no external SDRAM), these instructions mostly cover the the usage case where SDRAM exists on the board.

Below are the instructions on how to build and load a XIP Linux image on a Stream it board along with a AXFS (XIP) file image. An external SDRAM chip will be used for system memory.

The kernel version will be Linux-3.14

Board Modifications for V1 Boards
Populating a V1 board with 16Mbyte SDRAM
 * Because the Stream it board was laid out for a 32MB SDRAM chip, the BA1 pin (pin 21) on the SDRAM chip needs to be lifted and then jumper-ed to its A12 (pin 36) so that it can be connected to the RZ's A13 signal. Pin 36 on this SDRAM chip is a NC, so driving it with A13 is not an issue.
 * Using a 16MB SDRAM instead of a 32MB SDRAM has the benefit of freeing up the CEU clock (VIO_CLK) that is shared with the A15 signal on port P3_14.
 * The u-boot code supports the follow SDRAM device:
 * ISSI 128Mb SYNCHRONOUS DRAM (16MByte)
 * IS42/45S16800F
 * 2M x 16 x 4 Banks

Populating a V1 board with 32Mbyte SDRAM
 * The SDRAM footprint supports a 32MByte SDRAM device
 * The u-boot code supports the follow SDRAM device:
 * Winbond 256Mb SYNCHRONOUS DRAM (32MByte)
 * W9825G6KH-6I
 * 4M x 16 x 4 Banks

Fixing JTAG connection
 * The /TRST connection between the JTAG connector and the RZ/A1 is pulled low with a 10K resistor. Unfortunately, that causes issues sometimes with connecting with a Segger J-Link, and hence you cannot program the QSPI flash.
 * To fix this, remove Resistor R7 on the top of the board.
 * Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.

Board Modifications for V2.2 Boards
Disabling 2nd QSPI on V2.2 boards
 * V2.2 boards come populated with 2 QSPI devices (one on the top of the board, and one on the bottom of the board)
 * Unfortunately, the 2nd QSPI device shares the same pins as the SDRAM, so it must be disabled in order to use SDRAM.
 * Remove resistor R1 located on the top of the board.
 * Now, you need to pull up that disconnected chip select pin to keep it from floating. For example, a 1206 sized resistor fits nicely in between the R1 resistor pad and the bypass capacitor next to it.

Fixing JTAG connection
 * The /TRST connection between the JTAG connector and the RZ/A1 is pulled low with a 10K resistor. Unfortunately, that causes issues sometimes with connecting with a Segger J-Link, and hence you cannot program the QSPI flash.
 * To fix this, remove Resistor R7 on the top of the board.
 * Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.

Board Modifications for V2.3 Boards
Disabling 2nd QSPI on V2.3 boards
 * V2.3 boards come populated with 2 QSPI devices (one on the top of the board, and one on the bottom of the board)
 * Unfortunately, the 2nd QSPI device shares the same pins as the SDRAM, so it must be disabled in order to use SDRAM.
 * Remove resistor R1 located on the top of the board.

Converting the 32Mbyte SDRAM to 16MB so you can use the camera input
 * Because the Stream it board was laid out for a 32MB SDRAM chip, the BA1 pin (pin 21) on the SDRAM chip conflicts with the CEU clock (VIO_CLK).
 * To use both SDRAM and camera at the same time, you need to remove the R36 0-Ohm resistor and tie the BA1 pin to ground.
 * In the u-boot code (u-boot-2017.05/include/configs/streamit.h), you will then need to set #define SDRAM_SIZE_MB to '16'

Board Usage Limitations
Ethernet SD Card Socket
 * Due to the pin muxing of the RZ/A1L device and the layout of the board, not all board features can be used at once.
 * Ethernet cannot be used when the LCD is being used.
 * SD Card cannot be used when both the LCD and SDRAM are being used.

USB-to-Serial Driver

 * If you will be using Windows for your serial terminal, you will need to download the usb to serial drivers. They are the same drivers that are used for the RZ/A1 RSK board.
 * https://github.com/renesas-rz/rskrza1_bsp/tree/master/Extra/USB-Serial-Drivers(win)
 * If you will be using Linux for your serial terminal, it will show up as /dev/ttyACM0
 * Note that we will be using a baud rate of 115200bps(8 bits, 1 stop bit, no parity)

Install the RZ/A1 RSK BSP
$ git clone https://github.com/renesas-rz/rskrza1_bsp.git $ cd rskrza1_bsp
 * We will us the RSK BSP build environment even though we we will be using a Stream it board. The reason is that the u-boot and Linux repositories on github also support Stream it.
 * 1) Clone the BSP from github

Get Latest code from github
$ ./build.sh update u $ ./build.sh update k
 * (which will include Stream it updates)
 * Update the u-boot and kernel source inside the BSP by pulling updates from github

Select Stream it as the Target Board
$ ./build.sh config
 * First enter the BSP configuration screen
 * Then change the Target Board selection (the first item in list) from RSKRZA1 to Stream it
 * Select Save (the last item in the list)
 * Now all your build defaults and J-Link programming examples will be specifically for Stream it

Install Segger Jlink Drivers for Linux

 * Install the "J-Link Software and Documentation Pack" from Segger's website
 * https://www.segger.com/downloads/jlink
 * Hint: You need to click the "Click for downloads" to actually find the download links.

Building

 * The tested build environment was Ubuntu. If using another distribution, some changes might be needed (but I'm not sure what exactly).
 * Lines that start with the symbol '$' are to be copy/pasted into the Linux PC terminal (without the $)
 * Lines that start wit the symbol '=>' are u-boot commands
 * Lines that start wit the symbol '#' are just comments

Build the File System
$ ./build.sh buildroot
 * We do this first because we need Buildroot to download the toolchain that we will use to build u-boot and the kernel.
 * NOTE that I suggest the 'minimum' file system option when prompted because it makes the build much quicker.
 * NOTE that the Stream-it uses a different serial port console (SCIF3) as the RSK board(SCIF2), but the build script will automatically adjust that since you selected Stream-it in the first step (./build.sh config) )

$ ./build.sh axfs
 * Also build the AXFS XIP file image

Build u-boot
$ ./build.sh u-boot streamit_defconfig # [ Please read the note below before doing the next step ] $ ./build.sh u-boot NOTE: The first time build, you must select what SDRAM device is on your board. Please edit the top of file rskrza1_bsp/output/u-boot-2015.01/include/configs/streamit.h and choose what SDRAM you have populated on your board.

Build the Kernel and Device Tree
$ ./build.sh kernel streamit_xip_defconfig $ ./build.sh kernel xipImage $ ./build.sh kernel dtbs

Programming

 * Note that the RSK board has dual SPI flash where as the Stream it only has a single SPI flash, so the programming commands are a little different.
 * Note we can program u-boot and Device Tree directly to SPI flash using the Segger JLink. However, to program the kernel and file system, we first need to download the images to RAM and then let u-boot do the actual SPI flash programming.
 * The memory map of the SPI flash will be as follows:

[[File:Alert.gif]] Programming Note [[File:Alert.gif]]
Connecting to this board with J-Link sometimes does not work. However, there is a method to get it to connect every time: 1. Hold the RESET button on the board down 2. Start to run the J-Link programming script 3. The JLINK will start to connect, then stop after about a second (because it's waiting for the CPU to come out of reset) 4. Release the RESET button on the board 5. J-Link will continue and program correctly every time

To fix this issue, see the HW modification for Fixing JTAG connection

Program u-boot into QSPI Flash
$ ./build.sh jlink output/u-boot-2015.01/u-boot.bin 0x18000000
 * Requires Jlink to be connected to Linux (if running a Virtual Machine)
 * This will program teh u-boot binary directly into the QSPI flash

- use USB serial port - baud rate is 115,200 bps - click the reset button - type "saveenv" in u-boot to save the "environment settings" to SPI flash (gets rid of BAD CRC warning message after reset)
 * Test that u-boot comes up
 * Note that you will need to have u-boot working in order to program the kernel and file system

Program Device Tree for into QSPI Flash
$ ./build.sh jlink output/linux-3.14/arch/arm/boot/dts/r7s72100-streamit.dtb 0x180C0000
 * This will program the u-boot binary directly into the QSPI flash

Program Kernel into QSPI Flash
$ ./build.sh jlink output/linux-3.14/arch/arm/boot/xipImage 0x0C000000 => sf probe 0 ; sf erase 200000 500000 ; sf write 0c000000 200000 500000
 * Make sure u-boot is programmed and u-boot is running
 * Download the kernel binary to on-chip RAM using Jlink:
 * After download, enter these u-boot commands to copy from RAM to SPI flash

Program File System
$ ./build.sh jlink output/axfs/rootfs.axfs.bin 0x0C000000 => sf probe 0 ; sf erase 00800000 C00000 ; sf write 0x0C000000 00800000 C00000
 * If your file system is smaller than 16MB (the size of SDRAM), use this method because it's faster:
 * After download, enter these u-boot commands to copy from RAM to SPI flash
 * Programs 12MB

$ ./build.sh jlink output/axfs/rootfs.axfs.bin 0x18800000
 * If your file system is larger than 16MB, use this method because it will program the SPI Flash directly...but it's going to take a while...
 * The reason is that the Stream it board only has 16MB of SDRAM so we can only download 16MB.

Booting the Board
=> run xsa_boot
 * In u-boot, type:


 * Linux login
 * USER: root
 * PASS: {no password}