Renesas
RZ/V AI

6.00

The best solution for
starting your AI applications.

Provided by Renesas Electronics Corporation


To keep you updated,
Watch our GitHub repository
Watch



This project is maintained by renesas-rz

Hosted on GitHub Pages — Theme by orderedlist

Developer's Guide



This page explains the additional information of How to Build RZ/V AI SDK for Linux developers.
Terminology


Contents

ID Title Device Target
D1 Change the size of the microSD card image in WIC format RZ/V2H
RZ/V2N
AI SDK Source Code v5.20
AI SDK Source Code v6.00
D2 How to boot from QSPI RZ/V2L AI SDK Source Code v5.00
D3 How to boot from xSPI RZ/V2H
RZ/V2N
AI SDK Source Code v5.20
AI SDK Source Code v6.00
D4 How to boot from eMMC RZ/V2N AI SDK Source Code v6.00
D5 How to modify the memory map RZ/V2H
RZ/V2N
AI SDK Source Code v5.20
AI SDK Source Code v6.00
D6 How to change the DDR size RZ/V2H
RZ/V2N
AI SDK Source Code v5.20
AI SDK Source Code v6.00

D1. For RZ/V2H, RZ/V2N: Change the size of the microSD card image in WIC format

This section explains how to change the microSD card image size by changing the build settings of the WIC file.
Note This instruction assumes that you have completed the steps in How to build RZ/V AI SDK Source Code below.
  • RZ/V2H: Step 3-10
  • RZ/V2N: Step 3-9
    1. Open ${YOCTO_WORK}/build/conf/local.conf file in a text editor.
    2. Find the following text in the file and edit the highlighted value to define the disk space of the image in Kbytes.
      ...
      # Support WIC images with default wks from WKS_DEFAULT_FILE
      # Reupdate WKS_DEFAULT_FILE if want to support another wks file.
      WKS_SUPPORT ?= "1"
      WKS_DEFAULT_FILE_rzv2h-dev = "rz-image-bootpart-mmc.wks"
      WKS_DEFAULT_FILE_rzv2h-evk-alpha = "rz-image-bootpart-esd_rzv2h.wks"
      WKS_DEFAULT_FILE_rzv2h-evk-ver1 = "rz-image-bootpart-esd_rzv2h.wks"
      # Defines additional free disk space created in the image in Kbytes.
      IMAGE_ROOTFS_EXTRA_SPACE = "8388608"
      ...
      
      The table below shows examples of setting values written in local.conf file.
      Note If you have customized Linux, the disk image size may differ from the table.
      Device SD card image size
      (Gbytes)
      Setting values in the "local.conf" file
      (Kbytes)
      RZ/V2H 4 1048576
      8 4194304
      16 8388608 (default)
      RZ/V2N 8 1048576
      16 6291456 (default)
      32 16777216
    After this procedure, please proceed to the step in How to build RZ/V AI SDK Source Code below to build the Linux kernel files.
  • RZ/V2H: Step 3-11
  • RZ/V2N: Step 3-10

  • D2. For RZ/V2L: How to boot from QSPI

    This section explains how to setup the board for QSPI Bootloader.
    Note This step is required only when starting the AI SDK or when using the new version of AI SDK.
    If you have already setup the microSD card and the bootloader written in QSPI on the board, skip this step and proceed to the next step (Step7:2. Deploy Application to the Board in Getting Started).
    Follow the instruction below to setup the board.
    Note Explanation in this step is for QSPI Bootloader, which requires Windows PC as serial communication console.
    • 1. Install Terminal Emulator
      Note If you have already installed terminal emulator, skip this step and proceed to next procedure.
      1. Install following software on Windows PC to be used as serial communication console.
        • Terminal emulator
          • Operating Environment: Tera Term

    • 2. Install the serial port driver
      Note If you have already installed the serial port driver, skip this step and proceed to next procedure.
      The serial communication between Windows PC and RZ/V2L EVK requires following driver.
      https://ftdichip.com/drivers/vcp-drivers/

      1. Download the software "Virtual COM port (VCP) driver" from the windows version "setup executable" on the download page and extract it.

      2. Run the *.exe file extracted to install the serial port driver.


    • 3. Write bootloaders to QSPI on the board
      1. Copy following files to your Windows PC.

        Path File name Description
        ${WORK}/board_setup/QSPI/bootloader Flash_Writer_SCIF_RZV2L_SMARC_PMIC_DDR4_2GB_1PCS.mot
        bl2_bp-smarc-rzv2l_pmic.srec
        fip-smarc-rzv2l_pmic.srec
        Directory path and files when using files included with RZ/V2L AI SDK
        ${YOCTO_WORK}/build/tmp/deploy/images/smarc-rzv2l Directory path and files when using files generated with How to build RZ/V2L AI SDK Source Code

      2. Connect Windows PC and Board via Serial to MicroUSB Cable.

      3. Change SW1 and SW11 setting (see the figure below).

        board

      4. Connect the power cable to CN6 on the Board.

      5. Press and hold the power button (SW9) for 1 second to turn on the power.

      6. On Windows PC, open the terminal emulator. Here, we use Tera Term as an example.

      7. Select "File" > "New Connection" and select "Serial" port as shown below.

        board

      8. Open the configuration window from the "Setup">"Terminal" and change the setting as follows.

        Item Value
        New-line Receive: Auto
        Transmit: CR

      9. Open the configuration window from the "Setup">"Serial port" and change the setting as follows.

        Item Value
        Baud rate 115200
        Data 8bit
        Parity none
        Stop 1bit
        Flow control none
        Transmit delay 0msec/char

      10. Press the reset button (SW10) and following message will be displayed on the terminal.
          SCIF Download mode
        (C) Renesas Electronics Corp.
        -- Load Program to System RAM ---------------
        please send !

      11. Open "File" > "Send file..." and send the Flash Writer file (*.mot) as a text.
        If following message is displayed, the file transfer suceeded.
        Flash writer for RZ/V2 Series Vx.xx xxx.xx,20xx
        Product Code : RZ/V2L
        >

      12. Enter "XLS2" on the terminal to get following messages.
        > XLS2
        ===== Qspi writing of RZ/G2 Board Command =============
        Load Program to Spiflash
        Writes to any of SPI address.
        Micron : MT25QU512
        Program Top Address & Qspi Save Address
        ===== Please Input Program Top Address ============
          Please Input : H'

      13. Enter "11E00". The log continues.
          Please Input : H'11E00
        ===== Please Input Qspi Save Address ===
          Please Input : H'

      14. Enter "00000". The log continues.
          Please Input : H'00000
        Work RAM(H'50000000-H'53FFFFFF) Clear....
        please send ! ('.' & CR stop load)

      15. After the "please send!" message, open "File" > "Send file..." and send the bl2_bp-smarc-rzv2l_pmic.srec file as a text from the terminal software.

      16. In case a message to prompt to clear data like below, please enter "y".
        SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

      17. Following log will be displayed. The end address is depending on the version of AI SDK.
        SAVE SPI-FLASH.......
        ======= Qspi Save Information =================
        SpiFlashMemory Stat Address : H'00000000
        SpiFlashMemory End Address : H'00009A80
        ===========================================================

      18. Enter "XLS2" on the terminal to get following messages.
        > XLS2
        ===== Qspi writing of RZ/G2 Board Command =============
        Load Program to Spiflash
        Writes to any of SPI address.
        Micron : MT25QU512
        Program Top Address & Qspi Save Address
        ===== Please Input Program Top Address ============
          Please Input : H'

      19. Enter "00000". The log continues.
          Please Input : H'00000
        ===== Please Input Qspi Save Address ===
          Please Input : H'

      20. Enter "1D200". The log continues.
          Please Input : H'1D200
        Work RAM(H'50000000-H'53FFFFFF) Clear....
        please send ! ('.' & CR stop load)

      21. After the "please send!" message, open "File" > "Send file..." and send the fip-smarc-rzv2l_pmic.srec file as a text from the terminal software.

      22. In case a message to prompt to clear data like below, please enter "y".
        SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

      23. Following log will be displayed. The end address is depending on the version of AI SDK.
        SAVE SPI-FLASH.......
        ======= Qspi Save Information =================
        SpiFlashMemory Stat Address : H'0001D200
        SpiFlashMemory End Address : H'000CC73F
        ===========================================================

      24. Power-off the board by pressing the power button (SW9) for 2 seconds to change SW11 for booting the board.


    • 4. Setup U-boot setting
      Follow the procedure below to set the booting configuration of the board.

      1. Insert the microSD card to the Board.
        Note Use the microSD card slot CN10 as shown in the figure.

      2. Change SW1 and SW11 setting as shown in the right figure.

      3. Connect the Board and Windows PC by the USB Serial to Micro USB cable.

      4. Connect the power cable to the Board.

      5. Press power button for 1 second to turn on the board.

      6. Open the terminal emulator, i.e., Tera Term, and connect with COMS port.
        Note When using Tera Term, change the configuration as explained in Write bootloaders to QSPI on the board.

      7. On the terminal emulator, keep pressing ENTER key and on the board, press reset button.

      boot
      1. U-boot console will be activated.

      2. Run the following commands to set the booting configuration.
        env default -a
        saveenv
        boot

      3. After the boot-up, the login message will be shown on the console.
        smarc-rzv2l login:

      4. Log-in to the system using the information below.
        • user: root
        • password: none

      5. Shutdown the board to finish the U-boot setting.
        Shutdown Procedures


    After this procedure, you can copy the AI Application and boot the board.
    Refer to the Step 7: 2. Deploy Application to the Board in RZ/V2L EVK Getting Started.

    D3. For RZ/V2H, RZ/V2N: How to boot from xSPI

    This section explains how to boot from xSPI on RZ/V EVK.
    Note This instruction assumes that you have completed the steps in How to build RZ/V AI SDK Source Code and RZ/V EVK Getting Started.
    However, if you would like to use the files for xSPI boot included in RZ/V AI SDK,
    skip Step 3 of How to build RZ/V AI SDK Source code and use the files in ${WORK}/board_setup/xSPI directory.
    Device How to build RZ/V AI SDK Source Code RZ/V EVK Getting Started
    RZ/V2H Step 3 Step 7-1
    RZ/V2N Step 3 Step 7-1
    Note To perform this procedure, please prepare the following equipment in addition to the 1.Necessary Equipments.
    • Windows PC
    • MicroUSB to Serial Cable for serial communication (Included in RZ/V EVK)

    Follow the instruction below to setup the board.

    • 1. Install Terminal Emulator
      Note If you have already installed terminal emulator, skip this step and proceed to next procedure.
      1. Install following software on Windows PC to be used as serial communication console.
        • Terminal emulator
          • Operating Environment: Tera Term

    • 2. Install the serial port driver
      Note If you have already installed the serial port driver, skip this step and proceed to next procedure.
      The serial communication between Windows PC and RZ/V EVK requires following driver.
      https://ftdichip.com/drivers/vcp-drivers/

      1. Download the software "Virtual COM port (VCP) driver" from the windows version "setup executable" on the download page and extract it.

      2. Run the *.exe file extracted to install the serial port driver.


    • 3. Write bootloaders on the board
      1. Copy following files to your Windows PC.

        Device Path File name Description
        RZ/V2H ${YOCTO_WORK}/build/tmp/deploy/images/rzv2h-evk-ver1 Flash_Writer_SCIF_RZV2H_DEV_INTERNAL_MEMORY.mot
        bl2_bp_spi-rzv2h-evk-ver1.srec
        fip-rzv2h-evk-ver1.srec
        Directory path and files when using files generated with How to build RZ/V AI SDK Source Code
        ${WORK}/board_setup/xSPI/bootloader Directory path and files when using files included with RZ/V AI SDK
        RZ/V2N ${YOCTO_WORK}/build/tmp/deploy/images/rzv2n-evk Flash_Writer_SCIF_RZV2N_DEV_LPDDR4X.mot
        bl2_bp_spi-rzv2n-evk.srec
        fip-rzv2n-evk.srec
        Directory path and files when using files generated with How to build RZ/V AI SDK Source Code
        ${WORK}/board_setup/xSPI/bootloader Directory path and files when using files included with RZ/V AI SDK

      2. Connect Windows PC and Board via Serial to MicroUSB Cable.

      3. Change DSW1 setting to Boot mode 3 (SCIF download). See the figure below.

        board

      4. Connect the power cable to CN13 on the Board.

      5. Turn the SW3 to ON.

      6. On Windows PC, open the terminal emulator. Here, we use Tera Term as an example.

      7. Select "File" > "New Connection" and select "Serial" port as shown below.

        board

      8. Open the configuration window from the "Setup">"Terminal" and change the setting as follows.

        Item Value
        New-line Receive: Auto
        Transmit: CR

      9. Open the configuration window from the "Setup">"Serial port" and change the setting as follows.

        Item Value
        Baud rate 115200
        Data 8bit
        Parity none
        Stop 1bit
        Flow control none
        Transmit delay 0msec/char

      10. Turn the SW2 to ON to power on the Board and following message will be displayed on the terminal.
        SCI Download mode (Normal SCI boot)
        -- Load Program to SRAM ---------------

      11. Open "File" > "Send file..." and send the Flash Writer file (*.mot) as a text.
        If following message is displayed, the file transfer succeeded.
        Flash writer for RZ/V2x Series Vx.xx xxx.xx,20xx
         Product Code : RZ/V2x
        >

      12. Enter "XLS2" on the terminal to get following messages.
        > XLS2
        ===== Qspi writing of RZ/V2x Board Command =============
        Load Program to Spiflash
        Writes to any of SPI address.
        Program size & Qspi Save Address
        ===== Please Input Program Top Address ============
          Please Input : H'

      13. Enter "8101e00". The log continues.
          Please Input : H'8101e00
        ===== Please Input Qspi Save Address ===
          Please Input : H'

      14. Enter "00000". The log continues.
          Please Input : H'00000
        please send ! ('.' & CR stop load)

      15. After the "please send!" message, open "File" > "Send file..." and send the bl2_bp_spi-rzv2*.srec file as a text from the terminal software.

      16. In case a message to prompt to clear data like below, please enter "y".
        SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

      17. Following log will be displayed. The end address is depending on the version of AI SDK.
        Write to SPI Flash memory.
        ======= Qspi Save Information =================
        SpiFlashMemory Stat Address : H'00000000
        SpiFlashMemory End Address  : H'00036D17
        ===========================================================

      18. Enter "XLS2" on the terminal to get following messages.
        > XLS2
        ===== Qspi writing of RZ/V2x Board Command =============
        Load Program to Spiflash
        Writes to any of SPI address.
        Program size & Qspi Save Address
        ===== Please Input Program Top Address ============
          Please Input : H'

      19. Enter "00000". The log continues.
          Please Input : H'00000
        ===== Please Input Qspi Save Address ===
          Please Input : H'

      20. Enter "60000". The log continues.
          Please Input : H'60000
        please send ! ('.' & CR stop load)

      21. After the "please send!" message, open "File" > "Send file..." and send the fip-rzv2*.srec file as a text from the terminal software.

      22. In case a message to prompt to clear data like below, please enter "y".
        SPI Data Clear(H'FF) Check : H'00000000-0000FFFF,Clear OK?(y/n)

      23. Following log will be displayed. The end address is depending on the version of AI SDK.
        Write to SPI Flash memory.
        ======= Qspi Save Information =================
        SpiFlashMemory Stat Address : H'00060000
        SpiFlashMemory End Address  : H'0011C2EE
        ===========================================================

      24. Power-off the board to change DSW1 for booting the board.


    • 4. Setup U-boot setting
      Follow the procedure below to set the booting configuration of the board.

      1. Insert the microSD card to the Board.
        Note Use the microSD card slot SD2 as shown in the figure.

      2. Change DSW1 setting to Boot mode 2 (xSPI boot) as shown in the right figure.

      3. Connect the Board and Windows PC by the USB Serial to Micro USB cable.

      4. Connect the power cable to the Board.

      5. Turn the SW3 to ON.

      6. Open the terminal emulator, i.e., Tera Term, and connect with COMS port.
        Note When using Tera Term, change the configuration as explained in Write bootloaders on the board.

      7. Turn the SW2 to ON to power on the Board.

      8. On the terminal emulator, keep pressing ENTER key.

      boot
      boot
      1. U-boot console will be activated.

      2. Run the following commands to set the booting configuration.
        env default -a
        saveenv
        boot

      3. After the boot-up, the login message will be shown on the console.
        rzv2h-evk1 login:

      4. Log-in to the system using the information below.
        • user: root
        • password: none

      5. Shutdown the board to finish the U-boot setting.
        Note To shutdown the board safely, please refer to following steps.


    This is the end of How to boot from xSPI on RZ/V2H EVK and RZ/V2N EVK.

    D4. For RZ/V2N: How to boot from eMMC

    This section explains how to boot from eMMC on RZ/V2N EVK.
    Note This instruction assumes that you have completed the steps in How to build RZ/V AI SDK Source Code and RZ/V EVK Getting Started below.
    Device How to build RZ/V AI SDK Source Code RZ/V EVK Getting Started
    RZ/V2N Step 3 Step 7-1
    Note To perform this procedure, please prepare the following equipment in addition to the 1.Necessary Equipments.
    • Windows PC
    • MicroUSB to Serial Cable for serial communication (Included in RZ/V2N EVK)
    • RZ/V2N EVK with eMMC sub board
      For more information on connecting the sub board, see RZ/V2N Evaluation Board Kit Hardware Manual.

    Follow the instruction below to setup the board.

    • 1. Install Terminal Emulator
      Note If you have already installed terminal emulator, skip this step and proceed to next procedure.
      1. Install following software on Windows PC to be used as serial communication console.
        • Terminal emulator
          • Operating Environment: Tera Term

    • 2. Install the serial port driver
      Note If you have already installed the serial port driver, skip this step and proceed to next procedure.
      The serial communication between Windows PC and RZ/V EVK requires following driver.
      https://ftdichip.com/drivers/vcp-drivers/

      1. Download the software "Virtual COM port (VCP) driver" from the windows version "setup executable" on the download page and extract it.

      2. Run the *.exe file extracted to install the serial port driver.


    • 3. Write bootloaders on the board
      1. Writing the eMMC bootloader
        1. Copy following files to your Windows PC.

          Device Path File name
          RZ/V2N ${YOCTO_WORK}/build/tmp/deploy/images/rzv2n-evk Flash_Writer_SCIF_RZV2N_DEV_LPDDR4X.mot
          bl2_bp_mmc-rzv2n-evk.srec
          bl2_bp_spi-rzv2n-evk.srec
          fip-rzv2n-evk.srec

        2. Connect the eMMC sub board to the EVK and connect Windows PC and EVK CN12 connector via microB USB cable.

        3. Change DSW1 setting to Boot mode 3 (SCIF download). See the figure below.

          board

        4. Connect the power cable to CN13 on the Board.

        5. Turn the SW3 to ON.

        6. On Windows PC, open the terminal emulator. Here, we use Tera Term as an example.

        7. Select "File" > "New Connection" and select "Serial" port as shown below.

          board

        8. Open the configuration window from the "Setup">"Terminal" and change the setting as follows.

          Item Value
          New-line Receive: Auto
          Transmit: CR

        9. Open the configuration window from the "Setup">"Serial port" and change the setting as follows.

          Item Value
          Baud rate 115200
          Data 8bit
          Parity none
          Stop 1bit
          Flow control none
          Transmit delay 0msec/char

        10. Turn the SW2 to ON to power on the Board and following message will be displayed on the terminal.
          SCI Download mode (Normal SCI boot)
          -- Load Program to SRAM ---------------
          

        11. Open "File" > "Send file..." and send the Flash Writer file (*.mot) as a text.
          If following message is displayed, the file transfer succeeded.
          Flash writer for RZ/V2x Series Vx.xx xxx.xx,20xx
           Product Code : RZ/V2x
          >
          

        12. Enter "EM_W" command and the following parameters in red.
          > EM_W
          EM_W Start -----------------------------------------------------------------------
          Please select,eMMC Partition Area.
          0:User Partition Area : 62160896 KBytes
          eMMC Sector Cnt : H'0 -H'0768FFFF
          1:Boot Partition 1 : 32256 KBytes
          eMMC Sector Cnt : H'0 -H'0000FBFF
          2:Boot Partition 2 : 32256 KBytes
          eMMC Sector Cnt : H'0 -H'0000FBFF
          ---------------------------------------------------------
          Select area(0-2)> 1
          --Boot Partition 1 Program -----------------------------
          Please Input Start Address in sector :1
          Please Input Program Start Address : 8101E00
          Work RAM (H'50000000-H'53FFFFFF) Clear....
          please send ! ('.' & CR stop load)
          

        13. After the "please send!" message, open "File" > "Send file..." and send the bl2_bp_mmc-rzv2*.srec file as a text from the terminal software. Following log will be displayed.
          please send ! ('.' & CR stop load)
          SAVE -FLASH.......
          EM_W Complete!
          

        14. Enter "EM_W" command and the following parameters in red.
          > EM_W
          EM_W Start -----------------------------------------------------------------------
          Please select,eMMC Partition Area.
          0:User Partition Area : 62160896 KBytes
          eMMC Sector Cnt : H'0 -H'0768FFFF
          1:Boot Partition 1 : 32256 KBytes
          eMMC Sector Cnt : H'0 -H'0000FBFF
          2:Boot Partition 2 : 32256 KBytes
          eMMC Sector Cnt : H'0 -H'0000FBFF
          ---------------------------------------------------------
          Select area(0-2)> 1
          --Boot Partition 1 Program -----------------------------
          Please Input Start Address in sector :300
          Please Input Program Start Address : 0
          Work RAM (H'50000000-H'53FFFFFF) Clear....
          please send ! ('.' & CR stop load)
          

        15. After the "please send!" message, open "File" > "Send file..." and send the fip-rzv2*.srec file as a text from the terminal software. Following log will be displayed.
          please send ! ('.' & CR stop load)
          SAVE -FLASH.......
          EM_W Complete!
          

        16. Enter "em_secsd" command and the following parameters in red.
          > em_secsd
          Please Input EXT_CSD Index(H'00 -H'1FF) :b1
          EXT_CSD[B1] = 0x02
          Please Input Value(H'00 -H'FF) :2
          EXT_CSD[B1] = 0x02
          > em_secsd
          Please Input EXT_CSD Index(H'00 -H'1FF) :b3
          EXT_CSD[B3] = 0x09
          Please Input Value(H'00 -H'FF) :8
          EXT_CSD[B3] = 0x08
          

      2. Writing the xSPI bootloader
        1. Enter "XLS2" command and the following parameters in red.
          > XLS2
          ===== Qspi writing of RZ/G3S Board Command =============
          Load Program to Spiflash
          Writes to any of SPI address.
          Micron : MT25QU512
          Program Top Address & Qspi Save Address
          ===== Please Input Program Top Address ============
          Please Input : H'8101E00
          ===== Please Input Qspi Save Address ===
          Please Input : H'0
          please send ! ('.' & CR stop load)
          

        2. After the "please send!" message, open "File" > "Send file..." and send the bl2_bp_spi-rzv2*.srec file as a text from the terminal software.

        3. Following log will be displayed. The end address is depending on the version of AI SDK.
          please send ! ('.' & CR stop load)
          Erase SPI Flash memory...
          Erase Completed
          Write to SPI Flash memory.
          ======= Qspi Save Information =================
          SpiFlashMemory Stat Address : H'00000000
          SpiFlashMemory End Address  : H'0001E81F
          ===========================================================
          

        4. Enter "XLS2" command and the following parameters in red.
          > XLS2
          ===== Qspi writing of RZ/G3S Board Command =============
          Load Program to Spiflash
          Writes to any of SPI address.
          Micron : MT25QU512
          Program Top Address & Qspi Save Address
          ===== Please Input Program Top Address ============
          Please Input : H'0
          ===== Please Input Qspi Save Address ===
          Please Input : H'60000
          please send ! ('.' & CR stop load)
          

        5. After the "please send!" message, open "File" > "Send file..." and send the fip-rzv2*.srec file as a text from the terminal software.
          Following log will be displayed. The end address is depending on the version of AI SDK.
          please send ! ('.' & CR stop load)
          Erase SPI Flash memory...
          Erase Completed
          Write to SPI Flash memory.
          ======= Qspi Save Information =================
          SpiFlashMemory Stat Address : H'00060000
          SpiFlashMemory End Address  : H'0011AD3E
          ===========================================================
          

        6. Shutdown the board.


    • 4. Formatting eMMC and writing file system to eMMC
      Follow the procedure below to create a microSD card.

      1. Use the SD card created in Step 7-1:Setup RZ/V2N EVK in RZ/V2N EVK Getting Started.

      2. Insert the microSD card to your Linux PC and copy "core-image-weston-rzv2n-evk.rootfs.tar.bz2" file on partition 2.
        sudo mkdir /mnt/sd -p
        sudo mount /dev/sdb2 /mnt/sd
        sudo cp ${YOCTO_WORK}/build/tmp/deploy/images/rzv2n-evk/core-image-weston-rzv2n-evk.rootfs.tar.bz2 /mnt/sd/root/
        sync
        sudo umount /mnt/sd
        Warning Change /dev/sdb to your microSD card device name.

    • 5. Setup U-boot setting and writing rootfs to eMMC
      Follow the procedure below to set the booting configuration of the board.

      1. Insert the microSD card to the Board.
        Note Use the microSD card slot SD2 as shown in the figure.

      2. Change DSW1 setting to Boot mode 2 (xSPI boot) as shown in the right figure.

      3. Connect the Board and Windows PC by the USB Serial to Micro USB cable.

      4. Connect the power cable to the Board.

      5. Turn the SW3 to ON.

      6. Open the terminal emulator, i.e., Tera Term, and connect with COMS port.
        Note When using Tera Term, change the configuration as explained in Write bootloaders on the board.

      7. Turn the SW2 to ON to power on the Board.

      boot
      1. Log in as root and create partition the eMMC using the "fdisk" command as shown below.
        root@rzv2n-evk:~# fdisk /dev/mmcblk0
        
        Welcome to fdisk (util-linux 2.39.3).
        Changes will remain in memory only, until you decide to write them.
        Be careful before using the write command.
        Device does not contain a recognized partition table.
        Created a new DOS disklabel with disk identifier 0x7795745a.
        
        Command (m for help): o
        Created a new DOS disklabel with disk identifier 0x5ff48dd9.
        Command (m for help): n
        Partition type
        p primary (0 primary, 0 extended, 4 free)
        e extended (container for logical partitions)
        Select (default p):[Enter]
        Using default response p.
        Partition number (1-4, default 1):[Enter]
        First sector (2048-124321791, default 2048):[Enter]
        Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-124321791, default 124321791): +500M
        
        Created a new partition 1 of type 'Linux' and of size 500 MiB.
        
        Command (m for help): n
        Partition type
        p primary (1 primary, 0 extended, 3 free)
        e extended (container for logical partitions)
        Select (default p):[Enter]
        
        Using default response p.
        Partition number (2-4, default 2):[Enter]
        First sector (1026048-124321791, default 1026048):[Enter]
        Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-124321791, default 124321791):[Enter]
        
        Created a new partition 2 of type 'Linux' and of size 58.8 GiB.
        
        Command (m for help): p
        Disk /dev/mmcblk0: 59.29 GiB, 63652757504 bytes, 124321792 sectors
        Units: sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: dos
        Disk identifier: 0x1363dee0
        
        Device Boot Start End Sectors Size Id Type
        /dev/mmcblk0p1 2048 1026047 1024000 500M 83 Linux
        /dev/mmcblk0p2 1026048 124321791 123295744 58.8G 83 Linux
        
        Command (m for help): w
        The partition table has been altered.
        Calling ioctl() to re-read partition table.[ 189.289424] mmcblk0: p1 p2
        Syncing disks.
        

      2. Format the eMMC with "mkfs.ext4" command as shown below.
        root@rzv2n-evk:~# mkfs.ext4 /dev/mmcblk0p1
        mke2fs 1.47.0 (5-Feb-2023)
        Discarding device blocks: done
        Creating filesystem with 512000 1k blocks and 128016 inodes
        Filesystem UUID: b27e380a-d095-4482-ad91-b1ffe4493c59
        Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
        
        Allocating group tables: done
        Writing inode tables: done
        Creating journal (8192 blocks): done
        Writing superblocks and filesystem accounting information: done
        
        root@rzv2n-evk:~# mkfs.ext4 /dev/mmcblk0p2
        mke2fs 1.47.0 (5-Feb-2023)
        Discarding device blocks: done
        Creating filesystem with 15411968 4k blocks and 3858432 inodes
        Filesystem UUID: c790440c-9550-4f09-9d7e-4ab3b05077e5
        Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424
        
        Allocating group tables: done
        Writing inode tables: done
        Creating journal (65536 blocks): done
        Writing superblocks and filesystem accounting information: done
        

      3. Write the Root filesystem as shown blow.
        Note It will take a few minutes to write the Root filesystem.
        root@rzv2n-evk:~# mount /dev/mmcblk0p2 /mnt/
        [ 357.263306] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
        root@rzv2n-evk:~# tar xf /root/core-image-weston-rzv2n-evk.rootfs.tar.bz2 -C /mnt/
        root@rzv2n-evk:~# sync
        root@rzv2n-evk:~# umount /dev/mmcblk0p2
        

      4. Shutdown the board and remove the microSD card.
        Note To shutdown the board safely, please refer to A4. Shutdown RZ/V2N EVK.

    • 6. Booting from eMMC
      Follow the procedure below to set the booting configuration of the board.

      1. Change DSW1 setting to Boot mode 1 (eMMC boot) as shown in the right figure.

      2. Connect the Board and Windows PC by the USB Serial to Micro USB cable.

      3. Connect the power cable to the Board.

      4. Turn the SW3 to ON.

      5. Open the terminal emulator, i.e., Tera Term, and connect with COMS port.
        Note When using Tera Term, change the configuration as explained in Write bootloaders on the board.

      6. Turn the SW2 to ON to power on the Board.

      7. On the terminal emulator, keep pressing ENTER key.

      boot
      1. U-boot console will be activated.

      2. Run the following commands to set the booting configuration.
        env default -a
        saveenv
        boot

      3. After the boot-up, the login message will be shown on the console.
        rzv2n-evk login:

      4. Log-in to the system using the information below.
        • user: root
        • password: none

      5. Shutdown the board to finish the U-boot setting.
        Note To shutdown the board safely, please refer to A4. Shutdown RZ/V2N EVK.


    This is the end of How to boot from eMMC on RZ/V2N EVK.

    D5. For RZ/V2H, RZ/V2N: How to modify the memory map

    This section explains how to modify the device tree file to change the memory map.
    If you also want to change the DDR size,
    performe D6.How to change the DDR size after performing the steps in this section.
    Note Modifications to the memory map are to be performed at the your own risk and should be thoroughly validated.
    Note This instruction assumes that you have completed the steps in How to build RZ/V AI SDK Source Code.
    If you want to execute the D6.Example after the D5.Example, do not apply the patch file for BUS settings in Step 3-5-1.
  • How to build RZ/V2H AI SDK Source Code
  • How to build RZ/V2N AI SDK Source Code

    1. Check the device tree file.
      If you build AI ​​SDK Source Code following the instructions in How to build, device tree file will be generated as shown below.
      Device Path Device tree file
      RZ/V2H ${YOCTO_WORK}/build/tmp/work-shared/rzv2h-evk-ver1/kernel-source/arch/arm64/boot/dts/renesas r9a09g057h4-evk-ver1.dts
      RZ/V2N ${YOCTO_WORK}/build/tmp/work-shared/rzv2n-evk/kernel-source/arch/arm64/boot/dts/renesas r9a09g056n44-evk.dts

      AI ​​SDK memory map is set as follows by default:
      V2H V2N memory map

    2. Modify the device tree file.
      You can define new memory regions in the reserved-memory area of the device tree, and the default memory regions can be moved or reduced.
      We recommend you do not change the area up to address 0x80000000, which includes Linux CMA(global_cma) memory region,
      and each memory regions don't span DDR channels. (ch0: 0x40000000-0x23FFFFFFF, ch1: 0x240000000-0x43FFFFFFF)
      If you wish to reduce the default memory regions, follow the table below.
      Note When modifying the device tree, please note the following:
      • Be careful not to overlap the memory regions.
      • Be careful to stay within the DDR size.
        AI ​​SDK assumes the following DDR configuration by default.
        (The area 0x40000000-0x48000000 is Security Area and cannot be used.)
        Device DDR Configuration
        RZ/V2H ch0: 0x40000000-0x23FFFFFFF
        ch1: 0x240000000-0x43FFFFFFF
        RZ/V2N ch0: 0x40000000-0x23FFFFFFF

      Memory region name on memory map Memory region name on device tree Description
      Linux CMA global_cma We recommend that you do not change it. If you make it smaller, be sure to test it thoroughly.
      If you change this memory region, you will also need to change the u-boot device tree.
      CMA for Codec mmp_reserved It depends on the resolution and number of channels used by the Codec.
      On the condition that mmp_reserved is not used for anything other than Codec Library and that responsibility is taken by the party making the changes, mmp_reserved can be reduced to 256MB.
      CMA for ISP(1) isp_reserved It depends on the resolution and number of channels used by the ISP.
      isp_reserved assumes 4K, 30fps, and 2 channels. Reducing isp_reserved will allow for proportional reduction.
      For example, if you only use 4K, 30fps, and 1 channel, you can reduce half.
      CMA for ISP(2) cru_func Cannot be changed when using ISP.
      OpenCVA opencva_reserved Cannot be changed when using OpenCVA.
      DRP-AI/DRP shared_drp_reserved Cannot be changed when using OpenCVA, Codec and DRP-AI.
      DRP for Codec drp_codec drp_codec cannot be changed when using Codec.
      udmabuf image_buf0 image_buf0 is for backwards compatibility, you can remove it.
      DRP-AI drp_reserved A quantity that can be loaded into the AI ​​model is required.

      Example:
      • Move the DRP-AI (drp_reserved) memory region from 0x240000000 to 0xD0000000 and reduce the size from 512MB to 256MB on RZ/V2H.
      • drp_reserved: DRP-AI@D0000000 {
          reusable;
          reg = <0x0 0xD0000000 0x0 0x10000000>;
        };
        
      • The patch file and bbappend file to make the above changes are below.
        Obtain the patch file and bbappend file from the link below, Copy them to the specified folder listed in the Path column.
        These files are for RZ/V2H AI SDK v5.20 only. Patch files need to be modified to suit your environment.
      • File Path Description
        d005-device-tree-for-RZV2H-AI_SDK-v5.20.patch ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/linux-renesas/ Patch file for modifying device tree
        d005-linux-renesas_5.10.bbappend ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/ bbappend file for modifying device tree
      • Copy the patch file and bb file.
      • cd ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/linux-renesas/
        sudo cp <Path to the file>/d005-device-tree-for-RZV2H-AI_SDK-v5.20.patch ./
        
        cd ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/
        sudo mv linux-renesas_5.10.bbappend linux-renesas_5.10.bbappend_backup
        sudo cp <Path to the file>/d005-linux-renesas_5.10.bbappend ./linux-renesas_5.10.bbappend
        Note For how to modify the Yocto recipe, please refer the link below:
        https://docs.yoctoproject.org/

    3. Build the Linux kernel files.
      After you create a patch to modify the device tree, run the following command to build the Linux kernel files.

      • For RZ/V2H
        cd ${YOCTO_WORK}/build
        MACHINE=rzv2h-evk-ver1 bitbake core-image-weston -c cleanall
        MACHINE=rzv2h-evk-ver1 bitbake linux-renesas -c compile -f
        MACHINE=rzv2h-evk-ver1 bitbake linux-renesas -c deploy
        MACHINE=rzv2h-evk-ver1 bitbake core-image-weston
      • For RZ/V2N
        cd ${YOCTO_WORK}/build
        MACHINE=rzv2n-evk bitbake core-image-weston -c cleanall
        MACHINE=rzv2n-evk bitbake linux-renesas -c compile -f
        MACHINE=rzv2n-evk bitbake linux-renesas -c deploy
        MACHINE=rzv2n-evk bitbake core-image-weston

    This is the end of How to modify the memory map.


    D6. For RZ/V2H, RZ/V2N: How to change the DDR size

    This section explains how to change the DDR size.
    If you also want to change the memory map to match the changed DDR size,
    perform D5.How to modify the memory map first, and then perform this section.
    Note Any changes to the DDR size must be made at the customer's own risk and should be thoroughly validated.
    Note This instruction assumes that you have completed the steps in How to build RZ/V AI SDK Source Code.
    The Example in this chapter assume that the bus setting patch in Step 3-5-1 is not applied.
  • How to build RZ/V2H AI SDK Source Code
  • How to build RZ/V2N AI SDK Source Code
    1. Change the DDR settings.
      For DDR settings, please refer to DDRTOP Application Note to determine the setting values and modify Trusted Firmware-A settings.
      Apply the values ​​generated by the DDR parameter generation tool included in the Application Note to the file listed in the table below.
      Device Path file Application Note
      RZ/V2H ${YOCTO_WORK}/build/tmp/work/rzv2h_evk_ver1-poky-linux/trusted-firmware-a/
      v2.7+git-r0/git/plat/renesas/rz/soc/v2h/drivers/ddr
      ddr_param_def_lpddr4.c RZ/V2H DDRTOP Application Note
      RZ/V2N ${YOCTO_WORK}/build/tmp/work/rzv2n_evk-poky-linux/trusted-firmware-a/
      2.10+git/git/plat/renesas/rz/soc/v2n/drivers/ddr
      ddr_param_def_lpddr4.c RZ/V2N DDRTOP Application Note

    2. Change the DDR size
      If you want to change the DDR size, you need to change the definitions in the following file:
      Device Path file
      RZ/V2H ${YOCTO_WORK}/build/tmp/work/rzv2h_evk_ver1-poky-linux/u-boot/1_v2021.10+gitAUTOINC+31d53b8f6f-r0/git/include/configs rzv2h-dev.h
      ${YOCTO_WORK}/build/tmp/work/rzv2h_evk_ver1-poky-linux/trusted-firmware-a/v2.7+git-r0/git/plat/renesas/rz/soc/v2h/include rz_soc_def.h
      RZ/V2N ${YOCTO_WORK}/build/tmp/work/rzv2n_evk-poky-linux/u-boot/v2021.10+git/git/include/configs rzv2n-evk.h
      ${YOCTO_WORK}/build/tmp/work/rzv2n_evk-poky-linux/trusted-firmware-a/2.10+git/git/plat/renesas/rz/soc/v2n/include rz_soc_def.h

    3. Modify the device tree file.
      If you change the DDR size, you must change the definition of the device tree.
      Device Path Device tree file
      RZ/V2H ${YOCTO_WORK}/build/tmp/work-shared/rzv2h-evk-ver1/kernel-source/arch/arm64/boot/dts/renesas r9a09g057h4-evk-ver1.dts
      ${YOCTO_WORK}/build/tmp/work/rzv2h_evk_ver1-poky-linux/u-boot/1_v2021.10+gitAUTOINC+31d53b8f6f-r0/git/arch/arm/dts rzv2h-evk-ver1.dts
      RZ/V2N ${YOCTO_WORK}/build/tmp/work-shared/rzv2n-evk/kernel-source/arch/arm64/boot/dts/renesas r9a09g056n44-evk.dts
      ${YOCTO_WORK}/build/tmp/work/rzv2n_evk-poky-linux/u-boot/v2021.10+git/git/arch/arm/dts rzv2n-evk.dts

      Example:
      • If you use 4GB x 2 pieces totaling 8GB of DDR on RZ/V2H, change it as follows.

      • rzv2h-dev.h
        #define CONFIG_SYS_SDRAM_SIZE  (0x100000000u - DRAM_RSV_SIZE) //total 4GB
        
        rz_soc_def.h
        #define RZV2H_DDR0_SIZE   ULL(0x100000000)
        #define RZV2H_DDR1_SIZE   ULL(0x100000000)
        
        r9a09g057h4-evk-ver1.dts and rzv2h-evk-ver1.dts
        memory@48000000 {
          device_type = "memory";
          /* first 128MB is reserved for secure area. */
          reg = <0x0 0x48000000 0x0 0xF8000000>;
        };
        memory@240000000 {
          device_type = "memory";
          reg = <0x2 0x40000000 0x1 0x00000000>;
        };
        

      • The patch file and bbappend file to make the above changes are below.
        Obtain the patch file and bbappend file from the link below, Copy them to the specified folder listed in the Path column.
        These files are for RZ/V2H AI SDK v5.20 only. Patch files need to be modified to suit your environment.
      • File Path Description
        d006-u-boot-for-RZV2H-AI_SDK-v5.20.patch ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/u-boot/files/ Patch file for modifying u-boot
        d006-u-boot_2021.10.bbappend ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/u-boot/ bbappend file for modifying u-boot
        d006-tfa-for-RZV2H-AI_SDK-v5.20.patch ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/trusted-firmware-a/files/ Patch file file for modifying TF-A
        d006-trusted-firmware-a.inc ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/trusted-firmware-a/ inc file for modifying TF-A
        d006-device-tree-for-RZV2H-AI_SDK-v5.20.patch ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/linux-renesas/ Patch file for modifying device tree
        d006-linux-renesas_5.10.bbappend ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/ bbappend file for modifying device tree

      • Copy the patch file and bbappend file.
      • # Copy patch file and bbappend file for u-boot
        cd ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/u-boot/
        sudo mkdir ./files
        sudo cp <Path to the file>/d006-u-boot-for-RZV2H-AI_SDK-v5.20.patch ./files/
        sudo mv u-boot_2021.10.bbappend u-boot_2021.10.bbappend_backup
        sudo cp <Path to the file>/d006-u-boot_2021.10.bbappend ./u-boot_2021.10.bbappend
        
        # Copy patch file and inc file for TF-A
        cd ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-bsp/trusted-firmware-a/
        sudo mkdir ./files
        sudo cp <Path to the file>/d006-tfa-for-RZV2H-AI_SDK-v5.20.patch ./files/
        sudo mv trusted-firmware-a.inc trusted-firmware-a.inc_backup
        sudo cp <Path to the file>/d006-trusted-firmware-a.inc ./trusted-firmware-a.inc
        
        # Copy patch file and bbappend file for device tree
        cd ${YOCTO_WORK}/meta-renesas/meta-rzv2h/recipes-kernel/linux/
        sudo cp <Path to the file>/d006-device-tree-for-RZV2H-AI_SDK-v5.20.patch ./linux-renesas/
        sudo mv linux-renesas_5.10.bbappend linux-renesas_5.10.bbappend_backup
        sudo cp <Path to the file>/d006-linux-renesas_5.10.bbappend ./linux-renesas_5.10.bbappend
        Note 1 If you want to run both the "D5.How to modify the memory map" and "D6.How to change the DDR size" examples,
        modify the linux-renesas_5.10.bbappend file as follows.
        SRC_URI_append += "\
          file://0001-rollback-cru.patch \
          file://d005-device-tree-for-RZV2H-AI_SDK-v5.20.patch \
          file://d006-device-tree-for-RZV2H-AI_SDK-v5.20.patch \
        "
        
        Note 2 For how to modify the Yocto recipe, please refer the link below:
        https://docs.yoctoproject.org/

    4. Build the trusted-firmware-a and u-boot.
      After change the number and size of DDR, run the following command to build the trusted-firmware-a and u-boot.

      • For RZ/V2H
        cd ${YOCTO_WORK}/build
        MACHINE=rzv2h-evk-ver1 bitbake core-image-weston -c cleanall
        MACHINE=rzv2h-evk-ver1 bitbake trusted-firmware-a -c compile -f
        MACHINE=rzv2h-evk-ver1 bitbake u-boot -c compile -f
        MACHINE=rzv2h-evk-ver1 bitbake linux-renesas -c compile -f
        MACHINE=rzv2h-evk-ver1 bitbake linux-renesas -c deploy
        MACHINE=rzv2h-evk-ver1 bitbake core-image-weston
      • For RZ/V2N
        cd ${YOCTO_WORK}/build
        MACHINE=rzv2n-evk bitbake core-image-weston -c cleanall
        MACHINE=rzv2n-evk bitbake trusted-firmware-a -c compile -f
        MACHINE=rzv2n-evk bitbake u-boot -c compile -f
        MACHINE=rzv2n-evk bitbake linux-renesas -c compile -f
        MACHINE=rzv2n-evk bitbake linux-renesas -c deploy
        MACHINE=rzv2n-evk bitbake core-image-weston

    This is the end of How to change the DDR size.