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

From eLinux.org
Jump to: navigation, search
(need to pull up the chip select line)
(add note about programming)
Line 139: Line 139:
 
|}
 
|}
  
 +
===[[File:Alert.gif]] Program 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
  
 
===Program u-boot into QSPI Flash===
 
===Program u-boot into QSPI Flash===

Revision as of 14:20, 26 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, 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.

Streamit sdram rework side.jpg

  • 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

Board Modifications for V2 Boards

Disabling 2nd QSPI on V2 boards

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

Streamit qspi r1.jpg

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

Streamit qspi pullup.jpg

Board Usage Limitations

  • 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

  • Ethernet cannot be used when the LCD is being used.

SD Card Socket

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

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

Select Stream it as the Target Board

  • First enter the BSP configuration screen
$ ./build.sh config
  • 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

  • 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 buildroot
  • Also build the AXFS XIP file image
$ ./build.sh axfs

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:
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

Alert.gif Program Note 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

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}