Migration from CubeSuite+ to e 2 studio /GNU Compiler

Migrating from CubeSuite+ to Eclipse
Renesas Electronics America Inc.
© 2012 Renesas Electronics America Inc. All rights reserved.
Renesas Technology & Solution Portfolio
2
© 2012 Renesas Electronics America Inc. All rights reserved.
Microcontroller and Microprocessor Line-up
2010
2013
1200 DMIPS, Superscalar
32-bit
 Automotive & Industrial, 65nm
 600µA/MHz, 1.5µA standby
1200 DMIPS, Performance
 Automotive, 40nm
 500µA/MHz, 35µA deep standby
500 DMIPS, Low Power
 Automotive & Industrial, 90nm
 600µA/MHz, 1.5µA standby
165 DMIPS, FPU, DSC
 Industrial, 40nm
 242µA/MHz, 0.2µA standby
165 DMIPS, FPU, DSC
 Industrial, 90nm
 242µA/MHz, 0.2µA standby
8/16-bit
25 DMIPS, Low Power
 Industrial, 90nm
 1mA/MHz, 100µA standby
 Industrial & Automotive, 150nm
 190µA/MHz, 0.3µA standby
44 DMIPS, True Low Power
10 DMIPS, Capacitive Touch
 Industrial & Automotive, 130nm
 144µA/MHz, 0.2µA standby
 Industrial & Automotive, 130nm
Wide
Format LCDs
 350µA/MHz, 1µA standby
3
Embedded Security, ASSP
© 2012 Renesas Electronics America Inc. All rights reserved.
‘Enabling The Smart Society’
 Challenge:
“CubeSuite+ has been very popular IDE among other
Renesas IDE. However, the free version has its own compiler
limitation. As MCUs continue to become more complex
especially when creating applications to enable the Smart
Society, and therefore the Software becomes more complex
as well. As a result most of the complex program doesn’t fit
in the free code size limited version of the CubeSuite+ and
requires tool investment.
 Solution:
“This class will help you how easy is to Migrate RL78 Cubesuite+
code to e2studio/GNU compiler”.
4
© 2012 Renesas Electronics America Inc. All rights reserved.
Agenda
 CubeSuite+ Project generation
 Create e2studio project template for GNU tool chain
 Bring CubeSuite+ files to e2studio
 Modify CubeSuite+ file in the e2studio for GNU compiler
 Build and Run the project
 POP QUIZ
5
© 2012 Renesas Electronics America Inc. All rights reserved.
Lab Platform
 Hardware Platform
 RL78/G14 RDK
– R5F104PJ device,
• 256KB Flash, 8KB Data Flash, 24KB SRAM.
– USB cable for power and debug communication
– OCD Debugger (TK debugger)
 Software Platform
 e2studio version 1.1
http://www.renesas.com/products/tools/ide/ide_e2studio/downloads.jsp
 RL78 GNU compiler version 12.02
http://www.kpitgnutools.com
 CubeSuite+ version 1.02
6
© 2012 Renesas Electronics America Inc. All rights reserved.
RL78/G14 RDK’s User Features
TK Debug
RS-232
Graphics
LCD
Digital sensors
Temp & Accel
Gainspan Wi-fi
RL78/G14 MCU
Application header
WiFi
Eink
display
LED
Ring
TRIAC
7
© 2012 Renesas Electronics America Inc. All rights reserved.
FET
Definition of Terms
 Software Elements
• e2studio – Eclipse based Integrated Development Environment for
Renesas Microcontroller families RL78, RX, SH.
• Perspective – A perspective is like a page in a book which contains set of
views.
Debug
Perspective
8
© 2012 Renesas Electronics America Inc. All rights reserved.
Definition of Terms (Cont.)
 Software Elements (cont.)
 View: A perspective consists of a number of sub-windows, called
views.
 CubeSuite+ - Renesas Integrated Development Environment for
Renesas Microcontroller families RL78, RX, V850.
 CG: Code generator
 Hardware Elements
 TK interface – On-chip debug emulator for RL78 device.
 RDK– Renesas Demonstration Kit
 E1- On-chip debug emulator
9
© 2012 Renesas Electronics America Inc. All rights reserved.
Why to Migrate from Cubesuite+ to e2studio
 Open source environment
 Easy to customize
 Widespread user community
 Huge range of off the shelf plug-ins
 No License fee or code size limitation with GNU
compiler
 Built in editor and project management functions
are far superior to CubeSuite+
 Easy migration from one MCU family to another
 Third party compiler (e.g. IAR, GNU, GHS) support
10
© 2012 Renesas Electronics America Inc. All rights reserved.
Feature Comparison
Features
Cube
Suite+
e2studio








Spell Checker


Create header File from C File


Small # of clicks to launch Debug


Refactor Name


Navigate Back
Close All but This
Bookmark
Find Usages
11
© 2012 Renesas Electronics America Inc. All rights reserved.
e2studio Key Features
 Automatic detection of KPIT GNU and Renesas
toolchains.
 Powerful code editor functionality
 Keyword color coding of source code
 Built-in spell checker
 Project generation wizards
 Create skeleton projects targeting Renesas
processors
 Projects build and run without modification
 Cross-platform launchers
 Download to remote hardware via debug probe
 Simulator alternative where hardware unavailable
 Both basic and advanced debug capabilities
 Free download
12
© 2012 Renesas Electronics America Inc. All rights reserved.
Migration from CubeSuite+ to e2studio /GNU Compiler
(1/3)
 Project Migration
 Create a project template for RL78 (a)
 Registration of CubeSuite+ source files (b)
 Map IO register and Interrupt declaration (c)
(a)
(b)
(c)
13
© 2012 Renesas Electronics America Inc. All rights reserved.
Migration from CubeSuite+ to e2studio GNU Compiler (2/3)
 Port structure
 CubeSuite+:
ex:
Bit access:
P7.7++;
 e2studio with GNU Compiler:
ex:
Bit access :
P7_bit.no7;
 Interrupt handling
 CubeSuite+ :
__interrupt static void r_tau0_channel0_interrupt(void) {
}
 e2studio with GNU Compiler
void INT_IT (void) {
}
14
© 2012 Renesas Electronics America Inc. All rights reserved.
Migration from CubeSuite+ to e2studio GNU Compiler (3/3)
 Intrinsic Function
 CubeSuite+
ex:
DI();
EI();
 e2studio with GNU Compiler
ex:
asm("di");
asm("ei");
 Similar Language Features
 Same variable size
 Same SFR access except IO Port access
15
© 2012 Renesas Electronics America Inc. All rights reserved.
Common Issues
 My program doesn’t go to interrupt service routine I defined
in the Cubesuite+?
-> Make sure the ISR function name has been ported from
__Interrupt qualifier to INT qualifier for GNU compiler.
 How do I fix the error “ “XXX” undeclared (First use in the
function)” while building the project?
-> Check if iodefine.h, and iodefine_ext.h files are included in
the *.c files which shows the error message.
 Can’t connect e2studio to RDK board for the debug session?
-> Check the SW5 DIP-switch setting on the board as:
1:ON; 2:OFF; 3:ON ; 4:ON
16
© 2012 Renesas Electronics America Inc. All rights reserved.
Lab Time!
Please refer to the Lab Handout and let’s get started!
17
© 2012 Renesas Electronics America Inc. All rights reserved.
Questions?
18
© 2012 Renesas Electronics America Inc. All rights reserved.
‘Enabling The Smart Society’ in Review…
Challenge:
“CubeSuite+ has been very popular IDE among other
Renesas IDE. However, the free version has its own
compiler limitation. As MCUs continue to become more
complex especially when creating applications to enable the
Smart Society, and therefore the Software becomes more
complex as well. As a result most of the complex program
doesn’t fit in the free code size limited version of the
CubeSuite+ and requires tool investment.
Solution:
“This class will help you how easy is to Migrate RL78 Cubesuite+
code to e2studio/GNU compiler”.
 Do you agree that we accomplished the above statement?
19
© 2012 Renesas Electronics America Inc. All rights reserved.
Pop Quiz
 Q: Name the changes required in the Cubesuite+ code to
make it portable for the e2studio/GNU environment ?
 a) IO Port mapping
 b) Interrupt handler
c) Integer variables
 d) Compiler function (ex: DI, EI)
 Q: What is the name of the on chip debugger used on the
RDK board?
a)
 b)
c)
d)
20
E1
TK Debugger
E20
E8
© 2012 Renesas Electronics America Inc. All rights reserved.
Pop Quiz
 Q: What is the advantage of using e2studio over Cubesuite+
platform?
 a) NO code size limitation
 b) No license requirement
c) Proprietary IDE
 d) Third party compiler support
 Q: How do you port the bit access for port 7, bit 7 (P77)
from Cubesuite+ compiler to e2studio/GNU platform?
a) P7.7 to P7.BIT_bit7
 b) P7.7 to P7_bit.no7
c) P7.7 to P7_bit7
21
© 2012 Renesas Electronics America Inc. All rights reserved.
Renesas Electronics America Inc.
© 2012 Renesas Electronics America Inc. All rights reserved.