Synergy Software Package User's Manual
e2 studio ISDE User Guide

Using the e2 studio ISDE

This section describes how to use the Renesas e2 studio Integrated Solutions Development Environment (ISDE) to develop applications with the Renesas Synergy Software Package (SSP). The architecture of the SSP directly determines how you use the e2 studio ISDE to develop a Synergy application. See the following documents for details on the SSP architecture included in this manual:

For simple example projects generated and built with e2 studio, see:

All User Guides in this manual show how to configure a driver and develop an application using the e2 studio ISDE. See:

What is the e2 studio ISDE?

The Renesas e2 studio ISDE, or Integrated Solution Development Environment, is a development tool encompassing code development, build, and debug. The ISDE is based on the open-source Eclipse IDE and the associated C/C++ Development Tooling (CDT). Specifically for Synergy MCUs, the ISDE provides a Graphical User Interface (GUI) with numerous wizards for configuring and auto-generating code using the Synergy Software Package (SSP). The ISDE also incorporates a smart manual so that driver and device documentation is available in the form of tooltips right in the code.

figure-isde-usage-notes-e2studiostartup.png
e2 studio Splash Screen
Note
The e2 studio screens shown in this manual are examples. Some details may differ between different releases of the e2 studio ISDE and the SSP.

The e2 studio ISDE and the Synergy Project Configurator have been developed to make it as easy as possible to quickly select the SSP modules required for a particular application, include them in a project, and configure them. The ISDE provides a graphical user interface to configure all elements of the SSP for the Synergy MCU applications. In addition to HAL and Framework modules, the ISDE can add and configure RTOS threads, semaphores, mutexes, event flags, and queues. This makes adding RTOS support to an application very straightforward. Once a project has been generated, you can go back and reconfigure any of the modules and settings if required. The ISDE generates the complete and correct configuration code from the selections in the configuration views, so you can focus on writing the application code.

The elements of the SSP are shown in the Project Explorer view of the e2 studio ISDE. All SSP configuration structures and parameters are mapped to XML files. The XML files enable the ISDE to present a visual list of configurable options that you can select from. In addition to generating code to configure the modules, the XML also provides dependency information for modules.

When you add an SSP module to your project, the e2 studio ISDE checks the dependencies of this module and adds all necessary drivers and framework modules to create the appropriate stack. If there is a dependency that requires you to make a choice, this module is highlighted in the Stack window and the ISDE guides your selection by showing the available options.

figure-isde-usage-notes-dependencyChecking.png
ISDE Dependency Checking

Errors are flagged next to the Driver name in the HAL/Common Modules or New Thread Modules pane. You can also review errors in the Problems window.

e2 studio ISDE Prerequisites

Obtaining a Synergy Kit

To develop applications with the SSP, start with one of the Renesas Synergy Kits. The Renesas Synergy Kits are designed to seamlessly integrate with the e2 studio ISDE. Several types of kits are available:

  • Development Kit (DK)
  • Starter Kit (SK)
  • Product Example (PE)
  • Target Board (TB)

Ordering information, Quick Start Guides, User Manuals, and other related documents for all Synergy Kits are available at http://renesassynergy.com.

PC Requirements

To use the e2 studio ISDE, ensure that your PC meets the following minimum requirements:

  • Windows 7 with Intel i5 or i7, or AMD A10-7850K or FX
  • Memory: 8 GB DDR3 or DDR4 DRAM (16 GB DDR4/2400 MHz RAM is preferred)
  • Minimum 250 GB hard disk

Installing e2 studio and the SSP

Detailed installation instructions and installers for the e2 studio ISDE and the SSP are available on the Renesas Synergy Gallery website https://synergygallery.renesas.com. Review the release notes for e2 studio to ensure that the e2 studio version supports the selected SSP version.

Choosing a Toolchain

The e2 studio ISDE can work with several toolchains and toolchain versions such as the GNU ARM compiler and the IAR toolchain. A version of the GNU ARM compiler is included in the e2 studio installer and has been verified to run with the SSP version.

To use the IAR toolchain for ARM, install IAR Embedded Workbench for Renesas Synergy (EWSYN) (a license from IAR is required). Before starting a Synergy project with IAR, also install the IAR Embedded Workbench for ARM Eclipse plugin (using the IAR Embedded Workbench plugin manager in the 'Help' menu).

Adding the IAR Embedded Workbench for Renesas Synergy Compiler into e2 studio

The IAR Embedded Workbench for Renesas Synergy compiler (IAR compiler) can now be used from within 2 studio. This allows the developer to have the advantages provided by the IAR compiler without the need to also use the IAR EW for Renesas Synergy ISDE. The installation process involves installing IAR EW for Renesas Synergy, installing e2 studio, and installing the associated IAR plugins for e2 studio. The process is described in the application note found with this search: https://www.renesas.com/eu/en/document/apn/installing-iar-compiler-e2-studio-application-note

The application note also includes a description of how to migrate a project that originally used e2 studio and GCC. It also includes a description of how to migrate a project from IAR 7.x to IAR 8.x so it will be successfully opened when using e2 studio.

What is a Project?

In e2 studio, all SSP applications are organized in Synergy projects. Setting up a Synergy project involves:

  1. Creating the project
  2. Configuring the project

The e2 studio ISDE has many project wizards and configuration windows specifically for Synergy projects. You can create a new Synergy Project with the Synergy Project Generator or edit the configuration of an existing project in the Synergy Project Editor.

When you launch e2 studio and select a workspace, all projects previously saved in the selected workspace are loaded and displayed in the Project Explorer view. Each project has an associated configuration file named configuration.xml which is located in the project’s root directory.

figure-isde-usage-notes-e2studioprojectconfigfile.png
e2 studio Project Configuration File

Double-click on the configuration.xml file to open the Synergy Project Editor and view or modify all configuration settings associated with this project. To edit the project configuration, make sure that the Synergy Configuration perspective is selected in the upper right hand corner of the e2 studio window.

figure-isde-configperspective.png
e2 studio Synergy Configuration Perspective
Note
Whenever the Synergy project configuration (that is, the configuration.xml file) is saved, a verbose Synergy Project Report file (synergy_cfg.txt) with all the project settings is generated. The format is such that differences can be easily viewed using a textual difference tool. The generated file is located in the project root directory.
figure-isde-usage-notes-project-report.png
Synergy Project Report

The Synergy Project Editor has a number of tabs. The configuration steps and options for individual tabs are discussed in the following sections.

Note
Which tabs are available with the Synergy Project Editor depends on the e2 studio version.
figure-isde-usage-notes-e2studioprojectwindow.png
e2 studio Project Editor

Creating a Project

This section includes step-by-step instructions for creating a Synergy Project. Once you have created the project, you can easily configure the hardware (clocks, pins, interrupts) and the parameters of all modules that are part of your application.

To create a new Synergy Project with the Synergy Project Generator, select the project name, select the hardware for your application, select the toolchain and choose from preconfigured clock, pin, and MCU related settings by selecting a project template.

Creating a New Project

For Synergy applications, always generate a new project as a Synergy Project in the following way:

  1. Click on File > New > Synergy C/C++ Project
    figure-isde-usage-notes-projectConfiguratorNewProject.png
    New Synergy Project
    Then click on the type of template for the type of project you are creating.
    figure-isde-usage-notes-projectTemplates.png
    New Project Templates
  2. Select a project name and location.
    figure-isde-usage-notes-projectConfiguratorNewProjectConfigure.png
    Synergy Project Generator (Screen 1)
  3. Click Next.

Selecting a Board and Toolchain

In the next Project Configuration window select the hardware and software environment:

  1. Select the SSP version.
  2. Select the Board for your application. You can select an existing Synergy Kit or select Custom User Board for any of the Synergy devices with your own BSP definition.

    Note
    To develop your own BSP, see the following Application Note: "Creating a Custom Board Support Package" at http://renesassynergy.com.
  3. Select the Toolchain version.
  4. Select the Debugger. The J-Link ARM Debugger is preselected.
  5. Click Next.
figure-isde-usage-notes-NewProjectConfigureBoard.png
Synergy Project Generator (Screen 2)

Selecting a Project Template

In the next window, select a project template from the list of available templates and click Finish.

Note
If you want to develop your own application, select a basic template for your board, such as S7G2-DK BSP. You can add RTOS support at any time while you configure the modules for your project.
figure-isde-usage-notes-NewProjectConfigureTemplate.png
Synergy Project Generator (Screen 3)

By default, this screen shows the templates that are included in your current SSP pack.

When the project is created, the ISDE displays a summary of the current project configuration in the Synergy Project Editor.

figure-isde-usage-notes-projectConfigurator.png
Synergy Project Editor and Available Editor Tabs

On the bottom of the Synergy Project Editor view, you can find the tabs for configuring multiple aspects of your project:

  • With the BSP tab, you can change board specific parameters from the initial project selection.
  • With the Clocks tab, you can configure the MCU clock settings for your project.
  • With the Pins tab, you can configure the electrical characteristics and functions of each port pin.
  • With the Threads tab, you can add SSP modules and drivers for RTOS and non-RTOS applications and configure the drivers. For each module or driver selected in this tab, the Properties window provides access to the configuration parameters, interrupt priorities, and pin selections.
  • With the Messaging tab, you can configure the Messaging Framework for ThreadX-based projects. The Messaging tab is included in e2 studio version 5.0 and higher.
  • The Components tab provides an overview of the selected modules. You can also add drivers for specific SSP releases and application sample code here.

Configuring a Project

A project has two levels of configuration.

  • The BSP, Clocks, and Pins tabs determine the initial configuration of the MCU after reset and before any user code is executed. By selecting a project template during project creation, the ISDE configures default values as appropriate for the selected board. You can change those default values as needed.
  • The Threads allows you to add SSP modules to the project and set the configuration parameters of the module as needed by the application. Because the Messaging Framework is an integral part of many ThreadX-based applications, you can configure the Messaging Framework for each thread requiring messaging in the Messaging tab (for e2 studio versions 5.0 and higher).

Configuring the BSP with the ISDE

The BSP tab shows the currently selected board (if any) and device. The Properties view is located in the lower left of the Project Configurations view as shown below.

Note
If the Properties view is not visible, click Window > Show View > Properties in the top menu bar.
figure-isde-usage-notes-BSPConfiguration.png
ISDE BSP Tab

The Properties view shows the configurable options available for the BSP. These can be changed as required. The BSP is the SSP layer above the MCU hardware. The ISDE checks the entry fields to flag invalid entries. For example, only valid numeric values can be entered for the stack size.

When you press the Generate Project Content button, the BSP configuration contents are written to

synergy_cfg/ssp_cfg/bsp/bsp_cfg.h

This file is created if it does not already exist.

Warning
Do not edit this file as it is overwritten whenever the Generate Project Content button is pressed.

Configuring Clocks

The Clocks tab presents a graphical view of the MCU’s clock tree, allowing the various clock dividers and sources to be modified. If a clock setting is invalid, the offending clock value is highlighted in red. It is still possible to generate code with this setting, but correct operation cannot be guaranteed. In the figure below, the USB clock UCLK divider has been changed so the resulting clock frequency is 60 MHz instead of the required 48 MHz. This parameter is colored red.

figure-isde-usage-notes-ClockConfiguration.png
ISDE Clocks Tab

When you press the Generate Project Content button, the clock configuration contents are written to:

synergy_cfg/ssp_cfg/bsp/bsp_clock_cfg.h

This file will be created if it does not already exist.

Warning
Do not edit this file as it is overwritten whenever the Generate Project Content button is pressed.

Configuring Pins

The Pins tab provides flexible configuration of the MCU’s pins. As many pins are able to provide multiple functions, they can be configured on a peripheral basis. For example, selecting a serial channel via the SCI peripheral offers multiple options for the location of the receive and transmit pins for that module and channel. Once a pin is configured, it is shown as green in the Package view.

Note
If the Package view window is not open in the ISDE, select Window > Show View > Pin Configurator > Package from the top menu bar to open it.

The Pins tab simplifies the configuration of large packages with highly multiplexed pins by highlighting errors and presenting the options for each pin or for each peripheral. If you selected a project template for a specific board such as the DK-S7G2, some peripherals connected on the board are preselected.

figure-isde-usage-notes-pinConfigurator.png
ISDE Pins Tab

The pin configurator includes a built-in conflict checker, so if the same pin is allocated to another peripheral or I/O function the pin will be shown as red in the package view and also with white cross in a red square in the Pin Selection pane and Pin Configuration pane in the main Pins tab. The Pin Conflicts view provides a list of conflicts, so conflicts can be quickly identified and fixed.

In the example shown below, port P105 is already used by the External Memory peripheral, and the attempt to connect this port to the Serial Communications Interface (SCI) results in a dangling connection error. To fix this error, select another port from the pin drop-down list or disable the External Memory peripheral in the Pin Selection pane on the left side of the tab.

figure-isde-usage-notes-pinConfiguratorError.png
ISDE Pin Configurator

The pin configurator also shows a package view and the selected electrical or functional characteristics of each pin.

figure-isde-usage-notes-pinConfiguratorPinChar.png
ISDE Pin Configurator

When you press the Generate Project Content button, the pin configuration contents are written to:

synergy_cfg/ssp_cfg/bsp/bsp_pin_cfg.h

This file will be created if it does not already exist.

Warning
Do not edit this file as it is overwritten whenever the Generate Project Content button is pressed.

To make it easy to share pinning information for your project, the ISDE exports your pin configuration settings to a csv format and copies the csv file to synergy_cfg/ssp_cfg/bsp/pincfg_< MCU package>.csv.

Adding Threads and Drivers

Every ThreadX-based Synergy Project includes at least one RTOS Thread and a stack of SSP modules running in that thread. The Threads tab is a graphical user interface which helps you to add the right modules to a thread and configure the properties of both the threads and the modules associated with each thread. Once you have configured the thread, the ISDE automatically generates the code reflecting your configuration choices.

For any driver or, more generally, any module that you add to a thread, the ISDE automatically resolves all dependencies with other modules and creates the appropriate stack. This stack is displayed in the Threads pane, which the ISDE populates with the selected modules and module options for the selected thread. If there is more than one module that can fulfill a dependency requirement, the ISDE prompts you to choose a module from a dropdown menu.

For example, when you add the Audio Playback Framework to a thread, you also must pick either the DAC or the I2S framework for playback:

figure-isde-usage-notes-ThreadConfiguratorOverview.png
ISDE Project Configurator - Overview

The default view of the Threads tab includes a Common Thread called HAL/Common. This thread includes the drivers for I/O control (IOPORT), clock generation circuit (CGC), and the event link controller (ELC). The default stack is shown in the HAL/Common Stacks pane. The default modules added to the HAL/Common thread are special in that the SSP only requires a single instance of each, which the ISDE then includes in every user-defined thread by default.

In applications that do not use an RTOS or run outside of the RTOS, the HAL/Common thread becomes the default location where you can add additional drivers to your application.

For a detailed description on how to add and configure modules and threads, see the following sections:

Once you have added a module either to HAL/Common or to a new thread, you can access the driver’s configuration options in the Properties view. If you added thread objects, you can access the objects configuration options in the Properties view in the same way.

You can find details about how to configure threads here: Configuring Threads

Note
Driver and module selections and configuration options are defined in the SSP pack and can therefore change when the SSP version changes.

Adding and Configuring HAL Drivers

For applications that run outside or without the RTOS, you can add additional HAL drivers to your application using the HAL/Common thread. To add drivers, follow these steps:

  1. Click on the HAL/Common icon in the Threads pane. The Modules pane changes to HAL/Common Stacks.

    figure-isde-usage-notes-ThreadConfiguratorHAL.png
    ISDE Project Configurator - Adding Drivers
  2. Click New Stack to see a drop-down list of HAL level drivers available in the SSP.
  3. Select a driver from the menu New Stack > Driver. In addition, you can select a subset of Framework modules for RTOS independent applications. All other modules can only be added to a thread when ThreadX is present.
    figure-isde-usage-notes-ThreadConfiguratorHALselect.png
    Select a Driver
    The ISDE creates the stack for the selected driver and alerts you when the driver needs additional resources that must be enabled. In the case below, you can configure the interrupt in the Properties view.
    figure-isde-usage-notes-ThreadConfiguratorHALerror.png
    Dependency Checking on the Threads Tab
  4. Select the driver module in the HAL/Common Modules pane and configure the driver properties in the Properties view.

The ISDE adds the following files when you click the Generate Project Content button:

  • The selected driver module and its files to the synergy/ssp directory.
  • The main() function and configuration structures and header files for your application as shown in the table below.
File Contents Overwritten by Generate Project Content?
src/synergy_gen/main.c Contains main() calling generated and user code. When called, the BSP already has initialized the MCU. Yes
src/synergy_gen/hal_data.c Configuration structures for HAL Driver only modules. Yes
src/synergy_gen/hal_data.h Header file for HAL driver only modules. Yes
src/hal_entry.c User entry point for HAL Driver only code. Add your code here. No

The configuration header files for all included modules are created or overwritten in this folder:

synergy_cfg/ssp_cfg/driver

Adding Drivers to a Thread and Configuring the Drivers

For an application that uses the ThreadX RTOS, you can add one or more threads, and for each thread at least one module that runs in the thread. You can select modules from either the Driver or Framework dropdown menu. To add modules to a thread, follow these steps:

  1. In the Threads pane, click New Thread to add a Thread.
    figure-isde-usage-notes-ThreadConfiguratorThreadEntry.png
    Adding a new RTOS Thread on the Threads Tab
  2. In the Properties view, click on the Name and Symbol entries and enter a distinctive name and symbol for the new thread.

    Note
    The ISDE updates the name of the thread stacks pane to My Thread Stacks.
  3. In the My Thread Stacks pane, click on New to see a list of modules and drivers. Both Framework-level Modules and HAL-level drivers can be added here.
    figure-isde-usage-notes-ThreadConfiguratorThreadSelect.png
    Adding Modules and Drivers to a Thread
  4. Select a module or driver from the list.
  5. If the module or driver indicates a dependency, select the missing resources.
    figure-isde-usage-notes-ThreadConfiguratorThreadSelectError.png
    Identifying Module or Driver Dependencies on the Threads Tab
  6. Click on the added driver and configure the driver as required by the application by updating the configuration parameters in the Properties view. To see the selected module or driver and be able to edit its properties, make sure the Thread containing the driver is highlighted in the Threads pane.
    figure-isde-usage-notes-ThreadConfiguratorThreadSelectProperties.png
    Configuring Module or Driver Properties
  7. If needed, add another thread by clicking New in the Threads pane.

When you press the Generate Project Content button for the example above, the ISDE creates the files as shown in the following table:

File Contents Overwritten by Generate Project Content?
src/synergy_gen/main.c Contains main() calling generated and user code. When called the BSP will have initialized the MCU. Yes
src/synergy_gen/my_thread.c Generated thread “my_thread” and configuration structures for modules added to this thread. Yes
src/synergy_gen/my_thread.h Header file for thread “my_thread” Yes
src/synergy_gen/hal_data.c Configuration structures for HAL Driver only modules. Yes
src/synergy_gen/hal_data.h Header file for HAL Driver only modules. Yes
src/hal_entry.c User entry point for HAL Driver only code. Add your code here. No
src/my_thread_entry.c User entry point for thread “my_thread”. Add your code here. No

The configuration header files for all included modules and drivers are created or overwritten in the following folders:

synergy_cfg/ssp_cfg/driver

synergy_cfg/ssp_cfg/framework

Configuring Threads

If the application uses the ThreadX RTOS, the Threads tab can be used to simplify the creation of ThreadX threads, semaphores, mutexes, and event flags.

The components of each thread can be configured from the Properties view as shown below.

figure-isde-usage-notes-ThreadProperties.png
ISDE Thread Properties

The Properties view contains settings common for all Threads (Common) and settings for this particular thread (Thread).

For this thread instance, the thread’s name and properties (such as priority level or stack size) can be easily configured. The ISDE checks that the entries in the property field are valid. For example, the ISDE ensures that the field Priority, which requires an integer value, only contains numeric values between 0 and 9.

To add ThreadX resources to a Thread, select a thread and click on New Object in the Thread Objects pane. The pane takes on the name of the selected thread, in this case My Thread Objects.

figure-isde-usage-notes-ThreadObjectsSelect.png
Configuring Thread Object Properties

Make sure to give each thread object a unique name and symbol by updating the Name and Symbol entries in the Properties view.

Configuring Interrupts

You can use the Properties view in the Threads tab to enable interrupts by setting the interrupt priority. Select the thread in the Threads pane to view and edit its properties.

figure-isde-usage-notes-selectInterruptwithThreads.png
Configuring Interrupt on the Threads Tab

Configuring the SSP Messaging Framework

The Messaging Framework extends the ThreadX messaging queue functionality and is one of the most important SSP modules. It provides the mechanism for threads to communicate with each other through exchanging messages. The Messaging Framework allows threads to send (publish) or listen to (pend on) messages when preconfigured or user-configured Events happen. Any thread can publish a message with an attached Event Class that all threads subscribing to this Event class can listen to and act upon. The list of Threads that can listen to a specific Event Class is called the Subscriber List for that Event Class.

To use the Messaging Framework, you first must add one Messaging Framework instance in the Threads tab. You may add the Messaging Framework to any thread which is not the HAL/Common thread. All threads in your project can use this instance to communicate with each other. Some modules like the Audio Playback Framework require the Messaging Framework and add it automatically to the stack as shown below for the Audio Playback Framework. If your project includes a thread with such a module, you do not need to add another instance of the Messaging Framework even if you add more threads to your application. All threads can share one instance of the Messaging framework.

figure-isde-usage-notes-messagingAddModule.png
Adding the Messaging Module to a Thread

Once you have added a Messaging Framework instance in the Threads tab, you can use the Messaging tab to define your own event classes and events and determine which threads can listen to which event class. The SSP contains a predefined event class and events for the Audio Playback Framework module. If you have added the Audio Playback Framework module, the predefined event class and events appear in the Messaging tab as well, as shown below.

figure-isde-usage-notes-messagingAudioEventClass.png
Audio Playback Framework Predefined Event Class

Adding an Event Class

To add your own user-defined Event Class to the messaging system, follow these steps:

  1. In the Messaging tab, select the Event Classes Pane, and click the add button.
  2. Enter a unique name for your event class.
  3. Click OK.

    Note
    User-defined Event Classes are marked with a golden square on the upper right of the Event Class icon.
    figure-isde-usage-notes-messagingADDEventClass.png
    Messaging – Add an Event Class

Adding an Event

To add your own user-defined Event to the messaging system, follow these steps:

  1. In the Messaging tab, select the Event Pane, and click the add button.
  2. Enter a unique name for your event class.
  3. Click OK.

    Note
    User-defined Events are marked with a golden square on the upper right of the Events icon.
    figure-isde-usage-notes-messagingADDEvent.png
    Messaging – Add an Event

Configuring the Messaging Subscriber List

In the Subscriber List, you select the threads that are listening to messages from the message publisher. The connection between the publishing thread and the listening thread is established through the Event Class. Therefore you define a subscriber list for each of the Event Classes in your project. All threads in the Subscriber List then can listen and act upon messages belonging to the selected Event Class.

To following assumes that you have two threads defined in the Threads tab, one of which uses the Audio Playback Framework:

figure-isde-usage-notes-messagingExampleThreads.png
Messaging – Example Threads

To configure the Subscriber List for an Event Class, follow these steps:

  1. In the Messaging tab, select the Event Classes in the Event Classes Pane.

    The Subscriber List pane takes its name from the selected Event Class.

  2. Click the Add Icon.

    The New Subscriber Dialog box opens.

  3. Select the Thread to add to the Subscriber List from the Thread dropdown menu.
  4. Fill out the instance range by selecting Start and End.

    If you only have one instance of an Event Class, keep the Start and End values at their default value (0). See the Messaging Framework User Guide for selecting an instance range if you have more than one Event Class instance. Multiple Event Class instances can be useful in an application that uses the same Event Class multiple times for example for audio streaming on multiple channels.

  5. Repeat steps 3 and 4 for each thread that you want to add to the Subscriber List for the selected Event Class.
figure-isde-usage-notes-messagingConfiguringSubscriberList.png
Messaging – Configuring the Subscriber List

Generating Files for the Messaging Framework

The ISDE generates the following files for the configured Messaging Framework when you click the Generate Project button:

File Contents Overwritten by Generate Project Content?
synergy_cfg/ssp_cfg/framework/sf_message_port.h Contains the event class and event enumerations Yes
synergy_cfg/ssp_cfg/framework/sf_message_payloads.h Contains pointers to the event class payloads. Yes
synergy_cfg/ssp_cfg/framework/sf_message_payloads.h Compiler options for the Messaging Framework Yes

Reviewing and Adding Components

The Components tab enables the individual modules required by the application to be included or excluded. Modules common to all Synergy projects are preselected (for example: BSP > BSP > Board-specific BSP and HAL Drivers > all > r_cgc). All modules that are necessary for the modules selected in the Threads tab are included automatically. You can include or exclude additional modules by ticking the box next to the required component.

figure-isde-usage-notes-ComponentsTab.png
Components Tab

Components at the HAL and Framework layers are available as are components from Azure RTOS such as the RTOS ThreadX, file system FileX, TCP/IP networking NetX. In addition, you can select documentation to be added to a project or include complete projects.

While the components tab selects modules for a project, you must configure the modules themselves in the other tabs. Pressing the Generate Project Content button copies the .c and .h files for each component for a Pack file into the following folders:

synergy/ssp/inc/bsp

synergy/ssp/inc/driver

synergy/ssp/inc/framework

synergy/ssp/src/bsp

synergy/ssp/src/driver

synergy/ssp/src/framework

The ISDE also creates configuration files in the synergy_cfg/ssp_cfg folder with configuration options included from the remaining Threads tabs.

Writing the Application

Once you have added Modules and drivers and set their configuration parameters in the Threads tab, you can add the application code that calls the Modules and drivers.

Note
To check your configuration, build the project once without errors before adding any of your own application code.

RTOS-independent Applications

To write application code:

  1. Add all drivers and modules in the Threads tab and resolve all dependencies flagged by the ISDE such as missing interrupts or drivers.
  2. Configure the drivers in the Properties view.
  3. In the Project Configuration view, press the Generate Project Content button.
  4. In the Project Explorer view, double-click on the src/hal_entry.c file to edit the source file.
    figure-isde-usage-notes-writingappsnortosOpenfile.png
    hal_entry.c
    Note
    All configuration structures necessary for the driver to be called in the application are initialized in src/synergy_gen/hal_data.c.
    Do not modify the files in the directory src/synergy_gen. These files are overwritten every time you push the Generate Project Content button.
  5. Add your application code here:
    figure-isde-usage-notes-writingappsnortosAddcode.png
    Adding User Code to hal_entry.c
  6. Build the project without errors by clicking on Project > Build Project.

The following tutorial shows how execute the steps above and add application code: Tutorial: Using HAL Drivers - Programming the WDT

The WDT example is a HAL level application which does not use an RTOS. The user guides for each module also include basic application code that you can add to hal_entry.c.

ThreadX Applications

To write RTOS-aware application code using ThreadX, follow these steps:

  1. Add a thread using the Threads tab.
  2. Provide a unique name for the thread in the Properties view for this thread.
  3. Configure all drivers and resources for this thread and resolve all dependencies flagged by the ISDE such as missing interrupts or drivers.
  4. Configure the thread objects.
  5. Provide unique names for each thread object in the Properties view for each object.
  6. Add more threads if needed and repeat steps 1 to 5.
  7. In the Synergy Project Editor, press the Generate Project Content button.
  8. In the Project Explorer view, double-click on the src/my_thread_1_entry.c file to edit the source file.
    figure-isde-usage-notes-writingappsrtosOpenfile.png
    ISDE Generated Files for an RTOS Application
    Note
    All configuration structures necessary for the driver to be called in the application are initialized in synergy_gen/my_thread_1.c and my_thread_2.c
    Do not modify the files in the directory src/synergy_gen. These files are overwritten every time you push the Generate Project Content button.
  9. Add your application code here:
    figure-isde-usage-notes-writingapprtosAddcode.png
    Adding User Code to my_thread_1.entry
  10. Repeat steps 1 to 9 for the next thread.
  11. Build your project without errors by clicking on Project > Build Project.

Debugging the Project

Once your project builds without errors, you can use the Debugger to download your application to the board and execute it.

To debug an application follow these steps:

  1. click Run > Debug Configurations.
    figure-isde-usage-notes-debugSelect.png
    Invoking the Debug Configurations Dialog
  2. In the Debug Configurations view, click on your project listed as MyProject Debug.
    figure-isde-usage-notes-debugProject.png
    Debug Configuration
  3. Connect the board to your PC via either a standalone Segger J-Link debugger or a Segger J-Link On-Board (included on all Synergy DKs and SKs) and click Debug.
Note
For details on using J-Link and connecting the board to the PC, see the Quick Start Guide included in the Synergy Kit.

Using TraceX with a Synergy Project

Precondition
Before you can use TraceX with your Synergy Project, you must download the TraceX executable file from the Microsoft Store.

TraceX™ is a host-based analysis tool that provides a graphical view of real-time system events. TraceX collects data on the target device and displays the data for inspection and analysis. A TraceX version for Synergy devices is available for downloading from the Microsoft Store.

To use TraceX, do the following:

  1. In e2 studio, add the ThreadX source code to your project by going to the Threads tab, clicking the New Stack button in the Stacks pane, and selecting X-Ware > ThreadX > ThreadX Source.
    figure-isde-usage-notes-addingtracex.png
    Add TraceX to your Source
  2. Enable TraceX in the Properties Window of the Thread using the Threads tab. Keep the default name for the TraceX buffer as g_tx_trace_buffer.
    figure-isde-usage-notes-tracexconfig.png
    ISDE TraceX Configuration
  3. Set the path to the TraceX application in Window > Preferences > Renesas > TraceX
    figure-isde-usage-notes-tracexpath.png
    ISDE TraceX Path
  4. Build your project (Project > Build All).
  5. Connect your Synergy target board.
  6. Start a debug session (Run > Debug)
  7. In Run > Renesas Debug Tools > TraceX, select Launch TraceX Debugging.
    figure-isde-usage-notes-tracexlaunch.png
    ISDE TraceX Launch
  8. In the TraceX Debugging window, set Buffer Start Address to &g_tx_trace_buffer.

    In the TraceX Debugging window, set Buffer Size (bytes) to the buffer size selected in the Properties Window in step 2. The default is 65536.

    figure-isde-usage-notes-tracexdebug.png
    ISDE TraceX Debug
  9. Click OK.
  10. Run your code (Run > Resume) to collect TraceX data.
  11. Suspend execution of your code (Run > Suspend).
  12. Observe the collected data in TraceX.
    figure-isde-usage-notes-tracexdata.png
    TraceX Collected Data
  13. To collect further TraceX data:
    • Resume execution of your code
    • Suspend execution of your code
    • Click Run > TraceX and select Update TraceX Data.

You can find more information on using TraceX on the Renesas TraceX webpage https://www.renesas.com/synergy/tracex.

Modifying Toolchain Settings

There are instances where it may be necessary to make changes to the toolchain being used (for example, to change optimization level of the compiler or add a library to the linker). Such modifications can be made from within the ISDE through the menu Project > Renesas C/C++ Project Settings when the project is selected. The following screenshot shows the settings dialog for the GNU ARM toolchain. This dialog will look slightly different depending upon the toolchain being used.

figure-isde-usage-notes-ProjectToolchainSettings.png
ISDE Project Toolchain Settings

The scope for the settings is project scope which means that the settings are valid only for the project being modified.

The settings for the linker which control the location of the various memory sections are contained in a script file specific for the device being used. This script file is included in the project when it is created and is found in the script folder (for example, /script/S7G2.ld).

e2 studio ISDE Usage Notes

Including ThreadX sources

You can use the Theads tab to include ThreadX source code in your project as follows:

  1. Click on the HAL/Common icon in the Threads pane. The Modules pane changes to HAL/Common Modules.
  2. Select New Stack > X-Ware > ThreadX > ThreadX Source.
  3. Check the Properties window to configure the TheadX RTOS properties.
  4. Click Generate Project.

The e2 studio ISDE extracts the ThreadX source code into the following directory: synergy/ssp/src/framework/el/tx

Note
Extracting the ThreadX sources increases the compile time for your project.

Using Synergy Developer Assistance

This section describes a new feature, “Synergy Developer Assistance” included in e2 studio.

Developer Assistance Node

A new node Developer Assistance is now available in the project explorer. When expanded, the Developer Assistance tree shows you the threads and module stacks and their respective API information of the saved Synergy configuration.

The Developer Assistance node is available regardless of whether the Synergy Configuration Editor is open. This allows a user to easily consult the Developer Assistance for a project’s stack modules while application code is being written. It assists by providing code templates and an autocompletion tool.

Configure Threads

Create a new project. In the Synergy configurator thread’s tab create a thread and add a new stack.

For example, Framework Device on sf_i2c:

isde-thread-ex.png

Project Explorer View

Once the project is saved, expand the Developer Assistance node. Notice that the node is updated with the new thread New Thread Information. Clicking on the module instance under the thread will expand all the child nodes and show the API information of the modules.

isde-proj-exp.png

Properties View

Selecting the module instance in the thread tab or in the project explorer will show the module and module API information in the API info tab of properties view.

Tip: If the Properties view is not present in the current e2 studio perspective, you can open it by selecting Window -> Show View -> Properties

isde-prop-view.png

Selecting the code template node shows the preview of the function in the Properties view

isde-preview-func.png

Drag and drop to source File

The API function code templates or callbacks can be dragged and dropped to the source file. This will autofill the parameters and return type of the function

isde-drag-drop.png

Please also refer to Help-> Help Contents -> Synergy Contents -> Synergy Developer Assistance page in e2 studio for any further information.