davE使用说明
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Application Note: 227
Using DAVE3 with MDK-ARM
Abstract
This application note demonstrates how to export a project created in DAVE3 to a µVision project. By combining the two development environments, the advantages of both tools are fully accessible and accelerate the development cycle when creating applications for the XMC4000 processor family.
Contents
Abstract (1)
Introduction (1)
Prerequisites (1)
Porting DAVE3 based Projects (2)
Configuring Flash Download Options (6)
Configuring Debug Options (8)
Configuring Trace Options (10)
Revision History (12)
Introduction
Infineon DAVE3 and Keil MDK-ARM both provide unique features that aid the software development for the Infineon XMC4000 family.
DAVE3 supports automatic code generation based on predefined software components, the so-called “DAVE Apps”. DAVE Apps are configured in the Eclipse GUI. They provide a convenient way to configure the MCU and setup a basic application framework with peripheral drivers.
MDK-ARM features the ARM C/C++ Compiler for improved code density and execution performance of the embedded application. The µVision IDE provides best visibility for debugging with its built-in CMSIS-SVD peripheral views and CMSIS-RTOS awareness.
MDK-ARM and ULINK pro use the Embedded Trace Macrocell (ETM) on XMC4000 devices for non-intrusive instruction trace with Code Coverage & Performance Analysis.
Prerequisites
Software needed for this application note:
∙DAVE Code Engine, version 3, from Infineon
∙MDK-ARM, version 4.23, from Keil ( or later)
∙MDK-ARM Plug-in for Eclipse (part of the MDK-ARM software package)
Recommended debug adapter for enabling ETM trace capabilities.
∙ULINK pro (optional) for debugging on hardware.
Install the software listed above. Activate the MDK-ARM Plug-in as described in the chapter Installing MDK-ARM Plug-in of the manual MDK-ARM Plug-in for Eclipse.
This application note assumes the user is knowledgeable of DAVE3 and has some experience with the MDK-ARM development tool.
Porting DAVE3 based Projects
DAVE3 generates code that can be debugged with MDK-ARM using the MDK-ARM Plug-in for Eclipse. For this to work, a DAVE3 project has to be ported to a µVision project.
1.Start DAVE3 and set active the project of your choice.
2.Select the menu µVision – Create/Update µVision Projects.
3.The next view, µVision Project Generator:
a.Displays the DAVE3 project in use.
b.Proposes a file name for the µVision project (extension *.uvproj )
c.Displays the device used in the application.
d.Proposes the compiler to be used with µVision.
e.Allows using the MicroLIB.
f.Offers a field to enter additional compiler options.
Click Next.
4.The next view, Select Device, shows the device selected for the application and allows selecting a µVision Device
Database, which contains device configuration information used by µVision.
Click Next.
5.The next view, µVision Project Generator, shows the files that are added to the project. Startup files and system
files are added automatically.
Click Finish.
6.In µVision, rebuild the project using the menu Project – Rebuild all target files.
The µVision project gets created with the code ported from the DAVE3 project.
All Flash downloading and debugging configuration options are set automatically for the Keil ULINK2 debug adapter. Further configuration steps are not necessary in case a ULINK2 debug adapter is used. The ported application can be downloaded and debugged right away on hardware.
Configuring Flash Download Options
The application can be downloaded to Flash using the DAVE3 menu µVision – Flash Download.
First, create a Flash Download Configuration.
1.In DAVE3, select the menu µVision – Flash Download – Flash Download Configurations.
2.Click Target Options.
3.In the µVision configuration window:
Click the tab Utilities.
Enable Use Target Driver for Flash Programming.
Select ULINK Pro Cortex Debugger.
Click Settings to select the Flash programming algorithm.
4.On the next screen, click Add to open the Flash programming algorithm list. The picture shows the algorithms that
have been selected already.
5.Select the Flash programming algorithms that suite the device. Some devices require more Flash programming
algorithms.
Click Add.
6.Click OK twice.
7.In DAVE3, click Flash Download. The Console view shows the Flash downloading progress.
Configuring Debug Options
To debug the application with µVision from DAVE3, create a Debug Configuration profile.
1.In DAVE3, use the menu Debug – Debug Configurations.
2.Click Target Options.
3.In the µVision configuration window, select the tab Debug.
Select ULINK Pro Cortex Debugger.
Click Settings.
4.On the next screen, set the Port to JTAG.
Set the Max Clock. This field sets the maximum possible debugging communication frequency.
Click OK.
5.In DAVE3, click Debug. The Console displays the start progress of the debugging session. The µVision Debugger
is launched where developers can continue debugging the application.
Configuring Trace Options
To capture trace data, configure µVision as described below.
1.In DAVE3, select Debug – Debug Configurations.
2.Click Target Options.
3.In µVision, click the tab Debug.
4.Click the button , left to the button Edit.
5.Create a file named, for example, TracePort.ini.
Add the following code to the file and save it. The code configures the trace port for the 4-bit Data bus.
/*------------------------------------------------------------------------- TP_Setup() configures synchronous 4bit Trace Interface
*-----------------------------------------------------------------------*/ FUNC void TP_Setup (void) {
_WDWORD(0x48028274, 0x00400004); // P2_HWSEL
_WDWORD(0x48028674, 0x00001405); // P6_HWSEL
}
TP_Setup(); // TracePort Setup
6.Insert that file name, TracePort.ini, in the field Initialization File.
7.Click Settings.
8.On the next screen, click the tab Trace.
9.Set the Core Clock to 120 MHz.
Set Trace Enable.
Set ETM Trace Enable.
Set the Trace Port to Sync Trace Port with 4-bit Data.
(These settings have to correspond to the instructions entered into the file TracePort.ini, as described in step 5.)
10.Click OK twice.
The device is setup for emitting ETM trace data, which can be captured by ULINK pro. ETM trace data are displayed in the µVision window View – Trace – Trace Data.
Revision History
February 2012: Initial Version。