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

From eLinux.org
Jump to: navigation, search
(V2 to V2.2)
(typo)
 
(6 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
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.
 
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==
 
==Board Modifications for V1 Boards==
Line 54: Line 52:
 
* Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.
 
* Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.
 
[[File:Pull_up_TRST.jpg|200px]]
 
[[File:Pull_up_TRST.jpg|200px]]
 +
 +
==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.
 +
[[File:Streamit_v2.3_2nd_QSPI_disable.jpg|200px]]
 +
<br>
 +
<br>
 +
'''(Optional) 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'
 +
[[File:Streamit_v2.3_16MB_SDRAM_Mod.jpg|200px]]
  
 
==Board Usage Limitations==
 
==Board Usage Limitations==
Line 70: Line 82:
 
==Build Environment Setup==
 
==Build Environment Setup==
  
===Install the RZ/A1 RSK BSP===
+
===Install the RZ/A 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.
 
* 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
 
  # Clone the BSP from github
  $ git clone https://github.com/renesas-rz/rskrza1_bsp.git
+
  $ git clone https://github.com/renesas-rz/rza_linux-4.9_bsp.git
  $ cd rskrza1_bsp
+
$ cd rza_linux-4.9_bsp
 +
or
 +
$ git clone https://github.com/renesas-rz/rza_linux-4.14_bsp.git
 +
  $ cd rza_linux-4.14_bsp
 +
or
 +
$ git clone https://github.com/renesas-rz/rza_linux-4.19_bsp.git
 +
$ cd rza_linux-4.19_bsp
 +
 
  
 
===Get Latest code from github===
 
===Get Latest code from github===
Line 102: Line 121:
 
===Build the File System===
 
===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.
 
* 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
 
  $ ./build.sh buildroot
 
* Also build the AXFS XIP file image
 
$ ./build.sh axfs
 
  
 
===Build u-boot===
 
===Build u-boot===
$ ./build.sh u-boot streamit_defconfig
 
      # [ Please read the note below before doing the next step ]
 
 
  $ ./build.sh u-boot
 
  $ ./build.sh u-boot
'''NOTE''': The first time build, you '''must''' select what SDRAM device is on your board.
+
'''NOTE''': Note, if you made the modifications to your board to use 16MB SDRAM (so you could also use the camera) instead of the full 32MB (no camera), edit the top of file '''rza_linux-4.9_bsp/output/u-boot-2017.05/include/configs/streamit.h''' and modify the SDRAM settings at the top of the file.
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 the Kernel and Device Tree===
$ ./build.sh kernel streamit_xip_defconfig
 
 
  $ ./build.sh kernel xipImage
 
  $ ./build.sh kernel xipImage
 
  $ ./build.sh kernel dtbs
 
  $ ./build.sh kernel dtbs
Line 154: Line 163:
  
 
===[[File:Alert.gif]] Programming Note [[File:Alert.gif]]===
 
===[[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:
+
Connecting to this board with J-Link sometimes does not work on V1 and V2.2 boards. However, there is a method to get it to connect every time:
 
  1. Hold the RESET button on the board down
 
  1. Hold the RESET button on the board down
 
  2. Start to run the J-Link programming script
 
  2. Start to run the J-Link programming script
Line 165: Line 174:
 
===Program u-boot into QSPI Flash===
 
===Program u-boot into QSPI Flash===
 
* Requires Jlink to be connected to Linux (if running a Virtual Machine)
 
* Requires Jlink to be connected to Linux (if running a Virtual Machine)
* This will program teh u-boot binary directly into the QSPI flash
+
* This will program the u-boot binary directly into the QSPI flash
  $ ./build.sh jlink output/u-boot-2015.01/u-boot.bin 0x18000000
+
  $ ./build.sh jlink u-boot
  
 
* '''Test that u-boot comes up'''
 
* '''Test that u-boot comes up'''
Line 177: Line 186:
 
===Program Device Tree for into QSPI Flash===
 
===Program Device Tree for into QSPI Flash===
 
* This will program the u-boot binary directly into the 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
+
  $ ./build.sh jlink dtb
  
 
===Program Kernel into QSPI Flash===
 
===Program Kernel into QSPI Flash===
 
* Make sure u-boot is programmed and u-boot is running
 
* Make sure u-boot is programmed and u-boot is running
 
* Download the kernel binary to on-chip RAM using Jlink:
 
* Download the kernel binary to on-chip RAM using Jlink:
  $ ./build.sh jlink output/linux-3.14/arch/arm/boot/xipImage 0x0C000000
+
  $ ./build.sh jlink xipImage
 
* After download, enter these '''u-boot''' commands to copy from RAM to SPI flash
 
* 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
 
  => sf probe 0 ; sf erase 200000 500000 ; sf write 0c000000 200000 500000
Line 188: Line 197:
 
===Program File System===
 
===Program File System===
 
* If your file system is '''smaller than 16MB''' (the size of SDRAM), use this method because it's faster:
 
* 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
+
  $ ./build.sh jlink rootfs_axfs
 
* After download, enter these '''u-boot''' commands to copy from RAM to SPI flash
 
* After download, enter these '''u-boot''' commands to copy from RAM to SPI flash
 
* Programs 12MB
 
* Programs 12MB
Line 195: Line 204:
 
* 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...
 
* 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.
 
* 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
+
  $ ./build.sh jlink rootfs_axfs 0x18800000
  
 
== Booting the Board==
 
== Booting the Board==

Latest revision as of 03:56, 3 October 2019

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


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

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.

Remove R7.jpg

  • Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.

Pull up TRST.jpg

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.

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

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.

Remove R7.jpg

  • Pull /TRST up to VCC though a 10K resistor between pins 1 and 3 on the JTAG header.

Pull up TRST.jpg

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.

Streamit v2.3 2nd QSPI disable.jpg

(Optional) 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'

Streamit v2.3 16MB SDRAM Mod.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/A 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/rza_linux-4.9_bsp.git
$ cd rza_linux-4.9_bsp

or

$ git clone https://github.com/renesas-rz/rza_linux-4.14_bsp.git
$ cd rza_linux-4.14_bsp

or

$ git clone https://github.com/renesas-rz/rza_linux-4.19_bsp.git
$ cd rza_linux-4.19_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.
$ ./build.sh buildroot

Build u-boot

$ ./build.sh u-boot

NOTE: Note, if you made the modifications to your board to use 16MB SDRAM (so you could also use the camera) instead of the full 32MB (no camera), edit the top of file rza_linux-4.9_bsp/output/u-boot-2017.05/include/configs/streamit.h and modify the SDRAM settings at the top of the file.


Build the Kernel and Device Tree

$ ./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 Programming Note Alert.gif

Connecting to this board with J-Link sometimes does not work on V1 and V2.2 boards. 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

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

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 xipImage
  • 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 rootfs_axfs
  • 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 rootfs_axfs 0x18800000

Booting the Board

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