Migrating from CubeSuite+ to Eclipse RL78 Family

Similar documents
RL78 Project Configuration Tips

Migration from HEW to e 2 studio Development Tools > IDEs

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

RL78 Development Environment Migration Guide

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

Using Code Composer Studio IDE with MSP432

AD5669R - Microcontroller No-OS Driver

F28069 ControlCard Lab1

Laboratory Assignment #3 Eclipse CDT

6L00IA - Introduction to Synergy Software Package Short Version (SSP v1.2.0) Renesas Synergy Family - S7 Series

Debugging in AVR32 Studio

1. Opening the sample code workspace Loading the selected sample code project and Opening sample code source files... 5

BASICS OF THE RENESAS SYNERGY PLATFORM

SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

External Headers. USB Host User LEDs. User Switches. E1 Header (Unfitted)

RX Smart Configurator

Quick-Start Guide. BNS Solutions. QSK62P Plus

Study and implementation of RL78 low power mode

esi-risc Development Suite Getting Started Guide

Figure 1. Simplicity Studio

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

AURIX family and AUDO Future, AUDO MAX

F28335 ControlCard Lab1

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Optional Eclipse Workspace Configurations

Quick Start Guide TWR-S08PT60. 5-Volt S08P Family of 8-bit MCUs for Industrial and Appliance Applications TOWER SYSTEM

Codewarrior for ColdFire (Eclipse) 10.0 Setup

Ethernut 3 Source Code Debugging

QUICKSTART CODE COMPOSER STUDIO Stellaris Development and Evaluation Kits for Code Composer Studio

BASICS OF THE RENESAS SYNERGY TM

At the shell prompt, enter idlde

BASICS OF THE RENESAS SYNERGY PLATFORM

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface.

BASICS OF THE RENESAS SYNERGY TM

TriCore Free Entry Tool Chain. AURIX family and AUDO Future, AUDO MAX

Quick Start Guide to Convert Files Generated by SANGO to HEW. Installation of Sango Part I.

M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4

Cookery-Book, V1.0, February XMC1400 BootKit HelloWorld

Module 3: Working with C/C++

User s Manual. Renesas Synergy e 2 studio v5.2 or Greater Getting Started Guide

Exercise: PWM Generation using the N2HET

Building an Embedded Processor System on Xilinx NEXYS3 FPGA and Profiling an Application: A Tutorial

CodeWarrior Development Studio for etpu v10.x Quick Start SYSTEM REQUIREMENTS

Getting Started with the TASKING VX-toolset for ARM

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User s Guide

As CCS starts up, a splash screen similar to one shown below will appear.

Getting Started in C Programming with Keil MDK-ARM Version 5

Hibernation Module. Introduction. Agenda

DAVE 3 Hands on / Quick Start Tutorial. Presentation Tutorial Start 1 v1.1: Creating a simple Project using PWM and Count Apps

Getting Started with the TASKING VX-toolset for TriCore

CS+ for CA,CX V

University of Hawaii EE 361L MPLab Quick Tutorial and Project 2.1 Last updated September 1, 2011

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

RL78/G13 APPLICATION NOTE. Initialization CC-RL. Introduction. Target Device. R01AN2575EJ0200 Rev July 01, 2015

BeyondStudio for NXP Installation and User Guide

M16C R8C FoUSB/UART Debugger. User Manual REJ10J

Hands-On with STM32 MCU Francesco Conti

AVR ONE!... Quick-start Guide. EVK Windows 32103C AVR ONE! 02/10

Start a New Project with Keil MDK-ARM Version 5 and ST Micro Nucleo-F446RE

University of Massachusetts Amherst Computer Systems Lab 1 (ECE 354) LAB 1 Reference Manual

CodeWarrior Development Studio for StarCore DSP SC3900FP Architectures Quick Start for the Windows Edition

Resource 2 Embedded computer and development environment

VORAGO VA108x0 GCC IDE application note

Quick Start Guide: RL78G14 Motor Control Starter Kit

Evaluation board for NXP LPC2103. User Guide. Preliminary Version updated 27 th Aug TechToys Company All Rights Reserved

Spartan-6 LX9 MicroBoard Embedded Tutorial. Tutorial 1 Creating an AXI-based Embedded System

NIOS CPU Based Embedded Computer System on Programmable Chip

Quick-start Guide for YRDKRX63N v3.3

APPENDIX A. CODE COMPOSER STUDIO (CCS) v5: A BRIEF TUTORIAL FOR THE DSK6713

Getting Started in C Programming with Keil MDK-ARM Version 5

Keil TM MDK-ARM Quick Start for. Holtek s HT32 Series Microcontrollers

Software Installation Guide for S32 Design Studio IDE (S32DS): FRDM-KEAZ128Q80 FRDM-KEAZ64Q64 FRDM-KEAZN32Q64

RELEASE NOTE. RZ/T1 Group Encoder I/F HIPERFACE DSL application package. Summary. Device that HIPERFACE DSL functionality is checked

Getting Started in C Programming with Keil MDK-ARM Version 5

Lab 1 Introduction to Microcontroller

Experiment 1. Development Platform. Ahmad Khayyat, Hazem Selmi, Saleh AlSaleh

Blackfin cross development with GNU Toolchain and Eclipse

BeyondStudio for NXP Installation and User Guide

The Road to CCSv4. Status Update

CodeWarrior Development Studio for Power Architecture Processors Version 10.x Quick Start

Nios II Studio Help System

NIOS CPU Based Embedded Computer System on Programmable Chip

Code Composer Studio. MSP Project Setup

As CCS starts up, a splash screen similar to one shown below will appear.

Section Objective: Acquaint with specifications of Launchpad Acquaint with location of switches, LEDs, power-on switch, powering the board.

RL78 Ultra Low Power MCU Lab

Old Company Name in Catalogs and Other Documents

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

AndeSight. User Manual. Working with AndESLive. Version 1.0

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

University of Massachusetts Amherst Computer Systems Lab 2 (ECE 354) Spring Lab 1: Using Nios 2 processor for code execution on FPGA

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

DOMAIN TECHNOLOGIES INC. Users Guide Version 2.0 SB-USB2. Emulator

DS-5 ARM. Using Eclipse. Version Copyright ARM. All rights reserved. ARM DUI 0480L (ID100912)

Renesas Starter Kit for RX111

IT Essentials v6.0 Windows 10 Software Labs

XMC4700/XMC4800 RelaxKit HelloWorld (USB)

R8C/Tiny. StarterKit Plus SKP8CMINI-15, SKP8CMINI-17. Clock Stop Detect

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

Transcription:

Migrating from CubeSuite+ to Eclipse RL78 Family LAB PROCEDURE Description: This hands-on lab covers how to convert CubeSuite+ project to Renesas new Eclipsebased IDE, e 2 studio using Free GNU compiler for RL78 devices. This lab will step through the key difference in Interrupt declarations, SFR access, and intrinsic functions in the Cubesuite+ and e 2 studio project, then quickly modify the CubeSuite+ project that can compile/build/debug in the e 2 studio environment. Lab Objectives 1. Port RL78 CubeSuite+ project to e 2 studio 2. Edit/build/run the project in e 2 studio Lab Materials Please verify you have the following materials at your lab station. Laptop PC with e 2 studio GNU compiler version 12.01 or later CubeSuite+ V1.02 or later RL78/G14 RDK board This lab sheet Skill Level 1. Experience with CubeSuite+ and RL78 Time to Complete Lab 2 hours Lab Sections 1 Create a CubeSuite+ Project... 2 2 Bring Cubesuite+ Project to e 2 studio... 8 3 Map IO Register and Intrinsic function... 14 4 Map Interrupt Declaration... 17 5 RUN the Project on the Target board... 18 Migrating from CubeSuite+ to Eclipse Page 1 of 21

1 Create a CubeSuite+ Project LAB PROCEDURE This lab section will create a simple CubeSuite+ project using CubeSuite+ code generator. We will create a simple project that blinks LED15 every 100 ms on timer interrupt. The project uses RL78G14 family device, R5F104PJAFB, the device used on the RL78/G14 RDK board. Procedural Steps Step 1.1 Start the CubeSuite+ development environment by clicking Start All Programs Renesas Electronics CubeSuite+ CubeSuite+ or by clicking the CubeSuite+ icon from the Windows Desktop. CubeSuite+ Start window presents several choices to choose from. These are typical of any development environment and include Learn about CubeSuite+, Create New Project, Open Existing Project, Open Existing CubeSuite/High performance embedded workbench, PM+ project, and Open Sample Project. Step 1.2 Select Create New Project or File->New-> Create New Project. This will start a new project workspace using the integrated project wizards built into the CubeSuite+. Migrating from CubeSuite+ to Eclipse Page 2 of 21

Step 1.3 Enter the options below to configure project environment for RL78 microcontroller. Microcontroller : RL78. Using microcontroller: R5F104PJAFB under RL78/G14 (ROM: 256KB) Ensure that Kind of project = Application (CA78K0R). Specify Project name = myrl78project. Specify Place = Any directory of your choice such as c: \ Click Create to make project framework. CubeSuite+ provides options for Kind of project. A short summary of the project options are: Application CA(78K0R): Project shell and folders are created. No startup files are created Debug Only: Third party tools that output Renesas compatible debug format files can be used here Library project: Creates Library project Step 1.4 The project, myrl78project, will be created. The panel contains project information. Step 1.5 In the Project Tree window, under Code Generator (Design Tool), double click on Clock Generator.Click on Fix Setting. This setting can only be done once per project. Migrating from CubeSuite+ to Eclipse Page 3 of 21

Step 1.6 Click Clock Setting tab. Leave the setting at its default. RL78 device provides option to use internal High speed oscillator or External crystal. We will use the internal oscillator for our lab. Step 1.7 Select the On-chip Debug tab and Make these settings: Migrating from CubeSuite+ to Eclipse Page 4 of 21

On-Chip Debug: Used Security ID: 0x00000000000000000000 (Default) Erase Flash Memory Data: Checked Step 1.8 Confirming Reset Source and Safety functions tab can be left as default. Step 1.9 Select the Port tab from project tree. Select Port 4 and set bit 1 as an output, with level at 1. This is for driving the on-board LED15. All other port pins should be left as unused. Step 1.10 The Interrupt, ADC, and Serial Converter, D/A converter are not used in this example, so we can skip those. Step 1.11 Select the Timer tab next.on TAU0 tab, select Channel 0 as Interval Timer. Migrating from CubeSuite+ to Eclipse Page 5 of 21

Step 1.12 Click on the Channel 0 and make the setting as below for 100 ms interval. Step 1.13 Select the Watch Dog Timer from the project tree, and set the Watch Dog Timer as unused. Step 1.14 The RTC (Real Time Clock), Interval timer, Clock output/buzzer, Data Transfer Controller, Event link controller, and Voltage Detector are not used in this example, so we can skip those. Step 1.15 Click the Generate Code button, and note the messages below. It should report that the generating file was successful. Migrating from CubeSuite+ to Eclipse Page 6 of 21

Step 1.16 Observe the File folder in the Project Tree window. The code generated by the code generator has been added under the File Code Generator. Step 1.17 Double-click on r_main.c to open the file in the editor window. Add the following Highlighted code in main() function to start the timer. Make sure the code is written under the user code area marked to avoid overwriting the code when re-generated. void main(void) { /* Start user code. Do not edit comment generated here */ R_TAU0_Channel0_Start(); // Add this line of the code while (1U) { ; } /* End user code. Do not edit comment generated here */ } Step 1.18 Open the r_cg_timer_user.c.add the following Highlighted lines in the interrupt static void r_tau0_channel0_interrupt () function to blink the LED15: _interrupt static void r_tau0_channel0_interrupt(void) { /* Start user code. Do not edit comment generated here */ P4.1++; //Add this line of the code /* End user code. Do not edit comment generated here */ } Step 1.19 Save this project, File-> Save Project. Questions: 1) What operating voltage range is selected for the project in code generator? Migrating from CubeSuite+ to Eclipse Page 7 of 21

2 Bring Cubesuite+ Project to e 2 studio LAB PROCEDURE This section creates RL78 project template using e 2 studio project wizard and bring the Cubesuite+ project files to e 2 studio.. Procedural Steps Step 2.1 Start -> All Programs -> Renesas Electronics e 2 studio -> Renesas e 2 studio. Step 2.2 In the Workspace Launcher, select C:\Workspace or any other directory where you want to create the project. Step 2.3 A window similar to the one will appear. Close the Welcome window. Migrating from CubeSuite+ to Eclipse Page 8 of 21

Step 2.4 Click File New C Project, a below window will open. Enter the below information and click Next> button. Project name: myproject Project type: Executable (Renesas) -> Sample Project Toolchains: KPIT GNURL78-ELF Toolchain Migrating from CubeSuite+ to Eclipse Page 9 of 21

Several Project Types choices can be seen here depending on what tools are installed and registered in the e 2 studio environment. The project type will determine the toolchain and tabs that CDT (C/C++ Development Tooling) uses. A short summary of Project types are: Executable (Renesas): Create a Renesas project template which includes IO register, startup file, and basic project setup files. Debug- Only Project: Mainly used when Third party tools are used. Makefile project: Creates an empty project. This selection is useful for importing and modifying existing make-file based projects. Step 2.5 Make the following selection in the window and click Next> button: Toolchain Version v12.01. Debug Hardware E1 (RL78) Select Target R5F104PJ Select Configurations from List Below Use Default setting (Check mark on Hardware debug and Release (no debug)) If there are many version of the same tools chain installed in the PC, e 2 studio will show option for all the Toolchain Versions. The default selection is the latest version. Migrating from CubeSuite+ to Eclipse Page 10 of 21

Step 2.6 Select additional CPU option. Leave this window to its default options and Click Next> button. Step 2.7 The next window selects the library. Leave this window to its default options. The Library source selection: Newlib : Complete ISO C library supporting C/C++ code. Optimized: Subset of ISO C library, size-optimised, does not fully support C++ code but sufficient for most of the application. Migrating from CubeSuite+ to Eclipse Page 11 of 21

Step 2.8 Click Finish. The following summary window will open. Click OK to generate the project. Step 2.9 Your project workspace should now look like this: Step 2.10 Now the CubeSuite+ project files will be imported to e 2 studio s project. Right click on the src folder in the Project Explorer window and click Import. Select an import source as General->File system and click Next> button. Migrating from CubeSuite+ to Eclipse Page 12 of 21

Step 2.11 In the next window, From directory" textbox near the top, click the "Browse" button to go to the directory where you generated the CubeSuite+ project: Step 2.12 Select all the *.c and *.h file ONLY from the list. Click Finish button. Migrating from CubeSuite+ to Eclipse Page 13 of 21

Step 2.13 The files will be added in the src folder in the Project Explorer window. The window will look like this: 3 Map IO Register and Intrinsic function This section modifies the IO register, compiler intrinsic functions, and application code to compile on the GNU compiler. Procedural Steps Step 3.1 Open myproject.c file. Rename the main function as main_old() function to avoid the redundant main() function from the CubeSuite+ project. int main_old(void) { // TODO: add application code here } while (1) { } return 0; Migrating from CubeSuite+ to Eclipse Page 14 of 21

Step 3.2 Build the project, Project Build All without making modification. You will see that IO registers used in the CubeSuite+ project files are not recognized by the GNU compiler and generates compile errors. Step 3.3 Open the r_main.c file. Add code line as below to include iodefine.h and iodefine_ext.h files which define the IO register to the line 47, to clear the undeclared registers errors showed in the previous Step 3.2. /* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" /* End user code. Do not edit comment generated here */ Step 3.4 Open r_cg_cgc.c file and r_cg_cgc_user.c. Add code line as below to include iodefine.h and iodefine_ext.h files to the line no. 46. /* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" /* End user code. Do not edit comment generated here */ Step 3.5 Open the r_cg_port.c and r_cg_port_user.c file. Add code line as below to include iodefine.h and iodefine_ext.h files to the line 46.. /* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" /* End user code. Do not edit comment generated here */ Step 3.6 Open the r_systeminit.c. Add code line as below to include iodefine.h and iodefine_ext.h files to the line 48.. Migrating from CubeSuite+ to Eclipse Page 15 of 21

/* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" /* End user code. Do not edit comment generated here */ Step 3.7 Open the r_cg_timer.c. Add code line as below to include iodefine.h, iodefine_ext.h to the line 46 as below. /* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" /* End user code. Do not edit comment generated here */ Step 3.8 Open the hardware_setup.c file. Add the below code inside the HardwareSetup() function. void HardwareSetup(void) { hdwinit(); //Add this line } Step 3.9 Go to r_systeminit.c and change the hdwinit() function by changing the EI(); and DI(); to asm("ei"); and asm("di"); respectively. //Cubesuite+ project function void hdwinit(void) { DI(); R_Systeminit(); EI(); } //Change the function as below void hdwinit(void) { asm("di"); R_Systeminit(); asm("ei"); } Migrating from CubeSuite+ to Eclipse Page 16 of 21

4 Map Interrupt Declaration LAB PROCEDURE This section modifies the interrupt definition, interrupt handler function, and application code to compile on the GNU compiler. Procedural Steps Step 4.1 Open the r_cg_timer_user.c. Include iodefine.h, iodefine_ext.h, and interrupt_handlers.h files to the line 46 as below. /* Start user code for include. Do not edit comment generated here */ #include "iodefine.h" #include "iodefine_ext.h" #include "interrupt_handlers.h" /* End user code. Do not edit comment generated here */ Step 4.2 Go to r_cg_timer_user.c and scroll down to the bottom, Line no. 65 and find the function called r_taru0_channel10_interrupt. Comment the interrupt static void r_tau0_channel0_interrupt(void) and pragma vector = INTTM00_vect lines. Add the void INT_TM00 (void) as new interrupt handler function as below. //comment below two line // interrupt static void r_tau0_channel0_interrupt(void) //#pragma vector = INTTM00_vect //Change the function name as below void INT_TM00 (void) { /* Start user code. Do not edit comment generated here */ P4.1++; /* End user code. Do not edit comment generated here */; } Step 4.3 Comment the line no. 70, P4.1++ and add new line of code as P4_bit.no1^=1; as below: void INT_TM00 (void) { /* Start user code. Do not edit comment generated here */ //P4.1++; //comment this line P4_bit.no1^=1; //Add this line of code /* End user code. Do not edit comment generated here */ } CubeSuite+ IO port access structure is different than the GNU compiler. Migrating from CubeSuite+ to Eclipse Page 17 of 21

Step 4.4 Go to interrupt_handler.c and comment the default Timer interrupt handler created by the project template at line 124. //void INT_TM00 (void) { } //comment this line Step 4.5 Step 4.6 Save the project. Build the project, Project Build All. The Console window will show the below output. 5 RUN the Project on the Target board Overview: This section describes how to launch the TK debugger from e 2 studio and run the program on the target board. Procedural Steps Step 5.1 Connect the RDK board to PC via USB cable. Make sure RDK board has DIP switch SW5 setting as below: 1: ON, 2: OFF, 3:ON, 4: ON Migrating from CubeSuite+ to Eclipse Page 18 of 21

Step 5.2 Go to Run Debug Configuration.Click on myproject under Renesas GDB Hardware Debugging. Step 5.3 Click on the Startup tab and put a check mark on the Halt. Migrating from CubeSuite+ to Eclipse Page 19 of 21

Step 5.4 Step 5.5 Click Debug button to start the TK debugger. Click Yes, to confirm the perspective switch from C/C++ to Renesas Debug perspective. Step 5.6 Click Resume button to run the program. First the program will break at main() function. Step 5.7 Go to r_cg_timer_user.c, line 71 (Approx) and put a break in the following line of code. Step 5.8 Click Resume button again to run the program. The program will break at Interval timer interrupt function. Step 5.9 Remove the break point. Step 5.10 Click Resume button to run the program and observe LED15 on the RDK board. Migrating from CubeSuite+ to Eclipse Page 20 of 21

Questions: 2) List the main differences in the CubeSuite+ compiler and GNU compiler? 3) List the similarities in the CubeSuite+ compiler and GNU compiler? LAB PROCEDURE Migrating from CubeSuite+ to Eclipse Page 21 of 21