Migration from HEW to e 2 studio Development Tools > IDEs LAB PROCEDURE Description The purpose of this lab is to allow users of the High-performance Embedded Workbench (HEW) to gain familiarity with the process of migrating HEW projects to the Eclipse-based e2studio IDE. This lab will step through use of the HEW Import wizard within e2studio and illustrate the subsequent steps required to setup the e2studio debugger. Lab Objectives 1. Make use of the HEW Import wizard 2. Understand the wizard implementation 3. Setup the e2studio debugger 4. Launch a debug session within e2studio Lab Materials Please verify you have the following materials at your lab station. PC with HEW, e2studio and RXC toolchain preinstalled YRDKRX63N demonstration kit Skill Level 1. Intermediate 2. Familiarity with HEW assumed 3. Basic C programming skills Time to Complete Lab 30 Minutes Lab Sections 1 Reviewing an Example Project in HEW... 2 2 Importing the Example Project in e2studio... 5 3 Debugger setup in e2studio... 6 Migration from HEW to e2studio Page 1 of 7
1 Reviewing an Example Project in HEW Overview In this section you will open an existing project within the High-performance Embedded Workshop (HEW) which will serve as an example for the project migration exercise. Procedural Steps Step 1.1 Start the HEW development environment by clicking Start > All Programs > Renesas > High-performance Embedded Workshop > High-performance Embedded Workshop or by clicking the HEW icon on the Windows desktop. Step 1.2 In the Welcome dialog box, select Browse to another project workspace and then navigate to the HEWe2studioMigration.hws workspace file at the location indicated by the lab supervisor. The workspace contains a single project named Example which contains multiple files providing startup definitions for the YRDKRX63N demonstration board and application code within the Example.c file. Step 1.3 Step 1.4 Add a new source file and header file to the project by clicking Project > Add Files and navigating to the files led.c and led.h in the External folder located with the HEWe2studioMigration.hws workspace file. Modify the application code to use the led() function provided within the led.c file by opening the Example.c file. Include the led.h file near the top of Examples.c by adding the line: #include "led.h" Step 1.5 Call the led() function within the while loop of the application code by adding the line: led(n >> 10); Step 1.6 Add the External folder to the project as an include file directory by clicking Build > RX Standard Toolchain selecting the Example project, then Include file directories and finally clicking Add (see screenshot below). Migration from HEW to e2studio Page 2 of 7
Step 1.7 Add a definition of the LEDBYTE pre-processor macro for building the file led.c by clicking Build > RX Standard Toolchain selecting the led.c file, then Defines and finally clicking Add (see screenshot below). The value of this macro (0x8c00d) is the address of the IO register to which the LEDs on the demonstration board are mapped. Migration from HEW to e2studio Page 3 of 7
The added code will toggle the state of LEDs on the target board each time around the loop. The location of the added project files (outside the project folder) will be used to illustrate the behavior of the HEW import wizard later in this lab. Step 1.8 Save and then build the modified application code by clicking File > Save followed by Build > Build. Step 1.9 Download the application to the target by clicking Debug > Connect followed by Debug > Download Modules > Download All Modules. Step 1.10 Verify correct operation of the application by clicking Debug > Go. The user LEDs on the RDKRX63N demonstration board should flash to confirm correct execution. Step 1.11 Halt execution by clicking Debug > Halt Execution and then exit HEW. Migration from HEW to e2studio Page 4 of 7
2 Importing the Example Project in e2studio Overview In this section you will import the HEW project into the e2studio IDE and confirm that the import has been successful by building the project. Procedural Steps Step 2.1 Start the e2studio IDE by clicking Start > All Programs > Renesas Electronics e2studio > Renesas e2studio or by clicking the e2studio icon on the Windows desktop. Step 2.2 Step 2.3 Step 2.4 Start the HEW Import wizard by clicking File > Import and then selecting HEW Import from the General folder. On the next page of the wizard, browse to the HEW project file named Example.hwp in the Example folder located with the HEWe2studioMigration.hws workspace file. Click Finish to complete the wizard. The HEW import wizard will create e2studio project metadata within the existing Example folder and add the project to the current e2studio workspace. The project will then appear within the Project Explorer view. Step 2.5 Ensure that the Debug build configuration is active for the new project by selecting the Example project node in the Project Explorer view and then clicking Project > Build Configurations > Set Active > Debug. The import wizard does not observe the active build configuration selected within HEW. Note that all HEW build configuration names are preserved within e2studio but, by convention, an e2studio Debug build configuration is intended to target the GDB simulator while a HardwareDebug build configuration in intended to target real hardware. Step 2.6 Build the project within e2studio by clicking Project > Build Project. Questions 1. Why are the icons representing the led.c and led.h source files decorated with an arrow? 2. Why is the icon representing the led.c source file also decorated with a wrench? 3. How can you confirm that the build settings specified within HEW have been transferred to e2studio correctly? 4. Why is the icon representing the decr.c source file in the sys folder decorated with a diagonal strikethrough? Migration from HEW to e2studio Page 5 of 7
3 Debugger setup in e2studio Overview In this section you will create an Eclipse launch configuration within the e2studio IDE and verify correct building of the Example project by launching a debug session. Procedural Steps Step 3.1 Select the ELF executable image file named Example.x located under the Binaries virtual folder of the Example project within the Project Explorer and then click Run > Debug As > Renesas GDB Hardware Launch. e2studio will look for an existing launch configuration suitable for launching this executable file on Renesas hardware. On the first occasion, no suitable launch configuration will be found so the IDE will prompt for the information required to create one. Step 3.2 Step 3.3 Select the Segger JLink debugger from the list of supported debuggers and click OK. Select the R5F563NB target device from the list of supported devices and click OK. e2studio will use the information provided to create a launch configuration and then immediately launch a debugging session based on the new configuration. The IDE may prompt for confirmation that the Renesas Debug perspective should be opened. Step 3.4 Start application execution by clicking Resume on the toolbar of the Renesas Debug view. Click Resume once again when execution is suspended at the start of the main(). The user LEDs on the RDKRX63N demonstration board should flash to confirm correct execution. Step 3.5 Step 3.6 Click Suspend on the toolbar of the Renesas Debug view and then experiment with the other buttons on this toolbar. Use the Step Into button to step into the led() function and observe the call stack. Invoke the Debug Configurations dialog by clicking Run > Debug Configurations then select the Example.x launch configuration created for the initial launch and review the various settings available (see screenshot below). Migration from HEW to e2studio Page 6 of 7
The hardware-specific settings are located on the Debugger tab of the Debug Configurations dialog. e2studio provides sensible default values for these settings based on the debugger and target device selections made prior to the initial launch. Questions 5. How would you disable the temporary breakpoint set at the start of the main() function? 6. How would you specify an additional image file to be downloaded during the launch sequence? Migration from HEW to e2studio Page 7 of 7