infine on xmc c1100 2go: c
TRANSCRIPT
In
ITto
Kthli
Ma
A
WM
T
OMR
Ma
nfineon XMC110
Infine ARM KeiFor the Inf
IntroductiThe purpose ofoolkit featuring
Keil provides ahis complimenimit. MDK in
Middleware: Kand a Flash File
ARM Compile
Why Use KMDK provides
1. µVisioCompwith in
2. A full It has
3. An RT
4. DAVE
5. ChoicLink a
6. All Co
7. Keil TThis h
8. Keil a
This documen
1. Real-tThese
2. Four H
3. System
4. A DSP
5. Two E
Other InfiMDK supports,Relax, XMC45
MDK supports advanced debug
00 Cortex-M0 Lab
on XMCl MDK 5 T
fineon XMC
ion: f this lab is to ing the IDE μVis
a free MDK licntary license. Icludes a full ve
Keil has a suitee system. It is
er Qualificatio
Keil MDK ?these features
on IDE with Iniler/Assemblerncluded examp
feature RTOSa BSD license
TX Kernel Aw
E compatible.
e of adapters: and J-Link Lite
oreSight™ debu
Technical Supphelps you get yo
lso supports In
t details these
time Read updaare non-intrus
Hardware Brea
m and Thread V
P example with
Examples using
neon boa, with example
500 Application
Serial Wire Vgging features.
b with XMC 2Go
The latest
C1100 Toolkit 2Go KIT
ntroduce you tsion®. This tut
ense for use wIf you do not inersion of Keil R
e of commercia component o
on Kit: For sa
? particularly su
ntegrated Debur and Linker toples and is easy
called RTX isand was create
areness window
See www.kei
ULINK™2, Ue. µVision also
ugger features
port is includedour project com
nfineon 8051 an
e features:
ate for Watch, sive to your pro
akpoints (can b
Viewer: a kern
h variables upd
g DAVE to con
rds suppoes, other evaluan Kit, XMC120
iewer (data tra. These feature
board
version of this
2Go: C SumVersion 2.0
o the Infineon torial will use t
ith Infineon XMnstall a license,RTX™ RTOS
al grade middlof MDK-Profe
afety certificatio
uited for Cortex
ugger, Flash prooolchain. MDKy to get running
s included withed and is main
w that is updat
l.com/appnote
LINK-ME, ULo supports CM
are supported
d for one year ampleted faster
nd C166 proce
Memory and Rogram. No CP
e set/unset on-
nel awareness p
dated in real-tim
nfigure and cre
orted: ation boards fro00 Boot Kit an
ace) and ETM (es are describe
1
s document is
Cortex-Mmmer 2014
Robert Bo
Cortex™-M0 the on-board J-
MC1000 proce, you can still u. RTX source
leware for Infinssional. See w
on applications
x-M processor
ogrammer and K is a turn-key g.
h MDK with sotained by Keil
ted in real-time
s/files/apnt_25
LINKpro or SeSIS-DAP.
in the µVision
and is easily renand more relia
essors. See ww
RTX Threads wU cycles are st
-the-fly) and fo
program for RT
me as the progr
eate µVision B
om Infineon usnd XMC4500 H
(instruction traed in their respe
Copyright ©
www.keil
here: www.ke
M0 Lab 4 oys bob.boys
processor fam-Link Lite debu
essors. See wwuse this lab. Mcode is includ
neon processorwww.keil.com/
s: www.keil.c
r users:
the ARM product
ource code. .
e.
58.pdf
egger J-
n debugger.
newable. ably.
ww.keil.com/dd
windows. Memtolen. No instr
our Watchpoint
TX RTOS that
ram is running
linky and RTX
sing ARM procHiLight. See w
ace) on those Cective labs.
© 2014 ARM Ltd. All rig
l.com
eil.com/appnot
@arm.com
mily using the Aug adapter.
ww.keil.com/inMDK will then ded with MDK.
rs. This includ/arm/mdk for m
om/pr/article/1
d for the compl
mory and SVDrumentation co
ts (also called A
updates while
g using a Watch
X_Blinky proje
cessors. Thesewww.keil.com/
Cortex-M4 proc
ghts reserved
tes/docs/apnt_
ARM® Keil® M
nfineon/mdk tohave a 32K co.
des TCP/IP, USmore informatio
1262.htm
ete list.
D also have Wriode is added.
Access Breaks
the program is
h window.
ects.
e include XMC/infineon.
cessors that inc
_260.asp
MDK™
o obtain ompile
SB, CAN on.
ite access.
s).
s running.
C4500
clude these
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
2
Index:
Part A: Obtaining and Installing MDK and the Examples: 1. Keil Software Download and Installation:: 3
2. Complimentary µVision License: 3
3. The on-board J-Link Lite Debug Adapter: 3
4. Example Programs: 3
5. Getting Started MDK 5 book: 3
6. µVision Software Packs Download and Install Process: 4
7. Testing the J-Link Lite Connection to the XMC1100: 5
8. Installing the J-Link Lite USB Drivers (if necessary) 5
Part B: Stand-alone Project Examples: 9. UART_Blinky Example Program using the XMC1100: 6
10. Hardware Breakpoints: 6
11. Call Stack + Locals Window 7
12. Watch and Memory Windows: 8
13. How to View Local Variables in Watch or Memory Windows: 9
14. System Viewer (SV): 10
15. Access Breakpoints (Watchpoints): Conditional Breakpoints 11
16. RTX_Blinky example program with Keil RTX RTOS: 12
17. RTX Kernel Awareness: 13
18. DSP SINE example using ARM CMSIS-DSP Libraries: 14
19. Creating Your Own MDK 5 project from scratch: 17
Changing the Processor Clock Speed: 19
20. Creating Your Own RTX MDK 5 project from scratch: 20
Part C: Projects created with Infineon DAVE: 21. Blinky: 23
22. RTX_Blinky 30
Appendix:
23. Document Resources: 38
24. Keil Products and contact information: 39
In
P
1
2Wr
Ka
3TUd
4Tth
5
M
F
A
I
nfineon XMC110
Part A: O
1) Keil So1. Down
2. Install
3. We re
4. If you
5. The ex
6. You d
2) ComplWithout a licenreferred to MD
Keil offers a coa license. Insta
3) The onThe on-board JUSB drivers codrivers as well
4) ExampThe UART_Blihis document a
5) Getting
More Inform
For more inform
ARM Commu
Infineon Comm
ConcepIn order toregister bmanual taUsing DAYou can dproject wDAVE Apsoftware tbecome Cadd that aOnce DAplug-ins fDAVE anDAVE wYour proj
Documen
DAVE tuDAVE HUsing DA
00 Cortex-M0 Lab
btaining a
oftware Dnload MDK 5.1
l MDK into the
commend you
install MDK o
xamples Blinky
do not need any
imentary nse, MDK funcK Lite. You c
omplimentary Mallation instruct
n-board J-J-Link Lite adaome with the Das instructions
ple Prograinky example pat www.keil.co
g Started
mation and K
mation about K
unity Forums:
munity Forum
pt: Why Useo successfully its in complica
asks rather easiAVE for even mdevelop and deith the periphepps are programthat configures
C source files thare specific to y
AVE creates a pfor µVision or nd the new filesill not modify jects can use R
ntation and He
utorials are avaielp is available
AVE with MDK
b with XMC 2Go
and Instal
ownload a1a or later from
e default direct
use the defaul
or the example
y5, DSP5 and R
y external debu
MDK Licections but is limcan use MDK L
MDK license ftions are also a
-Link Lite apter is used exDAVE downloas on installing t
ams: program is proom/appnotes/do
MDK 5: O
Keil Contacts:
Keil support for
www.keil.com
m: www.infine
e DAVE ? configure mod
ated data sheetsily. DAVE takmildly complicebug your progeral configuratims that are sels elements suchhat are compileyour project. project, you canDAVE are nees will be imporor delete them
RTX RTOS or n
elp:
ilable on wwwe by selecting HK 5: www.keil
board
lling MDK
and Instam the Keil web
tory. You can
lt examples dir
s into a differe
RTX_Blinky5
ug adapters: jus
ense: mited to a 32K Lite for this tut
for Infineon XMavailable at this
Debug Adxclusively in thad and are also the USB driver
vided in the Mocs/apnt_260.a
Obtain this usef
:
r Infineon prod
m/forum and
eonforums.com
dern microconts is required. Dkes care of the mcated developmgrams either wiions that you sected and confh as peripheraled by DAVE a
n easily importeded. Do not mrted into µVisi. not. Using RT
w.infineon.com/Help/Help Conl.com/appnotes
3
and the E
llation: bsite. www.ke
install into any
ectories for thi
ent directory, y
are available o
st the 2Go boar
compilation siorial. Adding
MC1100 proces URL.
dapter: is lab. Instructincluded with
rs. This docum
MDK 5 Softwarasp. The next p
ful book here: w
ducts please vi
http://commun
m/
trollers peripheDAVE is a grapmany details th
ment can save aith MDK by itsselect. figured to yours and other com
and/or MDK. T
t this into µVismodify any DAion. Create, ad
TX simplifies y
/dave. ntents from insis/files/apnt_25
Copyright ©
www.keil
Examples
eil.com/mdk5/in
y directory, but
is tutorial. We
you will have to
on the web wh
rd, a USB cabl
ize and a few oa license remo
essors. Go to w
tions on configMDK. Page 5
ment uses DAV
are Packs. The page describes
www.keil.com
sit www.keil.c
nity.arm.com/g
erals the study phical configuhat you do neea great deal of tself or by using
r specificationsmponents of thThey become t
sion by double-AVE created fildd and modify
your developme
ide DAVE. N58.pdf
© 2014 ARM Ltd. All rig
l.com
:
nstall
t this lab uses t
e will use C:\M
o adjust for the
ere you got thi
le and MDK in
other limitationoves the limitat
www.keil.com/
guring the J-Lin5 contains a tesVE 3.1.10.
other examples where to insta
m/mdk5/.
com/infineon
groups/tools/co
of minute detauration programed to understantime and avoidg DAVE to cre
s. DAVE uses he Infineon prothe base to the
-clicking on thles: do this as nyour own sour
ent and provide
Note the content
ghts reserved
the default C:\K
MDK\ for the ex
e directory diffe
is document.
nstalled on you
ns. In this modtions.
/infineon/mdk/
nk are given. st for the J-Lin
es needed are fall these examp
ontent
ails such as m that avoids thd completely.
d many errors.eate the initial
them to createocessor. Thesesource files yo
he gpdsc file. Nnecessary withrce files and
es useful benef
t list on the left
Keil_v5
xamples.
ferences.
ur PC.
de, MDK is
/ to obtain
J-Link nk Lite
found with ples.
hese
e e ou
No hin
fits.
ft.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
4
6) µVision Software Packs Download and Install Process: 1) Start µVision and open Pack Installer:
1. Connect your computer to the internet. This is normally needed to download the Software Packs.
2. Start µVision by clicking on its desktop icon.
3. Open the Pack Installer by clicking on its icon: A Pack Installer Welcome screen will open. Read and close it.
4. This window opens up: Select the Devices tab: Under the Devices tab, Select Infineon XMC1100 as shown below: This will filter the list under the Packs tab.
5. Note “ONLINE” is displayed at the bottom right. If “OFFLINE” is displayed, connect to the Internet.
6. If there are no entries shown because you were not connected to the Internet when Pack Installer
opened, select Packs/Check for Updates or to refresh once you have connected to the Internet.
2) Install The XMC1000 Software Pack:
1. Select the Packs tab.
2. Initially, the Software Pack ARM::CMSIS is installed by default. These contain system headers and source files.
3. Select Infineon::XMC1000_DFP and click on Install. This Software Pack will download and install to C:\Keil_v5\ARM\Pack\Infineon\XMC1000\ by default. This download can take two to four minutes.
4. A Software Pack status is indicated by the “Up to date” icon:
TIP: If you click on the Boards tab, you can select the board you are using and only relevant Packs are displayed.
3) Install the UART Blinky MDK 5.11a Example:
1. Select the Boards tab. Select XMC 2Go (V1):
2. Select the Examples tab.
3. Select UART Blinky (XMC 2Go):
4. Select Copy as shown here:
5. This window opens up: Select Use Pack Folder Structure. Unselect Launch µVision as shown below
6. Type in C:\MDK. Click OK to copy the RTX_Blinky project.
7. UART Blinky will copy to C:\MDK\Boards\Infineon\XMC_2Go\. Pack Installer creates the rest of the directory tree after C:\MDK\.
TIP: The default directory for copied examples the first time you install MDK is C:\Users\<user>\Documents. For simplicity, we will use the default directory of C:\MDK\ in this tutorial. You can use any directory you prefer.
8. Close the Packs Installer. You can open it any time by clicking on its icon.
9. Select Yes when Reload Packs box is displayed. This updates the µVision Pack database
4) Install the RTX_Blinky5 and DSP5 examples from Keil.com:
1. Obtain the example software zip file from www.keil.com/appnotes/docs/apnt_260.asp.
2. Unzip this into the directory C:\MDK\Boards\Infineon\XMC_2Go\.
3. RTX_txt, RTX_Blinky5 and DSP5 folders will be created with the UART_Blinky folder as shown:
TIP: An Update icon means there is an updated Software Pack available for download.
TIP: If you look in the directory C:\Keil_v5\ARM\Pack\Infineon\XMC1000_DFP\1.0.2\Boards\Infineon\XMC_2Go, you will find another UART Blinky. This is the read-only version you downloaded for backup purposes. Use only the projects you copied over from the Examples tab to the directory you chose: in this tutorial we have used C:\MDK.
The next page has a few notes on Software Packs Maintenance plus how to test the J-Link debug connection:
In
S
7
Taw
8Tth
T TW
nfineon XMC110
Software 1. Softw
2. You c
3. The Pa
Pack b
4. To com
5. If an u
6. Examp
7. Pack f
7) Testing
1. Start µ
2. Select
3. Select
4. Select
5. Confir
6. Click displaymain m
7. A num
8. If nothnext st
9. If you driverthe Co
10. Close
TIP: To refresand then select window. The X
8) InstallThe DAVE 3.1he J-Link sepa
1. Unplu
2. To use
3. Plug in
4. Run th
5. If the i
TIP: MDK 5 a
They are also aWe recommen
00 Cortex-M0 Lab
Packs Maare Packs are d
an delete a Pac
ack is now rem
by clicking on
mpletely remov
updated Pack is
ple files, if pro
file is not avail
g the J-Li
µVision i
t Project/Open
t the Blinky pro
t Target Option
rm J-LINK / J-
on Settings: anyed, J-Link Litmenu.
mber in the SN:
hing or an errortep: 8) Install
see a proper ds are installed p
oreSight debug
this window an
sh the SW DevSW again. Yo
XMC1100 will
ling the J-.10 download
arately from DA
ug the 2Go boar
e the UART fe
n the 2Go boar
he test above ag
installer asks y
also contains J-
available here: nd you use the
b with XMC 2Go
intenancedownloaded an
ck by double-c
moved but the o
this icon:
ve it: right-clic
s available, the
ovided by a Pac
able on-line. I
nk Lite Co
if it is not alrea
Project.
oject C:\MDK\
ns or ALT
-TRACE Corte
nd the window te is working.
: box means µV
r is displayed iling the J-Link
display as showproperly and µ
g module in the
nd continue to
vice box, in the ou can also exil not work with
-Link Lite contains the coAVE. This is e
rd. Install the
ature make sur
rd and it will en
gain to confirm
you to replace t
-Link drivers h
Go to www2.k J-Link driver
board
e Notes: nd installed on
licking on it. A
original compre
ck on the Pack
e Update icon a
ck, can be copi
It might be loca
onnection
ady running. C
\Boards\Infineo
-F7 and select
ex is displayed
below opens uYou can conti
Vision is succe
in this SW DevUSB Drivers:
wn, your J-LinkµVision is conne Infineon proc
the next page.
Port: box seleit then re-enter h JTAG selecte
USB Driveorrect J-Link Ueasy to do. Th
software in the
re the J-Link-O
numerate norm
m everything is
the drivers in M
here: C:\Keil_v
keil.com/infiners that came w
5
your computer
A Remove icon
essed file you
name or Unpa
appears. You c
ied into a direc
ally downloade
:
Connect the 2G
on\XMC_2Go\
the Debug tab
as shown:
up: Select SW inue with this t
essfully connec
vice box, this m
k USB nected to essor.
.
ct JTAG this
ed, only SW. B
ers: (this iUSB driver softis file is Setup_
e usual fashion
OB with CDC i
mally.
s operating prop
MDK or µVisio
v5\ARM\Segg
eon/mdk/ and swith your vers
Copyright ©
www.keil
r with the Insta
n appears. Cli
downloaded is
ack icon and se
can download t
tory of your ch
ed on your com
Go board to you
\UART_Blinky
b:
in the Port: botutorial. Click
cted to the J-Li
must be correct
But, this is a us
is needed otware for the 2_JLinkARM_V
n using the sugg
is selected:
perly.
on, select or al
ger\USBDriver\
select: sion of DAVE
© 2014 ARM Ltd. All rig
l.com
all icon.
ck on this.
s still present.
elect Delete Pac
this update (or
hoice.
mputer.
ur PC with a U
ky\UART_Blin
ox. If an ICODon OK twice t
ink Lite adapte
ted before you
seful way to re
nly if the ab2Go board. YoV484f.exe for
gested defaults
low this.
\CDC for the B
. These should
ghts reserved
You can reinst
ck.
r not).
USB cable.
ky.uvprojx.
DE and Deviceto return to the
er.
can continue.
efresh the SW s
bove test faou must manualDAVE 3.1.10.
s.
Boot Kit board
d be V 4.84f fo
tall the
name is µVision
See the
setting.
ils) lly install .
d.
for 3.1.10.
In
P9Wth
T
T
N
N
1
Tthc
T
Tpw
nfineon XMC110
Part B: St9) UART_We will conneche on-board J-
1. Conne
2. Start µ
3. SelectC:\MD
4. Comp
5. Progra
6. Enter Note:
7. Click
8. Config115,20
TIP: If you get
The two LED
Now you know
Note: The boa
10) Hardw1. With B
source
2. A red
3. The ye
4. The cyClick indica
5. Note yprogra
6. The Xdoes nimportseries
7. If you Sometfor on
TIP: If you gethe relationship
compiler optim
This level is set
TIP: Enable Uprograms. If yowill not generat
00 Cortex-M0 Lab
tand-alon_Blinky Exct the Keil MDLink Lite. It is
ect your 2Go b
µVision by clic
t Project/Open DK\Boards\Infi
ile the source f
am the XMC F
Debug mode bµVision is con
on the RUN ic
gure a terminal00 baud, 8,1. F
t a 1295D warn
Ds on the 2G
w how to com
ard will start Bl
ware BreaBlinky runninge file EasyMain
circle is create
ellow arrow is
yan arrow is a mon a line in on
ated in the other
you can set andam is running w
XMC1100 has 4not execute the tant feature forCortex-M4 ha
set too many btimes µVision e of its interna
t multiple cyanp between the C
mization to Leve
t in Options fo
Use MicroLIB uour program iste any errors.
b with XMC 2Go
e Project xample PrDK developmen
s easy to config
oard to your co
cking on its des
Project. Openfineon\XMC_2
files by clickin
Flash by clickin
by clicking on tnfigured to pro
con. Note
l program suchFind the COM
ning, in EasyM
Go board w
mpile a progra
linky stand-alo
akpoints: g, click in the len.c in the main
ed and soon the
where the prog
mouse selectede window and r window.
d unset hardwawith ARM Cor
4 hardware breinstruction it i
r effective debus 6 hardware b
breakpoints, µVwill use one ofl operation suc
n arrows or havC source and asel 0 and rebuild
r Target u
under the Targs allowed to use
board
Examplesogram us
nt system usinggure µVision t
omputer with a
sktop icon.
n the MDK projGo\UART_Bli
ng on the Rebui
ng on the Load
the Debug iconogram the Flash
e: you stop the
h as PuTTY to port for J-Link
Main.c, near line
will now blin
am, load it in
one. Blinky is n
eft margin on a
n() function as s
e program will
gram counter i
d pointer and isthis place will
are breakpointsreSight™ techn
akpoints. A bris set to. This iugging. The X
breakpoints.
Vision will notf the available ch as single ste
ve trouble undessembly, try loding your proj
under the C/C+
get tab to createe MicroLIB, th
6
s: ing the XM
g the XMC evato use any othe
a USB cable.
ject file that yoinky\UART_B
ild icon. .
icon: Pro
n. Select Oh when enterin
e program with
the appropriatek CDC UART
e 47, you can c
nk.
to the XMC p
now permanen
a darker gray bshown below:
stop at this po
s pointing to in
s associated wibe
while the nology.
reakpoint is a very
XMC4000
tify you. breakpoints pping.
erstanding owering the ect.
++ tab.
e smaller he compiler
Copyright ©
www.keil
MC 2Go baluation board.er supported ad
ou copied on pBlinky.uvprojx.
You can also
ogress will be i
OK if the Evalung Debug mode
h the STOP ico
e virtual COMPort in the Wi
change void UA
rocessor Flas
ntly programme
block somewhe
oint.
n both the disa
ith the yellow b
© 2014 ARM Ltd. All rig
l.com
oard: This project i
dapter.
page 4: .
use the Build i
indicated in the
uation Mode be. You do not
on.
M port and messindows Device
ART_Init(); to
sh, run it and
ed in the Flash
ere appropriate
assembly and so
band in the dis
ghts reserved
is pre-configur
icon beside it.
e Output Wind
box appears. have to use Lo
sages will be de Manager.
o void UART_I
stop it.
h until reprogra
e after line 180
ource windows
sassembly wind
red to use
dow.
oad.
isplayed.
Init(void);
ammed.
in the
s.
dow.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
7
11) Call Stack + Locals Window: Local Variables: The Call Stack and Local windows are incorporated into one integrated window. Whenever the program is stopped, the Call Stack + Locals window will display call stack contents as well as any local variables belonging to the active function. If possible, the values of the local variables will be displayed and if not, the message <not in scope> will be displayed.
1. Open the Call Stack + Locals window by clicking on its tab.
2. Shown is the Locals window for the main function with the hardware breakpoint active from the previous page.
3. The contents of the local variables are displayed.
4. This display results when the breakpoint is set on the line if (ticks_uart == TICKS_UART_EVENT).
5. With the breakpoint set as in the previous page, each time you click on RUN, these locals will update as appropriate.
TIP: The contents of the local variables are displayed as well as names of active functions. Each function name will be displayed as it is called from the function before it or from an interrupt or exception. Exactly which local variable that will be visible or not depends on precisely where you stop the program.
When a function exits, it is removed from the list.
The most recent called function is at the top of this table.
This table is active only when the program is stopped.
6. Click on the Step In icon or F11:
7. Variables will update as appropriate. You will probably exit SysTick_Handler quickly in a few steps.
8. If not in the SysTick_Handler, click on RUN to get back in it. Your breakpoint will stop in it.
9. Click on the StepOut icon (Ctrl-F11) to exit the SysTick_Handler function to return to main().
10. Remove any breakpoints when you are done. You can click on them individually or Ctrl-B and select Kill All.
TIP: You can modify a variable value in the Call Stack & Locals window when the program is stopped.
Call Stack: The list of called functions is displayed when the program is stopped. This is very useful for debugging when you need to know which functions have been called and are stored on the stack.
11. Right click on a function name and try the Show Callee Code and Show Caller Code options as shown here: The appropriate code will be shown in the source and/or disassembly windows.
TIP: Use the Symbol window to locate and view components of your program including variables, structures and arrays. Select View/Symbol Window while in Debug mode.
TIP: For help finding Fault Exceptions see: www.keil.com/appnotes/docs/apnt_209.asp
In
1
WA
TWm
To
M
TS
Ty
TP
nfineon XMC110
12) WatcThe WatchCoreSight into the Memanually.
Watch windoAdd a global v
1. Stop th
2. Declar
3. Add th
4. Select
5. Click
6. Enter runnin
7. Select
8. In Blinopen.
9. count
TIP: You can Watch or Memmanually by do
TIP: To Drag ‘opens, move yo
Memory win1. Right
2. Note taddres
3. Add an
4. Right
5. The da
6. Both t
7. Right-select variab
TIP: No CPU Structures can a
TIP: To viewyou select a var
These Read andPort (DAP), wh
00 Cortex-M0 Lab
h and Memh and Memory debugging techemory windowYou can also
ow: variable: Call
he processor
re a global vari
unsigned
he statements n
counter+
if (count
t File/Save All.
on Rebuild
Debug mode. ng or not. You
t View and sele
nky.c, right cli counter will
ter will update
also block a vamory windows. ouble-clicking
‘n Drop into a our mouse into
ndow: click on count
the value of coss a pointer is p
n ampersand “
click in the me
ata contents of
the Watch and
-click with the Modify Memo
ble on-the-fly w
cycles are usedalso be display
w variables and riable from the
d Write accesshich provides o
b with XMC 2Go
mory Winwindows will hnology that is
w in real-time. right click on a
Stack, Watch
and exit Deb
iable is the usu
d int counter =
near line 185 ju
++;
ter > 0xF) cou
.
and program
Click on Ru can also do th
ect Periodic W
ck on counterl be displayed a
e in real time.
ariable name dYou can also
<Enter express
tab that is not ao the appropriat
ter and select
ounter is disppointing to: but
“&” in front of
emory window
f counter is di
Memory wind
mouse cursor ory. You can cwhile the progra
d to perform thyed and expand
their location ue Symbols wind
es are handled on-the-fly mem
board
ndows anddisplay updates a component It is possible t
a variable and
and Memory w
bug mode.
ual manner (I c
= 0;
ust after ticks_l
unter = 0;
m the Flash wit
RUN . Nothis with a Mem
indow Update
r and select Adas shown here:
drag and drop itenter a variablsion> or press
active, pick upte window and
t Add counter t
playing its addrt this not what
the variable na
w and select Un
isplayed as sho
dows are update
over the desirechange a memoam is still runn
hese operationsded.
use the Symbodow, it will be
by the Serial Wmory accesses.
8
d how to ued variable valuof Cortex-M p
to “drag and drselect Add var
windows can’t
alled it counte
led =0;
th Load .
te: You can comory window.
if necessary:
dd counter to …:
t into e F2 and use cop
p the variable and release the va
to … and selec
ress in Memorywe want to see
ame and press
nsigned/Int.
own here:
ed in real-time
ed data field anory location or ning.
s. You can hav
ol window. Selentered fully q
Wire Debug (SThe next page
Copyright ©
www.keil
use them:ues in real-timeprocessors. It irop” variable nrname to.. and
see local varia
ter) near line 3
onfigure a Wat
… and select W
py and paste or
and hold it overariable.
ct the Memory
y 1 as if it is a e at this time.
Enter. The ph
.
nd
ve more than o
lect View/Symqualified into a
SWD) connectie describes how
© 2014 ARM Ltd. All rig
l.com
e. It does this is also possible
names into windselect the appr
ables unless sto
33 in EasyMai
tch window wh
Watch 1. Watc
r typing the var
r the tab you w
1 window.
pointer. This
hysical address
one variable dis
mbol Window wa Memory or W
ion via the Corw this works.
ghts reserved
using the ARMe to “put” or indows or enter tropriate window
opped in their f
in.c:
hile the progra
ch 1 will autom
riable name.
want to open; w
is useful to see
is (0x2000_01
splayed.
while in DebugWatch window.
reSight Debug
M nsert values them w.
function.
am is
matically
when it
e what
180).
g mode. If .
Access
In
1
HA
T
TsVf\\li
T
Ts
u
Hµavw
nfineon XMC110
13) How 1. With t
2. There
3. Enter
4. Note i
5. Stop thThis is
6. Start tSet a b
7. The prdisplay
8. µVisioSysTic
9. Remo
How to viewAll you need to
1. In the
TIP: You can a
2. Comp
3. To pro
4. Note i
5. Set a b
6. Remo
TIP: You musstopping the prView/Symbols fully qualifies t\UART_Blinkyine directly int
7. You c
8. Stop th
TIP: View/Per
TIP: To progrselect the “Upd
using the LOAD
How It WoµVision uses Aalways non-intrvalues without writes to the sa
00 Cortex-M0 Lab
to view Lothe program sti
is a local (auto
i into Watch 1
it says <cannot
he program s because it is o
he program. breakpoint near
rogram will stoyed is if the pr
on is unable to ck_Handler is
ove the breakp
w local variao do is to make
declaration for 17
also make a va
ile the source f
ogram the Flash
i is still not upd
breakpoint in th
ove the breakp
st fully qualify ogram while itwindow and c
the variable. Iny\EasyMain.c\to the Watch or
an also enter a
he CPU fo
riodic Window
am the Flash adate Target befo
D icon. Pr
orks: ARM CoreSighrusive. While stealing any Cme memory lo
b with XMC 2Go
ocal Variaill running:
omatic) variabl
1 window by ri
t evaluate> or “
and the valueout of scope.
r line 193: US
op and a value rogram happen
determine the running. It dis
point and make
bles updatee i static where
r i, add the st7 static
ariable global o
files by clickin
h, click on the
dated in real-ti
he function Sy
point. Click on
a variable in ot is in scope. Tcopy the variabn this case, i fu\SysTick_Handr Memory win
a variable into a
or the next step
w Update must
automatically wfore Debugging
rogramming th
ht technology tothe CPU is fetc
CPU cycles. Thocation at exact
board
ables in th
le i declared n
ght clicking on
“not in scope”.
e of i will still
SIC0_CH0->IN
for i will nows to stop while
value of i whesappears in fun
e sure the progr
ed in real-time it is declared
tatic keyworuint8_t i;
or have it as par
ng on the Rebui
Load icon.
ime. You must
sTick_Handler
n RUN and i w
order for it to upTo do this, you ble from there. ully qualified idler\i. You alsdows.
a Memory win
p. Select File/S
be selected. O
when you enterg” box. This is
he Flash will be
o read or write ching instructihis can be slightly the same tim
9
he Watch o
ear line 177 in
n it and selectin
not display.
N[0] = …
w be displayed. e it is in scope.
en the programnctions and han
ram is not runn
me: in Easy_Main.
rd like this:
rt of a structure
ild icon .
. Enter Debu
t first show i t
r. The program
will now update
pdate without can open the This automatis o can enter thi
dow. Rememb
Save All.
Otherwise varia
r Debug mode s set by default
e automatically
memory locatons at full spee
htly intrusive inme. Then, the
Copyright ©
www.keil
or Memor
n Easy_Main.c:
ng Add i to.... W
The only time
m is running becndlers outside o
ning . Exit
.c !
e so it will upd
Select File/Sav
ug mode. C
to µVision by s
m will stop and
e.
initially
ically
s text
ber to prefix it
ables update on
select Target Ot in the two Bli
y done when yo
tions without sted, the CoreSign the unlikely eCPU will be st
© 2014 ARM Ltd. All rig
l.com
ry window
: uint8_t i;
Watch 1.
e a local variab
cause it exists oof this.
Debug mode.
date in real-tim
ve All or .
Click on RUN
stopping when
d a value for i w
with an &.
nly when the pr
Options , seinky projects.
ou enter Debug
tealing any CPght debug modevent the CPUtalled to allow
ghts reserved
ws:
ble value will b
only when the
me.
.
it is in scope.
will now be di
rogram is stopp
elect the UtilitiThis means yo
g mode. .
PU cycles. Thidule can read o
U and µVision rthis access to
be
function
isplayed.
ped.
ies tab and ou can skip
s is nearly r write
reads or occur.
In
1Tvath
G
Tdw
Sti
S
Tptip
Ypinf
nfineon XMC110
14) SysteThe System Viviews are updatare two ways tohe Core Periph
1. Click
GPIO Port 1:
2. Select
3. This w
4. You c
TIP: If you clidescription abowindow.
SysTick Timerimer to determ
Select Peripher
1. The PP
2. Note ttechno
3. Expanthe Sy
4. Note tprograyou ca
5. In the
6. The bl
7. Replac
8. You c
9. When
TIP: It is true:program is runniming value ch
program, run cy
You must makeproperly react tndiscriminately
find problems.
00 Cortex-M0 Lab
em Viewerewer provides ted in real-timeo access these Vherals are also
on RUN. You
t Peripherals/Sy
window opens u
an now see P0
ick on a registeout this register
r: This programine the period
rals/System Vie
PB window sh
this window upology as the W
nd the SYST_RysTick_Config(
that it is set to 0ammed into Syan change how
RELOAD reg
linking LEDs w
ce RELOAD w
an look at othe
you are done,
you can modining. This is vhanges instead ycle.
e sure a given pto such a changy is a good wa
b with XMC 2Go
r (SV): the ability to ve while your prViews: a) Vieavailable: Not
u can open SV w
ystem Viewer
up. Expand OU
and P1 update
er in the properr will appear at
am uses the Corof the LEDs.
ewer and then
hown below op
pdates in real-tiWatch and Mem
RVR register. T(SystemCoreC
0xC34FF (dec ysTick_Config(
w often the SysT
ister in the Sys
will speed up.
with 0xC34FF.
er Peripherals c
stop the progr
ify values in thvery useful for of the usual m
peripheral regige. Changing say to cause seri
board
view and modifrogram is runn
ew/System Viewte the various p
windows when
and then PORT
UT:
e:
rties column, at the bottom of
rtex-M0 SysTi
select PPB.
ens:
ime while yourmory windows.
This is the relolock / TICKS_
799,999). Thi() in main() in Tick timer crea
sTick window,
This will conv
A CPU RESE
contained in th
am and clo
e SV while themaking slight
modify, compile
ister allows andsuch values ous and difficu
10
fy registers in tning. These Viwer and b) Perperipherals ava
n your program
TS and select P
a f the
ick
r program runs
oad register val_PER_SECON
is results from EasyMain.c. C
ates its interrup
while the prog
vince you of th
ET will als
e System View
ose all the Syst
e
e,
d will
ult to
Copyright ©
www.keil
the CPU core aiews are availaripherals/Systeailable:
m is running.
PORT1.
s. These windo
lue. This is setND); line in ma
the hex value Changing the vpt 15.
gram is runnin
he power of AR
so do this. The
w windows.
tem Viewer wi
© 2014 ARM Ltd. All rig
l.com
and in peripherable only whileem Viewer. In
ows use the sam
t during the Syin().
of (8,000,000/variable passed
ng, type in 0x50
RM CoreSight
e program will
indows that are
ghts reserved
rals. In most ce in Debug mod
the Peripheral
me CoreSight D
ysTick configur
/10)-1 that is d to this functio
0000 and press
debugging.
l restart and run
e open.
cases, these de. There ls menu,
DAP
ration by
on is how
s Enter !
n.
In
1TWW
Tc
YwL
Twb
TBdnYK
Ttw
TA
nfineon XMC110
15) AccesThe XMC1100Watchpoints arWatchpoint is h
1. Use th
2. We wi
3. Select
4. Select
5. In the
TIP: An Accecounter) is not
You can use <, works with anyLite. This featu
6. Click
7. Click
8. Enter
9. Set co
10. Click
11. When shown
12. Click
13. countturnedis becacount
14. Stop th
15. SelectKill A
16. Exit D
TIP: You cannwhile the progrbreakpoints.
TIP: To edit anBreakpoints widown into the cnow. Clicking You should delKill Selected or
TIP: The checkemporarily uns
without deletin
TIP: Raw addrAn example is:
00 Cortex-M0 Lab
ss Breakp0 Cortex-M0 prre referred to ashit, µVision mu
he same Blinky
ill use the glob
t Debug in the m
t Access to Rea
Expression bo
ss Breakpoint intrusive. It is
> and ==. Cuy Keil ULINK. ure will be add
on Define or p
on Close.
the variable co
ounter to zero in
on RUN. .
the program dn below: count
on RUN and th
ter might not ud off in µVisionause µVision mter. Minimize
he CPU if it is
t Debug/BreakpAll and then sele
Debug mode.
not configure Aram is running
n Access Breakindow and its inconfiguration aon Define will
lete the old oner try the next T
kbox beside thselect or disablg it.
resses can be u *((unsigned l
b with XMC 2Go
points: Conrocessor has tws Access Breakust test the mem
y configuration
bal variable cou
main µVision w
ad. (or write or
ox enter: “coun
that does not us the test that is
urrently, in MD It does not wo
ded in the next
press Enter and
ounter in Wat
n the Watch w
.
detects a read ater will equal 6
he program wil
update in the Wn for speed conmust test the coe this by select
running.
points (or Ctrl-ect Close.
Access Breakpolike you can w
kpoint: double-nformation wil
area. Make youl create anothee by highlightinTIP:
e expression alle an Access B
sed with a Acclong *)0x20000
board
nditional Brwo Watchpointsks in Keil documory location.
n as the previou
unter you cre
window and th
r both if you pr
nter > 0x5”
use a data values intrusive.
DK 5.10, counteork with the J-version of MD
d the expression
tch 1 if it is no
indow. This p
ccess of > 0x56.
ll run to the ne
Watch windownsiderations duondition by moting only Read
-B) and delete
oints on-the-flywith hardware
-click on it in tll be dropped ur modificationr Watchpoint. ng it and click
llows you to Breakpoint
cess Breakpoin0004)
11
reakpoints s. Watchpoint
uments. Cortex Cortex-M3/M
us page. Stop t
eated in Blinky
hen select Brea
refer)
” without the qu
e (i.e.
er == 0x5 Link
DK.
n will be move
t already there
uts counter to
to counter a
ext read and/or
w depending on uring the test. Yomentarily stop
or Write Acce
the Watchpoin
y
the
ns on
nt.
Copyright ©
www.keil
ts can be thougx-M0 WatchpoM4 Watchpoint
the program if
y.c to explore W
akpoints or pres
uotes. This wi
ed into the Curr
e.
less than 0x5 w
as you selected
write to count
n how fast the vYou will also n
pping the progress and not both
nt with
© 2014 ARM Ltd. All rig
l.com
ght of as conditoints are slightlts are not intru
necessary.
Watchpoints.
ss Ctrl-B.
indow will disp
rent Breakpoin
which is the tes
d, the program w
ter. It will skip
variable is channotice the program when the wh.
ghts reserved
tional breakpoily intrusive. Wsive for the equ
Stay in debu
play:
nts box as show
st value.
will stop. See
p values 0 throu
nged. This featgram slows dowwrite or read oc
ints. When the
uality test.
ug mode.
wn below:
Watch 1
ugh 5.
ture is wn. This ccurs to
In
1KavR
T
Gim
nfineon XMC110
16) RTX_Keil provides Rand no royalty pversions. See wRTX. Keil wil
1. Start µexamp
2. Exit D
3. Select
4. Comp
5. To pro
6. Enter
7. The L
8. Click
The Configu1. In the
2. Click
3. Click
4. Open u
5. See ho
6. This is
7. You c
8. This sSee w
Getting Stmplementing a
00 Cortex-M0 Lab
_Blinky ExRTX, a full featpayments are rwww.arm.com/l work with an
µVision by clicple previously.
Debug mode if
t Project/Open
ile the source f
ogram the Flash
Debug mode b
EDs will blink
on STOP .
ration WizaProject window
on the RTX_C
on Configurati
up the individu
ow easy it is to
s a great featur
an create Conf
cripting languaww.keil.com/s
tarted MDand managing R
Text Editor
b with XMC 2Go
xample Proture RTOS. Rrequired. RTX/cmsis and C:\K
ny RTOS. A re
cking on its ico Instructions a
necessary.
Project and op
files by clickin
h manually, cli
by clicking on t
k indicating the
rd for RTX: w, double click
Conf_CM.c sou
ion Wizard at t
ual directories
modify these
re as it is much
figuration Wiza
age is shown bsupport/docs/27
K 5: ObtainRTX.
: Source Code
board
ogram witRTX is includedX has a BSD typ
Keil_v5\ARMeal-time awaren
on if not alreadyare provided on
pen C:\MDK\B
ng on the Rebui
ick on the Loa
the debug icon
e two of four w
k on RTX_Con
urce file tab as
the bottom and
to show the va
settings here a
h easier changin
ards in any sou
elow in the Te735.htm for ins
n this book here
e
12
th Keil RTd as part of the pe license. RT\Pack\ARM\Cness viewer for
y running. n the bottom of
Boards\Infineo
ild icon.
d icon. . A
n and click
waveforms of a
nf_CM.c to op
shown below o
d your view wil
arious configur
s opposed to fi
ng items here t
urce file with th
ext Editor as costructions to ad
e: www.keil.co
Copyright ©
www.keil
TX RTOS: Keil MDK too
TX with sourceCMSIS\4.1.0\CM
r RTX is provi
You must hf page 4.
on\XMC_2Go\
. They will co
A progress bar w
k on the RUN ic
stepper motor
en it in a Sourc
on the left belo
ll change to the
ration items ava
inding and cha
than in the sour
he scripting lan
omments startindd this feature
om/mdk5/. It h
Config
© 2014 ARM Ltd. All rig
l.com
A Stepperol suite. It cane code is providMSIS_RTX. Tided with µVis
have installed t
\RTX_Blinky5
ompile with no
will be at the b
con.
driver. (board
ce window or w
ow if it is not in
e Configuratio
ailable.
anging entries i
rce code.
nguage as used
ng such as a </to your own so
has very useful
guration Wiza
ghts reserved
r Motor exan have up to 25ded with all MThis example esion.
the RTX_Blink
5\Blinky.uvproj
errors or warn
bottom left.
d has only two
with File/Open
n focus.
n Wizard.
in the source co
d in the Text Ed
/h> or <i>. ource code.
l information o
ard
ample 5 tasks
MDK explores
ky5
jx.
nings.
LEDs)
n.
ode.
ditor.
on
In
1Uuc
D
B
MIRinTT
nfineon XMC110
17) RTX KUsers often wanusually stored icompanies also
1. Run R
2. Open grab thread w
3. Select
1. You wNo insos_idl
2. µVisiodoes nVieweCoreSwindoM4 doVieweother S
Demonstrating
Blinky.c contai
1. The gr
2. Set a bshown
3. Set a b
4. Click
5. When be updTask tthe pro
6. Click
7. Remov
More InformIt is very benefRTX source, vandex.html is th
There are two vThis second on
00 Cortex-M0 Lab
Kernel Awnt to know the in a structure oo provide aware
RTX_Blinky by
Debug/OS Suphe window and
write technolog
t View and sele
will not have tostrumentation ce_demon. The
on also has an not have the Seer (SWV) compSight that is neeow. The XMC4oes have SWV er can be displaSerial Wire Vi
g States: (not
ins four threads
ray areas oppo
breakpoint on on: (but not on t
breakpoint in o
on RUN .
the program stdated in the RTthat is running ogram stopped
on RUN .
ve the breakpo
mation of obficial to use an arious ports anhe entry point iversions of RTne is CMSIS-RT
b with XMC 2Go
wareness: number of the
or memory areaeness plug-ins
y clicking on th
pport and selecd move it into tgy as used in th
ect Periodic W
o stop the progrcode needs to be processor spe
Event Viewer erial Wire ponent of eded for this 4000 Cortex-
and the Event ayed as well asewer features.
e: Tasks and T
s that blink the
site the line nu
one of these in the for (;;;) line
one or two othe
tops, this inforTX Tasks windwhen the prog
d and phaseA is
The other thre
oints and close
taining andRTOS. RTX id documentatiointo the documX: The first coTOS complian
board
e current operata by the RTOSfor µVision.
he Run icon.
ct System and Tthe center of th
he Watch and M
indow Update
ram to view thibe inserted intoends relatively
which displays
s
Threads are use
e LEDs. Threa
umbers indicate
Thread 1 as e)
er threads.
rmation will dow. The gram stopped ws in the run stat
ead will show a
the RTX Task
using RTX:is a good choicon are here: C
mentation. omes with MD
nt and this is the
13
ting task and th. Keil provide
Thread Viewerhe screen. TheMemory windo
if these values
is data. No CPo your source. little time in e
s RTX threads
ed interchangea
ad 1 (phaseA) i
e there is valid
will be indicatedte. The states o
as “Running”.
ks window. Ex
ce. It is small,
C:\Keil_v5\ARM
DK 4.7x and eare one you wan
Copyright ©
www.keil
he status of it aes a Task Awar
r. The windowese values are uows.
s do not change
PU cycles are u Most of the tim
each task. You
in a graphical
ably in Keil M
is shown below
assembly code
d with a “Runnof the other tas
Each time you
xit Debug mode
efficient and eM\Pack\ARM\
arlier. The secont to use.
© 2014 ARM Ltd. All rig
l.com
and the other tare window for R
w below opens updated in real-
e:
used. Your prome the CPU is
u can change th
format. The X
DK documenta
w:
e located here.
ning” state. Thsks are display
u click RUN, th
e.
easy to use yet \CMSIS\4.1.0\
ond comes with
ghts reserved
asks. This infoRTX. Other R
up. You migh-time using the
ogram runs at fs executing the his to suit your
XMC1000 Cor
ation)
he window aboyed as well.
he next thread
it is full featurCMSIS_RTX.
h MDK 5.10 a
ormation is RTOS
ht have to e same
full speed.
needs.
rtex-M0
ove shows
will run.
red.
and later.
In
1AMta
T
Tac
Tli
TC
S
TmS
Iw
S
nfineon XMC110
18) DSP SARM CMSIS-DMDK in C:\Keab: C:\Keil_v5
The appropriate
This example cadded, and thencontain each ta
This example inicense. Source
To obtain this eC:\MDK\Board
1. Stop th
2. Select
3. Build
4. Progra
5. Enter
6. Click
7. Open
8. Four gIf thesproper
9. Each o
Serial Wire Vi
The Infineon Xmentioned abovSWV so this sc
If you use an Inwindows plus m
See www.keil.c
00 Cortex-M0 Lab
SINE examDSP libraries ail_v5\ARM\Pa5\ARM\Pack\A
e DSP library i
creates a sine wn the noise is fisk.
ncorporates Kee code is provi
example file, gds\Infineon\XM
he program an
t Project/OpenP
the files.
am the 2Go Fla
Debug mode b
on the RUN ic
Watch 1 by sel
global variablese variables arerly.
of these variab
iewer (SWV) a
XMC4000 Cortve will be dispcreen is shown
nfineon XMC4many other Ser
com/appnotes/d
b with XMC 2Go
mple usinare offered for ack\ARM\CMSARM\CMSIS\4
is selected in th
wave to which ailtered out leav
eil RTX RTOSded.
o to www.keilMC_2Go. A \D
d exit Debug m
Project and ope
There will be
ash by clicking
by clicking on t
con.
lecting View/W
s will be displae changing the
les represent th
and ETM Inst
ex-M4 processlayed in the Lofor reference o
4000 Cortex-Mrial Wire View
docs/apnt_231
board
g ARM CMCortex-M0, Co
SIS\4.1.0\CMS4.1.0\CMSIS \i
he RTE window
another sine waving the origina
S. RTX is avai
l.com/appnoteDSP5 directory
mode if necessa
en the project f
e no errors or w
g on the Load i
the Debug icon
Watch/Watch 1
ayed in Watch program is mo
he value of one
truction Trace
sors have Seriaogic Analyzer only to give yo
M4 and with anywer (SWV) feat
.asp. This doc
14
MSIS-DSP ortex-M3 and C
SIS\DSP_Lib. index.html
w:
ave (to represeal sine wave. F
lable free with
es/docs/apnt_2will be created
ary.
file: C:\MDK\
warnings.
con: Progr
n. Select O
1 if necessary.
1 as shown heost likely worki
e of four wavef
e: (only for ref
al Wire Vieweras shown below
ou an idea on w
y Keil ULINK tures. Infineon
cument shows h
Copyright ©
www.keil
LibrariesCortex-M4 proDocumentatio
ent noise) is Four threads
h a BSD type
260.asp and cod. You probab
\Boards\Infineo
ress will be ind
OK if the Evalu
ere: ing
forms created b
ference)
r (SWV). The w. The Infineo
what is happeni
or a J-Link, yon Cortex-M4 pr
how SWV and
© 2014 ARM Ltd. All rig
l.com
: ocessors. DSPon can be acces
opy the MDK 5bly have alread
on\XMC_2Go\
dicated in the O
uation Mode b
by the DSP pro
four waveformon XMC1000 ing in this exam
ou can use thisrocessors also h
d ETM trace wo
ghts reserved
libraries are pssed here: Selec
5 version into dy done this on
\DSP5\sine.uvp
Output Window
box appears.
ogram.
ms of the globaseries does notmple.
s Logic Analyzhave ETM trac
orks on the XM
provided in ct the DSP
page 4.
projx.
w.
al variables t have
zer ce.
MC4000.
In
R
T
Tf
T
Taa
nfineon XMC110
RTX Tasks a
3. Click
4. Open
5. This wThe pr
6. Set a b
H
1)
7. The prnoise_
8. The os
TIP: os_idle_d
9. Set an
10. Each tstate.
TIP: Remembfor run to main
TIP: Recall th
TIP: You migand this featureadapter.
00 Cortex-M0 Lab
nd System:
on the RUN ic
Debug/OS Sup
window updaterocessor spend
breakpoint in o
Here are the fou
) sine_gen (88
rogram will sto_gen thread: Y
s_idle_demon
demon has a Pr
nother breakpoi
time you click
ber you have on() and single-s
his window use
ght have noticee is available on
b with XMC 2Go
con if the progr
pport and selec
s in real-time. ds relatively litt
one of the threa
ur threads with
8) 2) noise_ge
op here and theYou can see tha
is Ready to run
riority of 0 wh
int in a differen
on RUN, the p
nly 4 hardwaretepping. If you
es the CoreSigh
ed the Event Vin the Infineon
board
ram is not runn
ct System and T
Note nearly altle time in each
ads in DirtyFilt
their approxim
en (106) 3) d
e Task windowat noise_gen wa
n when noise_g
hich is the lowe
nt task. Click o
program will st
e breakpoints anu select too ma
ht DAP read an
iewer in DebugXMC4000 Co
15
ning.
Thread Viewer
ll the processoh thread. You
ter.c by clickin
mate starting lin
disturb_gen (12
w will be updateas running whe
gen is finished
est priority poss
on the RUN ic
top at one of th
nd sometimes any breakpoint
nd write techno
g/OS Support. rtex-M4 proce
Copyright ©
www.keil
r. A window s
or time is spent can change thi
ng in the left m
ne numbers:
26) 4) filter_t
ed accordinglyen the breakpo
d. No other task
sible. Every o
on.
he two tasks an
µVision mightts, µVision wil
ology to updat
This uses Seressors with any
© 2014 ARM Ltd. All rig
l.com
similar to below
t in the idle daeis if you need t
argin on a grey
tsk (146) 5) sy
y. Here, I set a oint was activat
k is Ready.
other task has a
nd this is indica
t commandeer ll notify you.
te this window
rial Wire Viewy Keil ULINK
ghts reserved
w opens up.
emon os_idle_dto.
y area.
ync_tsk (166)
breakpoint in ted.
a higher priority
ated by the Run
one for its use
in real-time.
er to get its infor Segger J-Lin
demon.
the
y.
nning
e, usually
formation nk debug
In
C
Tw
TT
T
nfineon XMC110
Call Stack an1. Click
windo
2. Each tprograupdate
3. Right Callerthere:
4. Stop th
5. Remov
6. Exit D
TIP: Recall thwere set on the
This is the eThe next sectio
The section afte
00 Cortex-M0 Lab
nd Locals: on the Call Sta
ow opens up:
time you click am stops on a bed depending o
click on an eler Code to go
he program.
ve all breakpoi
Debug mode.
he Call Stack aprevious page
end of the ston describes ho
er that describe
b with XMC 2Go
ack + Locals ta
on RUN abreakpoint, thison which thread
ement and selec
ints.
and Locals wine.
tand-alone eow to create pro
es how to use I
board
ab. This
and the s information id is running.
ct Callee or
ndow updates o
examples. ojects from scr
Infineon DAVE
16
s
only when the p
ratch using MD
E to create proj
Copyright ©
www.keil
program is stop
DK 5.10.
ojects that you c
© 2014 ARM Ltd. All rig
l.com
pped by one of
can easily imp
ghts reserved
f the two break
ort into µVisio
kpoints that
on.
In
1Ayyfs
I
C
S
T
S
W
YMa
nfineon XMC110
19) CreatAll examples pyour own projeyou have the nefunction so it dsource code and
Install the Infi
1. Start µ
2. Pack I
3. You d
Create a new D
1. Click
2. In the folder
3. Right create
4. Doublit and
5. In the
6. This c
7. As soo
Select the Devi
1. ExpanXMC1
TIP: Processo
2. Click
Select the CM
1. ExpanThey w
2. Click
3. The pr
4. You nautom
5. Note t
6. Click
What has happ
You have creatMDK 5 Softwaadd your own s
00 Cortex-M0 Lab
ting your orovided by Ke
ects. However,ew project conoes not do mucd/or files. You
ineon Softwar
µVision and lea
Installer: The
do not need to c
Directory and
on Project/New
window that oC:\MDK\Boar
click in this wia new folder.
le click on Blinselect Open.
File name: box
creates Blinky.u
on as you click
ice you are us
nd Infineon and1100-Q024x00
r icons in green
OK and the M
SIS componen
nd all the itemswill be highligh
on File/Save A
roject Blinky.u
now have a newmatically entere
the Target Sele
once on it and
pened to this p
ted a blank µViare Packs. All source files.
b with XMC 2Go
own MDKil are pre-confi, we will start afigured; you cach. However, u can use this p
re Pack for you
ave in Edit mo
e XMC1000 pr
copy any exam
d a New Projec
w µVision Proj
opens, shown hrds\Infineon\X
indow and seleI called it Blin
nkyNew to ope
x enter Blinky.
uvproj in C:\M
k on Save, the n
sing:
d then XMC10064 as shown h
n are from the
anage Run Tim
nts you want:
and select CMhted in Green i
All or select the
uvproj will now
w project list asd and configur
ector says Targ
change its nam
point:
ision project uyou need to do
board
K 5 projectfigured. All yoan example proan build, load athe processor s
process to creat
ur processor:
de. Do not be
rocessor series
mples over.
ct:
ject…
here, go to the XMC_2Go\
ect New and nkyNEW.
en it or highligh
. Click on Sav
MDK\Boards\In
next window o
00 Series, thenhere:
Software Pack
me window sho
MSIS/CORE anindicating ther
e Save All icon
w be copied to B
s shown on thered for the proc
get 1. Highligh
me to 2Go Flas
sing o now is
TIP:USB
17
t from scrou have to do isoject from the band run a bare startup sequencte any new pro
in Debug mod
Pack must be
ht
ve.
nfineon\XMC_2
pens:
n expand XMC
ks. Grey icons
own below bot
nd Device/Startre are no other
n:
Blinky.uvprojx
bottom left: Tcessor you cho
ht Target 1 in th
sh and press En
Other componare part of Kei
Copyright ©
www.keil
ratch: (wits compile thembeginning to ilBlinky exampces are present
oject, including
de.
installed. This
_2Go\BlinkyNE
C1100 and then
s are from MDK
ttom right open
tup as shown bfiles needed. C
x.
The appropriatese. There are n
he Project wind
nter. The Targ
nents such as Fil Middleware
© 2014 ARM Ltd. All rig
l.com
thout DAVm. You can usellustrate how e
ple. It will havet and you can eg one using RT
s has already b
EW.
n select
K 4.7x.
ns.
below. Click OK.
e CMSIS files no user source
dow.
get selector nam
File System, Gin MDKpro. C
ghts reserved
VE) e them as a temasy this procese an empty maeasily add your
TX.
been done on pa
you selected he files yet.
me will also ch
Graphics, NetwoConsult Keil te
mplate for ss is. Once ain() r own
age 4.
have been
hange.
ork and ech support.
In
C
A
T
C
T
nfineon XMC110
Create a blank
1. Right
2. This w
3. Highli
4. In the
5. Click
6. Click
7. Expanand Bl
8. It will
Add Some Cod
1. In the
2. Click
3. Build
TIP: You coul
Configure the
1. Select
2. Enter
3. Select
4. Select
5. In the
6. Doubl
7. Click
8. Click
9. Plug y
10. Selectyour P
11. Click
12. Click one fo
13. Click
14. Click
15. Build
The Next Step
00 Cortex-M0 Lab
k C Source Fil
click on Sourc
window opens u
ight the upper l
Name: field, e
on Add to clos
on File/Save A
nd Source Groulinky.c will no
also open in th
de to Blinky.c
blank Blinky.c
on File/Save A
the files.
ld also add exi
Target 2Go F
t the Target Op
32 in Xtal (MH
t Use MicroLIB
t the Output ta
Browse for Fo
le click on Flas
on the Listing
on the Debug
your 2Go board
t SW as shown PC, you must s
on OK once to
on the Utilitiesor the Infineon
on OK twice to
on File/Save A
the files.
? Let us run
b with XMC 2Go
le:
ce Group 1 in th
up:
left icon: C fil
enter Blinky.
se this window
All or
up 1 in the Prow display.
he Source wind
:
c, add the C co
All or
There will be#include
unsigned
/*------ MAIN f *------int main while(
}
sting source fil
Flash: Please c
ptions icon
Hz). This is us
B to compile sm
ab. Click on Se
older window t
sh to enter this
s tab. Click on
tab. Select J-L
d to your PC. S
here in the Posee a valid IDC
o go back to the
s tab. Select SXMC 2Go boa
o return to the
All or
There will be n
your program
board
he Project win
le (.c):
.
oject window
dow.
ode below:
e no errors or we "XMC1100.h"
d int counter
--------------function --------------n (void) {
(1) { counter++; if (counter >}
les:
complete these
. Select the T
sed for timing c
maller code siz
elect Folder for
that opens: righ
folder and clic
n Select Folder
Link/J-Trace C
Select the Setti
rt: box: CODE and Dev
e Target Confi
ettings and conard:
main menu.
no errors or wa
m and see wha
18
dow and select
warnings if all s
= 0;
--------------
--------------
> 0x0F) counter
e instructions c
Target tab.
calculations.
ze.
r Objects…:
ht click and cre
ck OK. Compi
r for Objects…
Cortex in the U
ings: icon.
A JTAG selevice Name in th
guration windo
nfirm the corre
arnings if all w
at happens ! B
Copyright ©
www.keil
t
source code wa
-------------
-------------*/
r = 0;
carefully to pr
eate a new fold
ilation files wil
…: Double click
Use: box:
ection will not he SW Device
ow. Or, fix the
ect Flash algori
was entered cor
But first the cl
© 2014 ARM Ltd. All rig
l.com
as entered corr
/
We will not
revent unusual
der called Flash
ll now be store
k on Flash and
work. If your box at this tim
e connection pr
ithm is present
rrectly. If there
lock ! Please
ghts reserved
.
rectly.
do this in this
l problems…
h.
ed in this Flash
d click OK to cl
2Go is connecme.
roblem if you h
t: Shown is the
e are, please fix
turn the page
tutorial.
h folder.
lose.
cted to
have one.
e correct
x them !
….
In
C
T
R
Tw
C
WIin
Tc
I
nfineon XMC110
Changing the
This is really ea
1. Open
2. Click
3. Expan
4. Unsele
5. Select
6. To Blithe lin
7. Click
8. Build global
Running Your
1. Conne
2. Progra
3. Enter
4. Click
5. No LE
6. With t
7. count
8. DoublSystemunsele
9. The cl
10. You cdo this
11. You c
TIP: The Watcwithout any tim
Cleaning up yo
We modified thIf you did a Bun .\Flash to kee
1. Exit µ
2. Open C:\MD
3. Delete
4. You c
5. Restar
TIP: If you wacontents are eas
If they need the
00 Cortex-M0 Lab
Processor Clo
asy to do in µV
the file startup
on the Configu
nd the elements
ect “do not mo
t 32 MHz in the
inky.c, just befne: SystemCore
on File/Save A
the files. l variable Syste
r Program:
ect your 2Go b
am the 2Go Fla
Debug mode b
on the RUN ic
EDs will blink
the program ru
ter will be upd
le-click on <EnmCoreClock inect Hexadecima
lock speed 32 M
an also set a brs, remove the b
ould now be ab
ch 1 window isme delays inser
our Project: (
he folder whereuild before this ep the project m
µVision. Other
Microsoft ExpDK\Boards\Inf
e all files and fo
an also leave a
rt µVision. Sto
ant to save or sesily reconstruc
e .axf executab
b with XMC 2Go
ock Speed:
Vision. By def
_XMC1100.s b
uration Wizard
s so you can se
ove CLK_Val1
e IDIV drop do
fore the while(eClockUpdate(
All or
The line SysteemCoreClock t
oard to your PC
ash by clicking
by clicking on t
con. Note
since there is n
unning, right cli
dating as show
nter expressionnto Watch 1. Ral Display.
MHz will displ
reakpoint in Blbreakpoint.
ble to add your
s updated periorted, the values
(you only need
e the output anwas done, thermore organized
rwise, you can’
plorer and navigfineon/XMC_2
folders except t
any backup or µ
oring all compi
end the projectcted with a Buil
ble and interme
board
fault to process
by double-clic
d at the bottom.
ee these:
to SCU…:
own box:
1) loop, add ();
emCoreClockUthat you can di
C with a USB
g on the Load i
the Debug icon
e: you stop the
no source to ac
ick on counter
wn here:
n> and type theRight click on t
lay in Watch 1
linky.c and the
r own source c
dically, not whs in Watch 1 wi
d to do this onc
nd listings files re will be files d and neat.
’t delete files th
gate to: 2Go\BlinkyNE
these: (you can
µVision files th
ilation files sto
t files to someold.
ediary files and
19
sor is set to 8 M
king on it in th
. You can easi
Update is not neisplay in Watch
cable.
con: Prog
n .
e program with
ccomplish this t
r in Blinky.c an
e global variablthe data field an
.
e program shou
ode to create a
hen a variable vill appear to ju
ce: this is not a
are stored. Thin your projec
hat it still has o
EW\.
n delete Flash –
hat use your co
ored in the .\Fla
one, delete the
d are unable to
Copyright ©
www.keil
MHz. We will
he Project wind
ily change valu
eeded to changh 1 to display w
gress will be in
h the STOP ico
task. You wou
and select Add
le nd
uld stop at this
a meaningful pr
value changes.ump and skip se
critical step)
his was in Stepct root directory
open.
– a Build will r
omputer or use
ash folder mak
folder Flash to
compile them,
© 2014 ARM Ltd. All rig
l.com
change it to 32
dow or selectin
ues in our sourc
ge the clock spewhat the freque
ndicated in the O
on.
uld have to add
counter to … a
point if it is ru
roject. You ca
. Since Blinkyequential value
ps 3 through 7 oy. We want the
recreate it.)
er name to retai
kes it cleaner.
o reduce file siz
, do not delete
ghts reserved
2 MHz.
ng its tab.
ce code here.
eed but providency is.
Output Window
d such code yo
and select Wat
unning properly
an do this later.
y is running veres you know m
on the precedinem only
in your setting
ze. This folder
them.
des the
w.
urself.
tch 1.
y. If you
.
ry fast must exist.
ng page.
s.
r and its
In
2TM
Ce
C
B
W
nfineon XMC110
20) CreatThe MDK SoftMDK 4.7x and
Configuring RTexample. You
1. Using
2. In Blin
3. Open
4. Expan
5. Select
6. Appro
7. Click
Configure RTX
1. In the
2. Doubl
3. Select
4. The w
5. Set Tithe set
6. Unsele
7. Click
Build and Run
1. Build
2. Enter
3. Selectwindo
4. You cthreadcreate this w
What you hav
1. You mconfig
2. ProgrRTX c
Getting Stbook here:includes inand mainta
00 Cortex-M0 Lab
ting your otware Packs maearlier. The s
TX is easy in Mcan use these p
the same exam
nky.c, at the to
the Manage Ru
nd all the eleme
t Keil RTX as s
opriate RTX fil
on File/Save A
X:
Project window
le click on RTX
t the Configura
window is displ
mer clock valutting you select
ect User Timer
on File/Save A
n Your RTX P
the files. P
Debug mode:
t Debug/OS Suow below open
an see two thred is the only on
a real RTX prindow.
e to do now:
must add the RTgured to your n
ress to the nexcomponents.
tarted MDK 5 www.keil.com
nformation on iaining RTX.
b with XMC 2Go
own RTX akes it easy to econd comes w
MDK 5.10 and procedures to c
mple from the p
op, add this lin
un-Time Envir
ents as shown h
shown and clic
les will be adde
All or
w, expand the
X_Conf_CM.c
ation Wizard ta
ayed here:
ue: to 3200000ted (or not) on
rs. Use default
All or
Program:
Program the Fl
Click on
upport/System as up.
eads:os_idle_de running. As
rogram, these w
TX frameworkneeds.
t page to add
5: Obtain this m/mdk5/. It implementing
board
MDK 5 prconfigure an R
with MDK 5.10
later. These sconvert an exis
preceding page
ne: #include "c
ronment windo
here:
ck OK.
ed to your proj
CMSIS group
to open it.
ab: Select Expa
00 as shown: ( the previous p
ts for the other
lash: .
the RUN icon
and Thread Vi
demon and mainyou add more
will automatica
k into your code
20
oject fromRTX project. T0 and later. Th
teps use the sasting project to
es, Stop the pro
cmsis_os.h" (th
ow:
ect. See the Pr
.
and All.
(32 MHz) or topage.
r settings.
.
ewer. The
n. Tthe main threads to
ally be added to
e and create yo
Copyright ©
www.keil
m scratch:There are two vhis second one
ame configuratio operate using
ogram and
he error is OK)
roject window
o
o
our threads to m
© 2014 ARM Ltd. All rig
l.com
: (withoutversions of RTXis CMSIS-RT
ion as in the prRTX.
d Exit Debug m
)
w.
make this into
ghts reserved
t DAVE) X: The first co
TOS compliant.
receding Blink
mode.
a real RTX pro
omes with .
ky
oject
In
AAB
2
nfineon XMC110
Add the RTX A copy of BlinkBlinky.c with th
1. Stop th
2. Add this h#i
3. Decla
unun
4. Add a
osos
5. Add T
// Th
vo
6. Add T
// Thvo
7. Define
osos
8. int ma
9. Creat
titi
10. Send
osos
11. While
12. Select
On the nex
00 Cortex-M0 Lab
Configurationky.c is providehis file or cut a
he program:
header file: Yinclude "RTE_
re Two Globa
nsigned int cnsigned int c
a Thread ID fo
sThreadId tidsThreadId tid
Thread 1: (sta
hread 1 'pha
oid phaseA (vfor (;;) { osDelay(25 os co if os osSignal
}}
Thread 2: (sta
hread 2 'phaoid phaseB (vfor (;;) { osDelay(25 os co if os os
}}
e each thread:
sThreadDef(phsThreadDef(ph
ain(void) is alr
e the two Thr
id_phaseA = oid_phaseB = o
a signal to Th
sSignalSet(tisDelay(osWait
e(1){ } is alread
t File/Save All
xt page we wil
b with XMC 2Go
n source lines ed in C:\MDK\and paste to mo
Exit Debug
ou should now_Components.h
al Variables: (s
countA = 0; countB = 0;
or the two Thr
d_phaseA; d_phaseB;
arting at near
seA': Phase
void const *a
50); SignalWait(0untA++; (countA > 0
Delay(500); lSet(tid_phas
arting at near
seB': Phase void const *a
50); SignalWait(0untB++; (countB > 0
Delay(500); SignalSet(ti
: (starting at
haseA, osPriohaseB, osPrio
ready located
reads phaseA a
osThreadCreatosThreadCreat
hread 1 to star
id_phaseA, 0xtForever);
dy located at t
or .
ll compile and
board
to Blinky.c: W\Boards\Infineoodify it. This f
g mode:
w have three #inh"
starting near
reads: (startin
line 11 before
A output
argument) {
x0001, osWai
x10) countA seB, 0x0001);
line 22 before
B output argument) {
x0001, osWai
x10) countB d_phaseA, 0x
near line 33 b
orityNormal, orityNormal,
at this point:
and phaseB: (
te(osThread(pte(osThread(p
rt it: (starting
x0001);
this point: (ne
d run your new
21
We will createon\XMC_2Go\file has a few e
In Blinky.c ad
nclude lines.
line 5 just afte
ng near line 8
/* Thread /* Thread
e main() )
tForever);
= 0; /; /
e main() )
tForever);
= 0; /
x0001); /
before main() )
1, 0); 1, 0);
(starting nea
(starting near
phaseA), NULLphaseB), NULL
g near line 44 i
/* send
ear line 47)
w RTX Blinky
Copyright ©
www.keil
e two threads \RTX_text\. Yextra items but
dd these lines:
er the declara
8 before main(
d id of thread id of threa
/* delay 25 /* wait fo
/* delay 250m/* send signa
/* delay 25 /* wait fo
/* delay 250m/* send signa
)
ar line 36)
r line 42 in ma
L); L);
in main() befo
d signal to p
y project.
© 2014 ARM Ltd. All rig
l.com
in Blinky.c: pYou can either r
the source bel
:
ation of counte
() )
ad: phase_a ad: phase_b
50ms or an event f
ms */ al to phaseB
50ms or an event f
ms al to phaseA
ain() before th
ore the while(1
phaseA thread
ghts reserved
phaseA and phreplace the exilow will run co
er )
*/ */
*/flag 0x0001 *
*/
*/flag 0x0001 *
*/ A */
he while(1) loo
1) loop)
d */
haseB. isting orrectly.
*/
*/
p)
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
22
Compile and Run Your RTX BlinkyNEW Project:
1. Build the files. If there are errors or warnings please fix these before continuing.
2. Program the Flash:
3. Enter Debug mode: Click on the RUN icon.
4. No LEDS will blink. This program does not use them.
Add the two global variables countA and countB to the Watch 1 window.
5. Right click on countA and select Add countA to… and select Watch 1.
6. Right click on countB and select Add countB to… and select Watch 1.
7. These two variables will be displayed in Watch 1 and will be incrementing as shown here:
Congratulations: Your First RTX program is running correctly !
TIP: counter and SystemCoreClock are left over from previous steps.
Open the System and Threads Viewer:
8. Select Debug/OS Support and select System and Threads Viewer. the following window opens up: You probably have to drag into the middle of your screen.
9. The various elements will be updating in real-time as your RTX program is running.
10. Note the idle daemon is running most of the time. You can change this ratio if you want to.
11. Set a breakpoint in each thread.
12. Each time you click on RUN the program will advance to the next thread repeatedly.
13. The active thread will display Running in the State column.
This ends the exercise creating your own RTX Blinky project. You can easily add more threads and modify the timing. When you are finished, stop the program and leave Debug mode. Obtain the Keil Getting Started MDK 5 Manual: www.keil.com/mdk. It contains valuable information of using RTX. Extensive help files are included with MDK 5. So far, we have created projects from scratch or a fundamental beginning. The next section deals with creating projects using Infineon DAVE.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
23
PART C: Creating projects with Infineon DAVE and MDK 5: This document uses DAVE 3.1.10 or later to create both a Blinky and an RTX_Blinky project. Please install DAVE to your computer in the usual manner. See installing the J-Link drivers on page 4. They must be correctly installed.
Select Help/Check for Updates to make sure you have the latest software.
You must have downloaded and installed the XMC1100 Packs into µVision as shown on page 4.
21) Blinky using DAVE: We will create a µVision project using DAVE to blink the two LEDs on the 2Go board. Two PWMs will be created and configured: each one blinks one LED. DAVE will then create a µVision project and µVision will then import it.
Start DAVE and create a DAVE project:
1. Start DAVE by clicking on its icon:
2. Select File/New/Dave Project and this window will open:
3. Select DAVE CE Project: Always select Dave CE.
4. In Project Name box enter Blinky as shown here:
5. Select Next > and the Target Selection Page opens:
6. Select XMC1100-QO24F0064 or the processor you are using:
7. Confirm Add/Update startup files is enabled.
8. Click on Finish. DAVE will create your project.
9. The Blinky project will be displayed in the DAVE C/C++ Projects window as shown below.
10. Expand some of the elements.
11. You will see a Main.c and two CMSIS startup files.
12. Double click on Main.c, it will open in a window.
13. You can see DAVE has created a template Main.c with an int main(void) function but not much else.
14. If you open the startup files found in the Startup folder, you can see startup_XMC1100.s which contains processor initialization code and system_XMC1100.c contains mostly clock settings.
TIP: DAVE dynamically saves all your work as you progress into your default workspace: C:\DAVE3_workspace. You can manually save your work with File/Save or Ctrl-S.
15. We will next create two PWMs to blink the LEDs.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
24
DAVE Apps: DAVE includes Apps that you can graphically configure to create programs to suit your needs. These are programs DAVE uses to create the source code files that will become part of your µVision project. Select Help/Check for DAVE App Updates to make sure you have the latest software.
1. Apps are listed in the App Selection View. 2. Scroll through them to see your options. 3. Enter pwm in the Search filter:
TIP: If you hover your mouse over an App, a description of it will display. See the TIP: below for more details.
4. We will use two instances of the App PWMSP001 to blink each LED on and off.
Create Two PWMs to Blink the LEDs: 1. Under the heading PWM Generation, double click on
the PWMSP001. 2. This will be added in the S/W App Connectivity View. 3. Double click again on the same PWMSP001 App. 4. The Apps Shareability window will open. Select
app/ccu4global/0 as shown below: 5. Click on OK. 6. The second instance will now be added: 7. Your S/W App Connectivity View will be similar to the
one shown below: You can move your Apps around. 8. Note there are two instances of PWMSP001 (denoted by
/0 and /1), a Capture/CompareUnit 4(CCU) and a CLK002/0 clock App. These last two Apps are automatically inserted by Dave.
TIP: App Help: Select Help and click on Help Contents. On the left, click on DAVE Apps. A listing of the Apps will open.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
25
Configure PWM /0:
1. Right click on PWMSP001/0 and select UIEditor. This window opens up: 2. Set Start to Start during initialization: 3. Set CCU4 Resolution to 32000 nsec. 4. Set PWM freq to 1 Hz: 5. Select the Signal Configurations tab and set
the Output Level to Passive High. 6. Leave all else at their defaults.
Connect PWM /0 output to GPIO Port Pin P1.0:
1. Right click on PWMSP001/0 again and select Manual Pin Assignment and the next window opens up.
2. Select Resource to pin_directoutput and Port Pin number P1.0/ #14 as shown below:
3. Select Solve And Save and then Close to assign this pin.
Configure PWM /1:
1. Right click on PWMSP001/1 and select UIEditor and a similar window opens up. 2. Set Start to Start during initialization: 3. Set CCU4 Resolution to 32000 nsec. 4. Set PWM freq to 1 Hz: 5. Select the Signal Configurations tab and set the Output Level to Passive Low. This puts PWMMSP001/1 180 º out
of phase with PWMMSP001/0. When one LED is on, the other will be off. Connect PWM /1 output to GPIO Port Pin P1.1:
1. Right click on PWMSP001/0 again and select Manual Pin Assignment and the next window opens up. 2. Select Resource to pin_directoutput and Port Pin number P1.1/ #13 as shown below:
Note: P1.0 is no longer listed. DAVE knows you have already assigned Pin 1.0 so it removes it from the list. 3. Select Solve And Save and then Close to assign this pin.
4. The PWMs are now completely configured. All we need do is Build the project and export it into µVision 5. TIP: If your entries do not seem to work: ensure they are accepted by pressing Enter or clicking on another element.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
26
Generator Package Description (gpdsc) File: DAVE produces a complete µVision project and in addition a gpdsc file. This file is used to start, import and configure the appropriate files into µVision.
Configure DAVE to create a gpdsc file: (you only have to do this once in DAVE for all your projects)
1. In the DAVE main window, select Window/Preferences and this window opens up:
2. Expand Dave and select DAVE CE Preferences as shown here:
3. Select Generate gpdsc file as shown:
4. Click on OK.
Generate the Code:
5. Click on the Generate Code icon or select DAVE/Generate Code.
6. The appropriate files will be created and a progress bar will be displayed.
7. The C/C++ Projects window will display the files in this project.
8. Blinky.gpdsc will be visible in the window as shown below right:
TIP: If you do not want another instance of µVision running, close the running instance(s) of µVision before double clicking on the gpdsc file. Running multiple instances of µVision is permitted but a conflict with the J-Link Lite might arise in this case.
Import into µVision:
1. Close µVision.
2. Double click on Blinky.gpdsc and a new instance of µVision will be started.
TIP: At this time you can shut DAVE down if you prefer. It is not needed again unless you want to add or modify any settings that must be done in DAVE. Otherwise, µVision can work stand alone with the files DAVE created for it.
On the next page, we will configure µVision, build the project, program it to Flash and run it.
In
C
Ac
Ty
.
Tth
C
Aµp
nfineon XMC110
Configure µVi
After double clcreated are liste
This is almost cyour own, or us
1. Right
2. In the
3. Main.c
TIP: If you crehat you can ch
Configure the
1. Plug y
2. In µVi
3. Select
4. Select
5. Select
6. Select
7. Select
8. ConfirIf this your 2EnsureUSB d
9. The SNconneSW Dalso coproces
10. Click
11. SelectDebug
12. SelectFlash displayhighligalgorit
13. Click
14. Select
At this point, yµVision to be aproject that DA
00 Cortex-M0 Lab
ision:
licking on Blined in the projec
complete: youse the one DAV
click on Sourc
Add Files win
c will now be a
eate and add yohoose from.
Debug Adapt
your 2Go board
ision, select th
t the Target tab
t the Debug tab
t J-Link / J-Tra
t Settings: on th
t SW and not JT
rm you see an Ibox is blank, o
2Go board is ple you have the drivers installed
N: box indicatected to the J-L
Device box indionnected to thessor CoreSight
on OK to leave
t the Utilities tag Driver:
t Settings. If thalgorithm is noyed, select Addght the correct thm as shown b
on OK twice to
t File/Save All
ou have now cable to build anAVE created.
b with XMC 2Go
nky.gpdsc, µVict window as s
u must now addVE created. W
ce Group 1 and
ndow, highlight
added to Sourc
our own new f
ter and Flash p
d to your PC w
e Options for T
b. Select Use M
b.
ace Cortex as sh
he right side of
TAG as shown
IDCODE and Dor an error is dlugged in. correct J-Link
d.
es µVision is ink Lite. The cates µVision e XMC1100 debug module
e this window.
ab: Select Use
he correct ot d and Flash
below and sele
o close and retu
or .
configured nd run the
board
sion will be stahown here:
d a file containiWe will use the
d select Add Ex
t Main.c and se
ce Group 1. file, you can se
programming
with a USB cabl
Target Options
MicroLIB to co
hown here:
f this window.
n here in the Po
Device Name iisplayed, you m
k
is
e.
ect Add again t
urn to the main
27
arted. The sou
ing a main() fuone DAVE cre
xisting Files to
elect Add and t
lect Add New
g:
le.
s icon: o
ompile for sma
ort: box:
in SW Device must fix this be
to select it:
n µVision wind
Copyright ©
www.keil
urce files DAVE
unction. You ceated.
Group ….:
then Close.
Item to Group
or ALT-F7.
aller program si
box: efore you can c
dow.
© 2014 ARM Ltd. All rig
l.com
E
can add
p… and some te
ize:
continue. Che
ghts reserved
emplates will b
eck your cables
be offered
s and make
In
B
T
Tw
R
nfineon XMC110
Build the µVis
1. Comp
TIP: You will
2. Progra
TIP: Since Upwill automatica
3. Enter
4. Click
Concept: SDuring your dDAVE. Rightas appropriateproduced and
You should nogroup name in
To change anywith DAVE anchanged outsidlost.
At this point, idirectly from y
The two LEDs
Run Time Env
2. Stop th
3. Click
1. This w
2. The co
3. The grTwo in
4. The C5. Clicki
00 Cortex-M0 Lab
sion project cr
ile the source f
probably get a
am the XMC11
pdate Target beally program th
Debug mode b
on the RUN ic
Software Dedevelopment cyt click on a Gro
e. Modify theseyou subsequen
ot modify any fn µVision. Use
ything you creand the updatedde out of µVis
if you do not yyour DAVE w
s will blink at
vironment:
he program.
on the Manage
window display
omponents crea
reen arrow cannstances of DA
CMSIS CORE ang on any blue
b with XMC 2Go
reated with DA
files by clickin
a warning abou
100 Flash by cl
efore Debugginhe Flash if there
by clicking on t
con. Two
evelopment ycle, you will aoup name (suce files to your nntly modified.
files with µVise DAVE to ma
ated in DAVE,d files will be imion. If you had
yet to change anworkspace rathe
1 second interv
Exit Debug
e Run-Time En
ys the compone
ated by DAVE
n be used to staAVE cannot shand Startup filee line will displ
board
AVE:
ng on the Rebui
ut the line Retu
licking on the L
ng is selected (e is a new exec
the Debug icon
LEDs will blin
Informatioadd your own sh as Source Grneeds. DAVE
sion that were cake any modific
, such as a perimported into µd changed any
nything in DAVer than double-
vals. Each LED
mode .
nvironment ico
ents of your pr
E are listed und
art DAVE. If Dhare the same wes were also crlay information
28
ild icon. .
urn() in Main.c
Load icon:
see the previoucutable .axf file
n. Select O
nk at 1 second
n Notes: source files to troup 1) and sel
E will not modi
created by DAcations to these
ipheral configuµVision. You m
DAVE created
VE, you can clclicking on the
D is controlled
on: The w
oject from µVi
der DAVE3. T
DAVE is alreadworkspace. reated by DAVn from the web
Copyright ©
www.keil
You can also
c not reachable
Progress wil
us page), you ce available.
OK if the Evalu
intervals. Eac
the µVision prlect either Addify or replace th
AVE. These aree files.
uration, make mmust select YEd files inside µ
lose it and selee gpdsc file.
d by its own PW
window below
ision.
These cannot be
dy running, an
VE. b about this sel
© 2014 ARM Ltd. All rig
l.com
use the Build i
. You can com
ll be indicated
can skip step 2
uation Mode b
ch LED is cont
roject after it isd Existing files he main.c file i
e located under
modifications oES when notifieµVision, your c
ect your µVisio
WM you create
opens up.
e changed in th
error will be g
lection using y
ghts reserved
icon beside it.
mment this line
in the Output W
. Entering Deb
box appears.
trolled by its ow
s created by or New Files
it initially
r the DAVE3
or additions ed files have changes will be
on project
ed in DAVE.
his menu.
generated.
your default bro
e out.
Window.
bug mode
wn PWM.
e
owser.
In
HWc
C
TR CTf T Ia
nfineon XMC110
How to UpdatWe will changecreated files thi
1. In µVi
2. In the 3. Chang
4. Click 5. When 6. There
for all
7. Select
Compile, Load
1. Comp
2. Enter
3. Click 4. One o5. The so
TIP: Do not seRTOS001 App
Create an RTXThere are two mfiles and source
The next page d
If you prefer toa hard task to a
00 Cortex-M0 Lab
e Configuratioe the frequencyis way rather th
ision, stop the
DAVE S/W Cge PWM freq fr
on the Generatit has completwill one or moof these. File
t File/Save All
d into Flash an
ile the source f
Debug mode.
on the RUN icf the LEDs wilource files you
elect RTX in th. See the next
X_Blinky projmethods to creae code using µV
describes how
o add RTX manaccomplish.
b with XMC 2Go
ons inside DAy of one of the han modifying
program.
Connectivity Vifrom 1 to 5 Hz.
te Code icon ted, bring µVisore indications s modified by D
or .
nd RUN:
files by clickin
The Flash
con. ll blink at 5 timadded are not
he µVision RTpage that show
ject using DAVate a program tVision Run Tim
to use DAVE
nually, please s
board
AVE: PWMs to demthese files dire
and exit Debug
iew, right click Press Enter o
or select DAsion back into fthat has been DAVE are imp
ng on the Rebui
h will automati
mes per secondreplaced or mo
TE window if yws how to crea
VE: that will utilizeme Environme
to configure R
see the directio
29
monstrate changectly in µVisio
g mode. D
k on one of the or click in anoth
AVE/Generate focus. changed: Clicported into µV
ild icon. .
cally be progra
reflecting the odified by DAV
your project is uate an RTX_Bli
e RTX as the oent (RTE) or 2)
RTX.
ons on page 20
Copyright ©
www.keil
ging DAVE coon.
Do not exit µV
PWMSP001 Aher box to ente
Code. A new
ck on Yes Vision.
ammed.
change you mVE.
using RTX. Dinky project us
operating system) DAVE to con
Creating Your
© 2014 ARM Ltd. All rig
l.com
onfiguration file
Vision.
Apps and selecer this new sett
project will be
made it DAVE.
DAVE supplies sing DAVE.
m. They are 1nfigure RTX.
r Own RTX M
ghts reserved
es. Modify DA
ct UIEditor. ting.
e generated.
RTX using the
) add the confi
MDK 5 project:
AVE
e
iguration
This is not
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
30
22) Create an RTX_Blinky project using DAVE: We will create a µVision project using DAVE to blink the two LEDs on the 2Go board. RTX is used. We will use direct software control of Port 1.0 and 1.1 to blink the LEDS using two simple threads. DAVE will then create a µVision project and µVision will then import it. It is easy to add additional threads.
Start DAVE and create a DAVE project:
1. Start DAVE by clicking on its icon:
2. Select File/New/Dave Project and this window will open:
3. Select DAVE CE Project:
4. In Project name box enter RTX_Blinky as shown here:
5. Select Next > and the Target Selection Page opens:
6. Select XMC1100-QO24F0064 or the processor you are using as shown in the Target Selection window::
7. Confirm Add/Update startup files is enabled.
8. Click on Finish. DAVE will create your project.
9. The Blinky project will be displayed in the C/C++ Projects window as shown below.
10. Expand some of the elements.
11. You will see a Main.c and two CMSIS startup files.
12. Double click on Main.c, it will open in a window.
13. You can see DAVE has created a template main.c with an int main(void) function but not containing much else.
14. If you open the startup files, you can see startup_XMC1100.s which contains processor initialization code and system_XMC1100.c which contains mostly clock settings.
TIP: DAVE dynamically saves all your work as you progress with your default workspace: C:\DAVE3_workspace. You can manually save your work with File/Save or Ctrl-S.
15. On the next page, we will create and configure the two IO ports to blink the LEDs.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
31
DAVE Apps:
Dave includes Apps that you can graphically configure to create programs to suit your needs. We will use the RTOS001 App and two instances of the IO Ports App IO004 to create our demonstration program.
In this project, RTX RTOS files are supplied by DAVE. Apps available are listed in the App Selection View.
1. Scroll through them to see your options.
TIP: If you hover your mouse over an App, a description of it will display as shown in this window.
2. We will use two instances of the App IO004 to blink each LED on and off directly through the GPIO ports.
3. Enter io in the Search filter as shown here:
Create Two IO ports to Blink the LEDs:
6. Under the heading I/O Ports/Software Controlled IO App: Double click on the IO04 App as shown here:
7. This will be added in the S/W App Connectivity View.
8. Double click again on the same IO04 App.
9. The second instance will now be added:
10. Your S/W App Connectivity View will contain the two IO Apps. There are two instances of IO04 (denoted by /0 and /1)
Create the RTX RTOS001 Instance:
11. Enter rtos in the Search filter as shown here: Press Enter to make it active.
12. Double-click on RTOS001. This will be entered in your project.
13. The clock CLK002/0 is inserted automatically by DAVE.
14. Your completed App Connectivity View will look like the one below. You can move the icons around.
15. The next steps will configure the IO and RTOS Apps.
TIP: App Help: Select Help and click on Help Contents. On the left click on DAVE Apps. A listing of the Apps will open.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
32
Configure IO004/0: 1. Right click on IO004/0 and select UIEditor. This window opens up: 2. Enable Output Enable as shown here: 3. Select Default Output level to High: 4. Leave all else at their defaults.
Connect IO004/0 output to GPIO Port Pin P1.0: 5. Right click on IO004/0 again and select Manual
Pin Assignment and the next window opens up. 6. Select pin in the Resource box. Select P1.0/ #14
in the Port Pin Number box as shown below: 7. Select Solve And Save and then Close to assign
this pin. Configure IO004/1:
1. Right click on IO004/1 and select UIEditor and a similar window to the one above opens up. 2. Enable Output Enable as shown above the same way you configured IO004/0.
Connect IO004/1 output to GPIO Port Pin P1.1:
3. Right click on IO004/1 again and select Manual Pin Assignment and the Manual Pin Assignment window opens. 4. Select Resource to pin and Port Pin number P1.1/ #13 similar to the above screen. 5. Select Solve And Save and then Close to assign this pin. 6. The IO ports are now configured.
Configure RTOS001/0:
1. Right click on RTOS001/0 and select UIEditor, This window that opens has various tabs:.
2. Leave everything at their default values. 3. Click through the tabs to view the various
options available to you. 7. RTX is now completely configured. All we
need do is Build the project and export it into µVision 5.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
33
Generator Package Description (gpdsc) File: DAVE produces a complete µVision project and in addition a gpdsc file. This file is used to start, import and configure the appropriate files into µVision.
Configure DAVE to create a gpdsc file: TIP: You need set the Generate gpdsc bit only once for all your DAVE projects.
1. In the DAVE main window, select Window/Preferences and this window opens up: 2. Expand Dave and select DAVE CE
Preferences as shown here: 3. Select Generate gpdsc file… as shown: 4. Click on OK.
Generate the Code:
5. Click on the Generate Code icon or select DAVE/Generate Code.
6. The appropriate files will be created and a progress bar will be displayed.
7. The C/C++ Projects window will display the files in this project.
8. Blinky.gpdsc will be visible as shown below right:
Import into µVision: 1. Close uVision. This prevents multiple instances from opening.
2. Locate the file Blinky.gpdsc as shown here:
3. Double click on Blinky.gpdsc and a new instance of µVision will be started.
TIP: If you do not want another instance of µVision running, close the running instance(s) before double clicking on the gpdsc file. Running multiple instances of µVision is permitted but a conflict concerning the J-Link Lite might arise in this case. On the next page, we will configure µVision, add source code, build the project, program the Flash and run it.
TIP: You can close DAVE now or leave it open. It is not needed as µVision can work with the project independently. You will only need DAVE if you want to modify or add an App.
In
C
Aa
Eth
.
Tt
C
AM
nfineon XMC110
Configure µVi
After double clare listed in the
Enter Main.c: he one DAVE
1. Right
2. In the
TIP: If you creemplates will b
Configure the
1. Conne
2. In µVi
3. Select
4. Select
5. Select
6. Select
7. ConfirIf this your 2correc
8. The SNthe J-LµVisioproces
9. Click
10. SelectDriver
11. Selectprogradisplay
12. Selectappropbelow
13. Click the ma
14. Select
At this point, yMain.c does no
00 Cortex-M0 Lab
ision:
licking on Bline project windo
You must addcreated. We w
click on Sourc
Add Files win
eate and add yobe offered that
Debug Adapt
ect your 2Go b
ision, select th
t Use MicroLIB
t the Debug tab
t Settings: on th
t SW as shown
rm you see an Ibox is blank, o
2Go board is plct J-Link USB d
N: box indicateLink Lite. Theon is connectedssor CoreSight
on OK to close
t the Utilities tar as shown here
t Settings and iamming algorityed, you must
t Add and highpriate entry as . Click on Add
OK to close anain µVision wi
t File/Save All
ou have configot yet have the
b with XMC 2Go
nky.gpdsc, µViow as shown he
d a file containwill use the one
ce Group 1 and
ndow, highlight
our own file, yyou can choos
ter and Flash p
oard to your PC
e Options for T
B for smaller c
b. Select J-Link
he right side of
here in the Po
IDCODE and Dor an error is dlugged in. Ensdrivers are inst
es µVision is ce SW Device bod to the XMC1debug module
e this window.
ab: Select Usee:
f a Flash thm is not add one.
light the shown d to select it.
nd return to indow.
or .
gured µVisionnecessary RTX
board
sion will be staere:
ning a main() fue DAVE create
d select Add Ex
t Main.c and se
you can select Ase from.
programming
C with a USB
Target Options
ompiled execu
k / J-Trace Cor
f this window.
rt: box: Do no
Device Name iisplayed, you m
sure the talled.
connected to ox indicates 100
e.
Debug
to be able to bTX components
34
arted. The sou
unction. You ced.
xisting Files to
elect Add. The
Add New Item
g:
cable.
s icon: Options
utable:
rtex as shown h
ot select JTAG
in SW Device must fix this be
build and run ts to make a com
Copyright ©
www.keil
urce files DAVE
can add your o
Group ….:
en Select Close
m to Group… an
s or ALT-F
here:
.
box: efore you can c
the RTX_Blinmplete RTOS s
© 2014 ARM Ltd. All rig
l.com
E created
own, or use
e.
nd some
F7 and select th
continue. Che
ky project thatsolution.
ghts reserved
he Target tab.
eck your cables
t DAVE create
s and make
ed.
In
B
T
Tw
N
R
nfineon XMC110
Build the µVis
1. Comp
TIP: You will
2. Progra
TIP: Since Upwill automatica
3. Enter
4. Click
5. No LE
6. Select
7. If you 255 anRunnithis po
NOTE: At thi
8. We ne
Run Time Env
1. Stop th
2. Click
3. This w
4. The co
5. The grTwo in
6. The C
7. Clicki
8. Note T
9. Clicki
10. The co
11. Click
00 Cortex-M0 Lab
sion project cr
ile the source f
probably get a
am the XMC11
pdate Target beally program th
Debug mode b
on the RUN ic
EDs will blink:
t Debug/OS Su
see the os_idlend main as ID ng, everything
oint.
is writing, con
eed to add som
vironment:
he program
on the Manage
window display
omponents crea
reen arrow cannstances of DA
CMSIS CORE a
ng on any blue
The Infineon R
ng on any blue
omponents (no
on OK to close
b with XMC 2Go
reated by DAV
files by clickin
a warning abou
100 Flash by cl
efore Debugginhe Flash if there
by clicking on t
con. Note
recall the Ma
upport and selec
e_demon as ID1 and
g is correct to
ntinuing develo
e source code t
and exit Deb
e Run-Time En
ys the compone
ated by DAVE
n be used to staAVE cannot sh
and Startup file
e line will displ
RTX is selected
e line will displ
ot shown above
e the RTE wind
board
VE:
ng on the Rebui
ut the line Retu
licking on the L
ng is selected (e is a new file
the Debug icon
e: you stop the
ain() created by
ct System and
D
opment of the
to create the R
ug mode.
nvironment (RT
ents of your pr
E are listed und
art DAVE. If Dhare the same w
es were also cr
lay information
d and not Keil R
lay information
e) are the Keil M
dow.
35
ild icon. .
urn() in Main.c
Load icon:
see the previouavailable.
n. Select O
e program with
y DAVE is alm
Thread Viewe
e DAVE RTOS
RTX environme
TE) icon:
oject.
der DAVE3. T
DAVE is alreadworkspace.
reated by DAV
n from the web
RTX. DAVE a
n from the web
Middleware. C
Copyright ©
www.keil
You can also
c not reachable
Progress wil
us page), you c
OK if the Evalu
h the STOP ico
most blank. Th
er. This window
S App is causi
ent and to blink
The window
These cannot be
dy running, an
VE.
b about this app
automatically m
b about this app
Contact Keil sa
© 2014 ARM Ltd. All rig
l.com
use the Build i
. You can com
ll be indicated
can skip step 2
uation Mode b
on.
his will be recti
w will open:
ing this windo
k the LEDs. T
w below opens u
e changed in th
error will be g
p using your d
made this selec
p using your d
ales or tech sup
ghts reserved
icon beside it.
mment this line
in the Output W
. Entering Deb
box appears.
fied on the nex
ow to be blank
This is on the ne
up:
his menu.
generated.
default browser
ction.
default browser
pport for inform
e out.
Window.
bug mode
xt page.
k.
ext page.
r.
r.
mation.
In
AAthy
nfineon XMC110
Add RTX ConA copy of Mainhis package M
your DAVE pro
1. Stop th
2. Open
3. Add s#i
#i
4. Note:
5. Add aos
os
6. Add T/*
*
*
vo
7. Add T/*
*
*
vo
8. Defineos
os
9. Int ma
10. Creat
ti
ti
11. Start
os
12. While
13. Add in
os
14. Comm
15. Select
00 Cortex-M0 Lab
nfiguration soun.c is provided
Main.c will be fooject and add i
he program:
Main.c by dou
some the RTXinclude "cmsi
include "RTE_
All other nece
a Thread ID fosThreadId tid
sThreadId tid
Thread 1: (sta*------------
* Thread
*------------
oid phaseA (v
for (;;) {
IO004_Togg
osDelay(25
}}
Thread 2: (sta*------------
* Thread
*------------
oid phaseB (v
for (;;) {
IO004_Togg
osDelay(25
}}
e each thread:sThreadDef(ph
sThreadDef(ph
ain(void) is al
e the two Thr
id_phaseA = o
id_phaseB = o
the RTX Ker
sKernelStart
e(1){ } is alread
nside the whil
sThreadYield
ment out retur
t File/Save All
b with XMC 2Go
urce lines to Md in the softwaround in C:\MDit to your proje
Exit Debug
uble-clicking on
X and IO App his_os.h" _Components.h
essary header fi
or the two Thrd_phaseA;
d_phaseB;
arting at near -------------
d 1 'phaseA':
-------------
void const *a
glePin(IO004_
50);
arting at near -------------
d 2 'phaseB':
-------------
void const *a
glePin(IO004_
50);
: (starting at haseA, osPrio
haseB, osPrio
ready located
reads phaseA a
osThreadCreat
osThreadCreat
rnel: (starting
();
dy starting at
le loop near L
();
rn 0; and Add
or .
board
Main.c: We wre package thatDK\Boards\Infi
ct or copy and
g mode:
n it in the Proje
header files: A
h"
files are provide
reads: (startin
line 18 before-------------
: Phase A out
-------------
argument) {
_Handle0);
line 27 before-------------
: Phase B out
-------------
argument) {
_Handle1);
near line 36 borityNormal,
orityNormal,
at this point:
and phaseB: (
te(osThread(p
te(osThread(p
g near line 49)
this point: (n
ine 52 :
d a Carriage R
36
will create twot accompanies tineon\XMC_2Gpaste segment
ect window in
Add these line
// Compone
ed by #include
ng near line 1 /* Thread
/* Thread
e int main(void-------------
tput: Contro
-------------
/
e int main(void-------------
tput C
-------------
/
before int main1, 0);
1, 0);
(starting nea
(starting near
phaseA), NULL
phaseB), NULL
before while(
near line 50)
Return (CR) an
Copyright ©
www.keil
threads in Mathis documentGo\RTX_txt. Yts or all of it in
µVision.
es near line 10:
ent selectio
e <DAVE3.h>
5 after #includd id of threa
d id of threa
d) ) ------------
ols Port 1.0
------------
/* delay 250m
d) ) ------------
Controls Port
------------
/* delay 250m
n(void)
ar line 39)
r line 46 after
L);
L);
(1)
nd the very en
© 2014 ARM Ltd. All rig
l.com
ain.c: phaseAfor your conveYou can insert
nto the Main.c D
on
which is alread
de <DAVE3.h>ad: phase_a
ad: phase_b
-------------
LED
-------------
ms */
-------------
t 1.1 LED
-------------
ms
DAVE_Init();
nd of the file.
ghts reserved
A and phaseB.enience. If yout this Main.c diDAVE provide
dy in Main.c.
>) */
*/
------
-----*/
------
-----*/
*/
; and before w
Press Enter to
u copied irectly into ed.
while(1) )
o do this.
In
C
T
Tw
HW
C
nfineon XMC110
Compile, Load
1. Comp
TIP: You will
2. Progra
TIP: Since Upwill automatica
3. Enter
4. Click
5. The tw
6. Open
7. phaseA
8. NOTE
How to UpdatWe will not act
1. In µVi
2. In DA
3. Click
4. When
5. There for all
6. Select
Compile, Load1. Comp
2. Enter
3. Click
4. The ch
5. The so
00 Cortex-M0 Lab
d and RUN yo
ile the source f
probably get a
am the XMC11
pdate Target beally program th
Debug mode b
on the RUN ic
wo LEDs will b
Debug/System
A and phaseB w
E: At this wri
e Configuratiotually demonst
ision, stop the
AVE, Make you
on the Generat
done, bring µV
will one or moof these. File
t File/Save All
d into Flash anile the source f
Debug mode.
on the RUN ic
hanges you ma
ource files you
b with XMC 2Go
our Program:
files by clickin
a warning abou
100 Flash by cl
efore Debugginhe Flash if there
by clicking on t
con. Note
blink.
m and Threads V
will take turns
iting, continui
ons inside DAtrate this. Whe
program.
ur modification
te Code icon
Vision back int
ore indications s modified by D
or .
nd RUN: files by clickin
The Flash
con.
ade in DAVE w
added are not
board
ng on the Rebui
ut the line Retu
licking on the L
ng is selected (e is a new file
the Debug icon
e: you stop the
Viewer and thi
running provin
ng developme
AVE: en files are mod
and exit Debug
ns. Make sure
or select DA
to focus.
that has been DAVE are imp
ng on the Rebui
h will automati
will be reflected
replaced or mo
37
ild icon. .
urn() in main.c
Load icon:
see the previouavailable.
n. Select O
e program with
is window open
ng the program
ent of the DAV
dified in DAVE
g mode.
you click on E
AVE/Generate
changed: Clicported into µV
ild icon in µVi
cally be progra
d in your updat
odified.
Copyright ©
www.keil
You can also
not reachable.
Progress wil
us page), you c
OK if the Evalu
h the STOP ico
ns up:
m is working co
VE RTOS App
E they can be i
Enter or click in
Code. A new
ck on Yes Vision.
ision.
ammed.
ated project.
© 2014 ARM Ltd. All rig
l.com
use the Build i
. You can com
ll be indicated
can skip step 2
uation Mode b
on.
orrectly.
p is causing th
imported into µ
n another box t
project will be
ghts reserved
icon beside it.
mment this line
in the Output W
. Entering Deb
box appears.
his window to
µVision as foll
to enter this ne
e generated.
out.
Window.
bug mode
be blank.
lows:
ew setting.
Copyright © 2014 ARM Ltd. All rights reserved
Infineon XMC1100 Cortex-M0 Lab with XMC 2Go board www.keil.com
38
23) Document Resources: See www.keil.com/infineon Books:
1. NEW! Getting Started MDK 5: Obtain this free book here: www.keil.com/mdk5/.
2. There is a good selection of books available on ARM processors. A good list of books on ARM processors is found at www.arm.com/university by selecting “Teaching Resources”. You can also select ARM Related Books but make sure to also select the “Books suited for Academia” tab to see the full selection.
3. µVision contains a window titled Books. Many documents including data sheets are located there.
4. A list of resources is located at: www.arm.com/products/processors/cortex-m/index.php Click on the Resources tab. Or search for “Cortex-M3” on www.arm.com and click on the Resources tab.
5. The Definitive Guide to the ARM Cortex-M0/M0+ by Joseph Yiu. Search the web for retailers.
6. The Definitive Guide to the ARM Cortex-M3/M4 by Joseph Yiu. Search the web for retailers.
7. Embedded Systems: Introduction to Arm Cortex-M Microcontrollers (3 volumes) by Jonathan Valvano.
Application Notes: 1. NEW! ARM Compiler Qualification Kit: Compiler Safety Certification: www.keil.com/pr/article/1262.htm
2. Using DAVE with µVision: µVision is DAVE compatible. www.keil.com/appnotes/files/apnt_258.pdf
8. Using Cortex-M3 and Cortex-M4 Fault Exceptions www.keil.com/appnotes/files/apnt209.pdf
9. Segger emWin GUIBuilder with µVision™ www.keil.com/appnotes/files/apnt_234.pdf
10. Porting mbed Project to Keil MDK™ www.keil.com/appnotes/docs/apnt_207.asp
11. MDK-ARM™ Compiler Optimizations www.keil.com/appnotes/docs/apnt_202.asp
12. Using µVision with CodeSourcery GNU www.keil.com/appnotes/docs/apnt_199.asp
13. RTX CMSIS-RTOS in MDK 5 C:\Keil_v5\ARM\Pack\ARM\CMSIS\4.1.0\CMSIS_RTX
14. Download RTX CMSIS-RTX www.keil.com/demo/eval/rtx.htm and www.arm.com/cmsis
15. Barrier Instructions http://infocenter.arm.com/help/topic/com.arm.doc.dai0321a/index.html
16. Lazy Stacking on the Cortex-M4: www.arm.com and search for DAI0298A
17. Cortex Debug Connectors: www.arm.com and search for cortex_debug_connectors.pdf or
www.keil.com/coresight/coresight-connectors
18. Sending ITM printf to external Windows applications: www.keil.com/appnotes/docs/apnt_240.asp
Keil Tutorials for Infineon Boards: www.keil.com/infineon 1. XMC 2Go (this document) www.keil.com/appnotes/docs/apnt_260.asp
2. 1200 Boot Kit: coming… See www.keil.com/infineon
3. XMC4500 Relax Kit: coming… See www.keil.com/infineon
4. XMC4500 Application Board Kit: coming… See www.keil.com/infineon
5. Hitex XMC-HiLight XMC4500 board: www.keil.com/appnotes/docs/apnt_231.asp
ARM Community Forums: www.keil.com/forum and http://community.arm.com/groups/tools/content
Infineon Community Forum: www.infineonforums.com/
ARM University program: www.arm.com/university. Email: [email protected]
ARM Accredited Engineer Program: www.arm.com/aae
mbed™: http://mbed.org
For comments or corrections on this document please email [email protected].
For more information on the ARM CMSIS standard: www.arm.com/cmsis.
In
2
K
U
T
A
K
CST
A
A
Cv
Kpli
FK
K
F
F
C
nfineon XMC110
24) Keil P
Keil Micro MDK- MDK X
NEW MDK- MDK-
NEW
USB-JTAG ULINK ULINK ULINK NEW Contact sa
Contact sa
For spec
The Keil RTX
All versions, in
Keil includes fr
Call Keil Sales Sales can also pThey will help
All products ar
All products in
Call Keil Sales view various pr
Keil supports mprocessors. Seeist of Infineon
For more Keil Sales In U
Keil Technical
For comments
For the latest ve
CMSIS docume
00 Cortex-M0 Lab
Products a
controllerLite (EvaluatXMC1000 - $
W !! MDK-ARStandard (unProfessional
W !! ARM Co
G adapter K2 - (ULINK2K-ME – sold oKpro – Faster
W !! [email protected]
cial promotio
RTOS is now p
ncluding MDK
ree DSP librari
for details on provide adviceyou find variou
e available from
clude Technica
for special unirograms and re
many other Infie the Keil Devsupport. This
informatioUSA: sales.us@
l Support in U
or corrections
ersion of this d
entation: www
b with XMC 2Go
and Conta
r Develoption version) $0
RM-CM™ (for nlimited comp(Includes Fla
ompiler Qualif
(for Flash2 and ME - Sonly with a bor operation anro D – Faster om 800-348
com +49 89/
onal or quan
provided under
-Lite, includes
ies for the Cort
current pricing about the varius labs and app
m stock.
al Support for
iversity pricingesources.
ineon processoice Database® information is
on: @keil.com or 80
USA: support.u
please email b
document, go to
w.arm.com/cms
board
act Inform
ment Kit - $0
Cortex-M sepile and debu
ash File, TCP/IP
fication Kit:
h programWV only – nooard by Keil ond Flash prog operation an8-8051 for USA
/456040-20 for
ntity pricing
r a BSD type l
Keil RTX RT
tex-M0, Cortex
g, specials and ious tools optiopnotes that are
1 year. This is
g. Go to www
rs including 80on www.keil.c
s also included
00-348-8051.
ob.boys@arm.
o www.keil.co
sis
39
mation: Se
(MDK-ARM
eries processoug code and dP, CAN and US
for Safety Ce
mming tooo ETM) or OEM. gramming, Cond Flash progA prices.
r pricing in othe
g and offers,
icense. This m
TOS with sourc
x-M3 and Cort
quantity discoons available to useful.
s easily renewe
.arm.com/univ
051 and C166 com/dd for the in MDK.
Outside the US
r 800-348-8051
.com.
om/infineon and
Copyright ©
www.keil
ee www.keil.c
M™)
ors only – undata size) SB driver librar
ertification Ap
o)
ortex-Mx SWramming, Co
er countries.
, please con
makes it free.
ce code !
tex-M4.
ounts. o you.
ed.
versity to
series complete
S: sales.intl@
1. Outside the
d for more Infi
© 2014 ARM Ltd. All rig
l.com
com/infineon
limited code
ries and Graph
pplications
WV & ETM tracortex-Mx SWV
ntact Keil Sa
@keil.com or +4
e US: support.i
fineon specific
ghts reserved
n
limit)
ic User Interfac
ce. V, no ETM tra
ales.
49 89/456040-2
information.
ce (GUI))
ace.
20
.