In following sections are information provided about how to setup Renesas RZ/N1 boards for debugging and flashing the GOAL software.

Further documents about handling the platforms are released by Renesas at the Connect IT! DVD or in the download sections of RZ/N1D, RZ/N1S, RZ/N1L.

Software requirements

Please make sure that the following components are installed on the computer.

 

Table: Development Tools required by RZ/N1

Tool

Version

IAR Embedded Workbench for ARM

9.20.2

IAR C/C++ Compiler for ARM

9.20.2

GCC

8.2.0

dfu-util/ dfu_prog (from YCONNECT-IT)

GCC v8.2.0 is available in Ubuntu 18.04, for example.

Optional software is not urgently but recommended for facilitated development.

Setup terminal interface

Please take care to follow the setup guidelines for the RZ/N1 Demo Board from the YCONNECT IT! Quick Start Guide.

Please follow these initial steps to setup the UART and DFU connection.

Hardware requirements

The following RZ/N1 hardware revisions has been used for GOAL development.

Name

Hardware-ID

Version

RZ/N1D

EESS-0401-130-04

v4.30

RZ/N1S

EESS-0401-141-02

v4.10

RZ/N1L

EESS-0401-155-01

v2.00

RZ/N1-EB

EESS-0401-131-03

v2.00

Running a sample project

The initial setup of the hardware and loading of the Cortex-M3 firmware from flash is done by U-Boot bootloader on RZ/N1D and RZ/N1S. Additionally, U-Boot starts Linux respectively ThreadX on Cortex-A7 when running the boards in multicore. The RZ/N1L is working without any bootloader.

If no bootloader was yet installed on RZ/N1D or RZ/N1S please refer to the board YCONNECT IT! Quick Start Guide.

There are many similarities between the derivatives of the RZ/N1 series but some minor differences, too. Therefore, this section describes how to flash the GOAL software to the board and how a debug session is initiated.

All standalone projects and the CC project of the Core To Core variant contain different workspaces for each board variant. The project workspaces ending on *_eb contain the configuration for the CPU board together with the extension board. The other project workspaces contain the configuration for working with the CPU board only.

Additionally, the release provides the standalone projects as library version. The applicable project directories are ending on *_lib, like goal\projects\goal_eip_rpc_lib\, containing the sample projects, next to the library in the board specific subfolder of 00_lib.

Standalone Application - RZ/N1D and RZ/N1S

Handling a standalone application on RZ/N1D or RZ/N1S is described in following sections. This includes the process of loading software into RAM for debugging and flashing it to non-volatile storage.

Loading Cortex-M3 Software into RAM – RZ/N1D and RZ/N1S

It is possible to load the code via debugger into RAM, which is a very fast approach to test the user application. To compile and load a project, follow these steps.

 

Figure: IAR Workbench IDE - Open Workspace

 

setenv bootcmd "mw 0x04000004 1 && rzn1_start_cm3 && loop 0 1"

followed by

saveenv

and reset the board.

 

Figure: Download and Debug button

Flashing Cortex-M3 Software – RZ/N1D and RZ/N1S

The board uses the U-Boot bootloader for initial setup of the hardware and loading of the Cortex-M3 firmware. This chapter describes how to install the compiled Cortex-M3 software on the flash of the board. If no bootloader was yet installed, please refer to the board specific YCONNECT IT! Quick Start Guide.

Linux:

sudo dfu-util -a “sf_cm3” -D <FIRMWARE.bin>

Windows:

 

setenv bootcmd "sf probe && sf read 0x4000000 d0000 90000 && rzn1_start_cm3 && loop 0 1"

saveenv

Standalone Application - RZ/N1L

The RZ/N1L does not use any bootloaders. If any application is stored in flash, it will be started automatically. Both, loading into RAM and flash can be done using IAR workbench.

 

Figure: IAR Configurations RAM and ROM for RZ/N1L

 

 

Figure: IAR Workbench "Busy"-Window

 

 

Figure: Changing Reset mode of RZ/N1L in Debug-ROM configuration

Core To Core variant - RZ/N1D

Handling a multicore application on RZ/N1D is described in following sections. This includes the process of loading software into RAM for debugging and flashing it to non-volatile storage.

Flashing the communication core image

The multicore project of the communication core is located in the board specific subdirectory of the protocol stack projects\**\00_goal_rpc_demo\1.

Load the Cortex-M3 binary file to the flash according to the steps 1-7 described in https://portgmbh.atlassian.net/wiki/spaces/GOALR/pages/257097731#Flashing-Cortex-M3-Software-%E2%80%93-RZ%2FN1D-and-RZ%2FN1S and continue by following points.

setenv bootcmd "sf probe && sf read 0x4000000 d0000 90000 && sf read 0x8ffe0000 b0000 20000 && sf read 0x80008000 1d0000 f00000 && rzn1_start_cm3 && sleep 4 && bootm 0x80008000 - 0x8ffe0000"

The user application runs on the Linux system of the Cortex A7. Its binary must be created by GCC and downloaded to the RZ/N board manually.

It is recommended to maintain a consistent boot order of the communication and the application core. Therefore, it is advised to always start the R-IN engine / Cortex-M3 (communication core) first and boot the Cortex-A7 (application core) after the communication core has finished its initialization.

Building and downloading the application core

The following steps describe, how to build a binary and download it to the RZ/N1D board.

export LD_LIBRARY_PATH=.

./goal_rzn1d_a7_linux.bin –i eth0

GOAL setups the connection to the communication core via core to core and starts the user application. The initialization is done when the log message “GOAL initialized” is printed at the terminal, if logging is activated.

Auto start the user application

The Linux Kernel can start the user application on the Cortex-A7 automatically with the help of the start script S99goal_app.sh located at /etc/rc5.d/ on Cortex-A7. Please ensure, that goal_rzn1d_a7_linux.bin and its library is placed at /home/root/.

Disabling the start script is possible by adding the boot argument GOAL_APPL_LINUX_PREV.

setenv bootargs "${bootargs} GOAL_APPL_LINUX_PREV"

saveenv

Reenabling the start script is possible by deleting the boot argument GOAL_APPL_LINUX_PREV

env print

setenv bootargs “<paste>”

saveenv

Core To Core variant - RZ/N1S

Handling a multicore application on RZ/N1S is described in following sections. This includes the process of loading software into RAM for debugging and flashing it to non-volatile storage.

Loading Cortex-M3 and Cortex-A7 Software into RAM

Similar to the standalone variant the core to core variant is also capable to run from the RAM while debugging the application core and the communication core at the same time. The communication core software might be provided as demo binary only. In such a case, debugging is limited to the application core. 

The IAR Embedded Workbench runs two instances of the IDE, one for each core, in a master-slave-system to share the access to the board keeping both instances synchronous.

The usage and setup of the multicore debugging will be exemplary described for the Simple IO example running on the application core under ThreadX using the Cortex-M3 for handling the network stack as the communication core.

It is recommended to maintain a consistent boot order of the communication and the application core. Therefore, it is advised to always start the R-IN engine / Cortex-M3 (communication core) first and boot the Cortex-A7 (application core) after the communication core has finished its initialization.

To run the core to core variant of the Simple IO example please perform the following steps:

The slave workspace rzn1s_demo_board.eww for the example above is located in the following project directory projects\goal_eip_rpc\opener\00_goal_rpc_demo\iar\renesas\rzn1s_demo_board\.

 

Figure: Multicore Debug Option

 

When using the RZ/N1S expansion board, please ensure to select the correct CC project located at the projects rzn1s_demo_board_eb directory. Additionally, adjust the entry “Slave project” in the subcategory “Multicore” to rzn1s_demo_board_eb.

  1. Compile the project via Project → Compile or Project → Rebuild all.

  2. Press the Download and Debug button

This will cause IAR to open the slave workspace as an additional IAR workbench instance, builds the slave project and load both – the master and the slave project – to the board sharing the debugger.

 

Figure: Multicore Debug Interface

Flashing Cortex-M3 and Cortex-A7 Software

The binary of the Cortex-M3 communication core is located in the board specific subdirectory of projects\**\00_goal_rpc_demo\1. Load it to the flash according to the steps 1-7 described in https://portgmbh.atlassian.net/wiki/spaces/GOALR/pages/257097731#Flashing-Cortex-M3-Software-%E2%80%93-RZ%2FN1D-and-RZ%2FN1S.

The user application for Cortex-A7 is handled in a similar way. Choose a CC coresponding AC sample project and build the binary file with IAR workbench according to steps 1-4 described in https://portgmbh.atlassian.net/wiki/spaces/GOALR/pages/257097731#Standalone-Application---RZ%2FN1D-and-RZ%2FN1S.

Afterwards, the binary located in the subdirectory Debug\Exe can be flashed to the DFU interface named sf_kernel, according to the steps 1-7 described in https://portgmbh.atlassian.net/wiki/spaces/GOALR/pages/257097731#Flashing-Cortex-M3-Software-%E2%80%93-RZ%2FN1D-and-RZ%2FN1S.

The AC binary must be loaded into the DFU interface named sf_kernel on RZ/N1S.

Finally, configure the boot command <bootcmd> in u-boot.

setenv bootcmd "sf probe && sf read 0x4000000 d0000 80000 && dcache off && sf read 0x80008000 1d0000 600000 && rzn1_start_cm3 && sleep 1 && go 0x80008000"

saveenv

Core To Core variant - RZ/N1L

The binary file for the Cortex-M3 is located in the board type related IAR Embedded Workbench folder projects\**\00_goal_rpc_demo\1.

Please refer to https://portgmbh.atlassian.net/wiki/spaces/GOALR/pages/257097731#Standalone-Application---RZ%2FN1L for building and downloading the Core To Core variant on RZ/N1L. It is handled the same as the standalone variant.

For mulit core projects, the RZ/N1L is used as communication core, while the e.g. Synergy S7GS-SK is used as application core. Data exchanging is done by SPI. The boards are connected as followed.

 

Figure: SPI connection of Synergy S7GS-SK (left) and RZ/N1L (right)

Table: PINs for SPI usage

function

color

S7GS-SK

RZ/N1L

GND

Black

J24-7

CN20-5

SPI Clock

Green

J24-6

CN20-4

MISO

Blue

J24-5

CN20-3

MOSI

Yellow

J24-4

CN20-2

SPI chip select

Red

J24-3

CN20-1

Please note the synergy quick start guide for setup the named core. By default, the RZ/N1L uses the SPI channel 5 and the following GPIOs

Table: GPIOs for SPI usage

GPIO

Usage

62

SPI clock

63

MOSI

64

MISO

65

SPI chip select

 

The board supports only SPI mode 1 and 3. Please set the SPI mode to 3 by defining GOAL_GLOB_MA_SPI_ID_0_MODE_3 in goal/goal_global/goal_global.h to 1.

#define GOAL_GLOB_MA_SPI_ID_0_MODE_3 1          /**< set SPI mode 3 on MA ID 0 */


1 The symbol ** is used as wildcard. It includes all projects and their subdirectories.