After completing this how-to you will be ready to begin your own design project.
An Introduction to the Development Process with the Synergy Platform
Once you have all the software running on your system you will probably be ready to begin development. This how to guide will help you get up to speed on developing with the Synergy Platform and will make it easy to create your first project and to begin writing code for your application. The Synergy Software Package (SSP) dramatically simplifies the process of creating an application, so it may be a bit different from previous MCU development environments you are familiar with. We recommend that you take the time to learn the basics of the SSP before diving in and writing code. If you use this how to guide carefully and completely you will be writing code and creating useful applications in record time.
A summary list of what this How to Guide covers is given below. We highly recommend you do these tasks in the order listed.
1: Test out your tools with Blinky: test out your installation and target kit by importing and running a simple LED blinking (Blinky) project. This task won't cover any details of how to create a new project or write code- we want to make sure the tool flow is working first. Link
2: Before you begin your own design: See the power of the Synergy Software Package (SSP) in action. Take an example design that works with one communication interface (a UART) and quickly change it to another interface (USB) simply by changing the configuration. No rewriting of code required! Link
3: Get a Head Start on Your Development Project: You can also check out some pre-built application projects that can get you started with your own design. Exploring these working projects should be the first step in developing your own project. And don't overlook the wealth of information available in the SSP User's Manual! Link
1: Test out your tools with Blinky
1.1 Introduction, goals and prerequisites
The goal of this task is to use a simple LED blinking project, Blinky, to test out your tool installation and target kit. (The descriptions and background for the following steps are minimal by design. We want to quickly get through this task and end up with a working system, so you can move on to other tasks, where more details of developing with the SSP can be explained.
Blinky is the “Hello World” of micro-controllers. If the LED blinks you know that:
- The toolchain is setup correctly and builds a working executable image for your chip.
- The debugger has installed with working drivers and is properly connected to the board.
- The board is powered up and its jumper and switch settings are probably correct.
- The microcontroller is alive, the clocks are running, and the memory is initialized.
The Blinky example application used in this task is designed to run the same way on all boards offered by Renesas that hold the Synergy microcontroller. The code in Blinky is completely board independent. It does the work by calling into the BSP (board support package) for the particular board it is running on. This works because:
- Every board has at least one LED connected to a GPIO pin.
- That one LED is always labeled LED1 on the silk screen.
- Every BSP supports an API call that returns a list of LEDs on a board, and their port and pin assignments.
To complete this task you need:
- Windows based PC
- An ISDE (e2 studio or IAR EW for Renesas Synergy- installed in a previous Getting Started Guide step)
- Synergy Software Package (installed in a previous Getting Started Guide step)
- A Synergy board/kit (purchased as described in a previous Getting Started Guide step)
1.2 Create a new project and generate code
The creation and configuration of a Synergy project is the first step in the creation of an application. The base SSP pack includes a pre-written Blinky example application that is simple and works on all Renesas Synergy boards.
Follow these steps to create a Synergy project:
- In the e2 studio or IAR for Renesas Synergy ISDE, click File > New > Synergy C/C++ Project
- Select Renesas Synergy C Executable Project and then Next.
- Assign a name to this new project. Blinky is a good name to use for this task.
- Identify the license file if the license window is empty. The license file for this version of the platform can be found in your <ISDE base directory> starting here: ISDE\internal\projectgen\arm\Licenses\SSP_License_Example_EvalLicense_<rev>.xml.
- The Project Configuration window, as seen in Figure 1 below, shows your selection. Click Next.
Figure 1: Project Configuration Window- part 1
5. Select the SSP version and the name of your board from the Device Selection drop-down lists and click Next.
Figure 2: Project Configuration Window- part 2 (For SSP 1.4.0 and the SK-S7G2 Kit)
6. Select either the Blinky or the Blinky with ThreadX project template and click Finish.
Figure 3: Project Configuration Window- part 3 (For Blinky with ThreadX selected)
7. Once the project has been created, the name of the project will show up in the Project Explorer window of the ISDE. Now press the Generate Project Content button in the top right corner of the Synergy Project Editor window to generate your board specific files.
Figure 4: Generate Project Content
Your new project is now created, configured, and ready to build.
Blinky example code (Optional details)
The Blinky application code is stored in the hal_entry.c file (if you selected the Blinky project template) or the blinky_thread_entry.c file (if you selected the Blinky with ThreadX project template). These files are generated by the ISDE and are located in the project's src/ folder, available for view in the upper left Project Explorer window. (No need to open these folders and view the source files now. You will have a chance to view source later in this article).
The application performs the following steps:
1) Get the LED information for the selected board by calling the BSP HAL function R_BSP_LedsGet.
2) Define the output level HIGH for the GPIO pins controlling the LEDs for the selected board.
3) Get the selected system clock speed and scale down the clock, so the LED toggling can be observed.
4) Toggle the LED by writing to the GPIO pin with g_ioport.p_api->pinWrite()
1.3 Build the Blinky project
Select your new project in the Project Explorer window and click on the hammer Icon in the upper left of the window to build the project.
Figure 5: Build the Project
Once the build is complete a message is displayed in the build Console window that displays the final image file name
and section sizes in that image.
Figure 6: Typical Blinky Build Report
You project has been built and is available to download to the MCU on your target kit and to debug.
1.4 Download and Debug the Blinky project
To download and debug the project on a board, you need:
- The board to be connected to the ISDE
- The debugger to be configured to communicate with the board
- The application to be programmed into the microcontroller
Applications run from the internal flash memory of your microcontroller. To run or debug the application, the application must first be programmed to the microcontroller’s flash memory. There are two ways to do this:
- JTAG debugger
- Built-in boot-loader via UART or USB
Some boards have an on-board JTAG debugger and others require an external JTAG debugger connected to a header on the board. Refer to your board’s user manual to learn how to connect the JTAG debugger to your ISDE.
Run the debugger by clicking on the bug icon, by selecting Run > Debug or by pressing F11.
Figure 7: Running in Debug Mode
About the debug process (optional details)
In debug mode, the ISDE executes the following tasks:
1. Downloading the application image to the microcontroller and programming the image to the internal flash
2. Setting a breakpoint at main().
3. Setting the stack pointer register to the stack.
4. Loading the program counter register with the address of the reset vector.
5. Displaying the startup code where the program counter points to.
1.5 Run Blinky in Debug Mode
Once in Debug mode, click Run > Resume or click on the Play icon twice.
The LED on the board marked LED1 should now be blinking. You have proven out your tool installation, tool flow and your target kit. You are now ready to try a more advanced project- one that shows some of the powerful capabilities of the SSP.
2. Before You Begin Your Own Design
The Renesas Synergy Platform provides some unique capabilities that might not, at this point, be obvious to you. Read over this short article to see the Power of the Synergy Platform.
3. Get a Head Start on Your Development Project
We also recommend that you go to the Renesas Synergy web site and use application projects to learn more about the Synergy Platform and to jump start your own development project. Each application project has a comprehensive module guide that details the modules capabilities, features, architecture and how to add, configure and use in a typical design. The module guide includes a detailed walk through of the application project code and important operational notes and limitations of the module. Module guides provide all the information needed to begin design with the target module. You can find all module guides and application notes here: https://www.renesas.com/en-us/products/synergy/gallery/showcase-category.html?applicationType=appproject&heading=Application%20Projects
The SSP User's manual is also a valuable source of information that can improve your development efficiency. The first few chapters provide an important baseline of understanding on the Integrated System Development Environment (ISDE) you use as the 'cockpit' for and Synergy project. This information is presented in a step-by-step hands-on approach that makes it easy to learn how to get up and running with the Synergy development environment. A few minutes spent on these important topics will dramatically improve your development efficiency. The module overview chapter of the SSP User Manual gives you a thorough understanding of each SSP module and is an invaluable resource to determine which modules are right for your application requirements. If a module guide isn't yet available, module overviews are the best next step for getting your development started. The SSP User's Manual is available from the SSP web page: https://www.renesas.com/en-us/products/synergy/software/ssp.html