Difference between revisions of "RZ-A/Boards/Stream-it"

From eLinux.org
Jump to: navigation, search
(initial page)
 
(use new update command)
Line 45: Line 45:
 
* (which will include Stream it updates)
 
* (which will include Stream it updates)
 
* Update the u-boot and kernel source inside the BSP by pulling updates from github
 
* Update the u-boot and kernel source inside the BSP by pulling updates from github
* Start in the base of the BSP (where the build.sh file is, where you should have left off from the last step)
+
  $ ./build.sh update u
  $ cd output/u-boot-2015.01 ; git checkout 2015.01-rskrza1 ; git pull ;  cd ../..
+
  $ ./build.sh update k
 
  $ cd output/linux-3.14 ; git checkout master ; git pull ; cd ../..
 
  
 
===Install Segger Jlink Drivers for Linux ===
 
===Install Segger Jlink Drivers for Linux ===

Revision as of 07:06, 7 June 2017

Stream it.jpg

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 wtih 3MB of internal RAM. However, there is a footprint to solder down an external SDRAM device. While it is possible to boot and run XIP Linux using only 3MB of RAM (no external SDRAM), these instructions are only when an SDRAM has been added.

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.

NOTE that these instructions assume you have the same 16Byte SDRAM populated on the board as outlined below.


The kernel version will be Linux-3.14

Board Modifications

SDRAM to Populate

  • The follow SDRAM was used:
ISSI 128Mb SYNCHRONOUS DRAM (16MByte)
IS42/45S16800F
2M x 16 x 4 Banks

SDRAM Rework

  • 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.

Streamit sdram rework side.jpg

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)

Build Environment Setup

Install the RZ/A1 RSK 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.
# Clone the BSP from github
$ git clone https://github.com/renesas-rz/rskrza1_bsp.git
$ cd rskrza1_bsp

Get Latest code from github

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

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

  • 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 becase it makes the build much quicker.
  • NOTE that because the Stream it uses a different serial port (SCIF3) as the RSK board(SCIF2), we will have to modify the Buildroot config from it's default RSK board value.
$ ./build.sh buidlroot
  • Now go back and switch the serial console (BR2_TARGET_GENERIC_GETTY_PORT from /dev/ttySC2 to /dev/ttySC3
$ ./build.sh buidlroot menuconfig
System configuration -> Run a getty (login prompt) after boot -> (ttySC2) TTY port -> Change "ttySC2" to ttySC3"
Now use ESC to back out of the menu and save the new config.
  • Run Buildroot again (will be quick this time)
$ ./build.sh buidlroot
  • Also build the AXFS XIP file image
$ ./build.sh axfs

Build u-boot

$ ./build.sh u-boot streamit_defconfig
$ ./build.sh u-boot

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:
Offset Size Image
0x00000 512KB u-boot
0x80000 256KB u-boot environment variables
0xC0000 256KB Device Tree Blob
0x200000 5MB Kernel
0x800000 56MB File System


Program u-boot into QSPI Flash

  • Requires Jlink to be connected to Linux (if running a Virtual Machine)
  • This will program teh u-boot binary directly into the QSPI flash
$ ./build.sh jlink output/u-boot-2015.01/u-boot.bin 0x18000000
  • 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
- 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)

Program Device Tree for into QSPI Flash

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

Program Kernel into QSPI Flash

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

Program File System

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

Booting the Board

  • In u-boot, type:
 => run xsa_boot
  • Linux login
USER: root
PASS: {no password}