Getting started with MDK
Create applications with µVision
®
for ARM
®
Cortex
®
-M microcontrollers
2
Preface
Information in this document is subject to change without notice and does not
represent a commitment on the part of the manufacturer. The software described
in this document is furnished under license agreement or nondisclosure
agreement and may be used or copied only in accordance with the terms of the
agreement. It is against the law to copy the software on any medium except as
specifically allowed in the license or nondisclosure agreement. The purchaser
may make one copy of the software for backup purposes. No part of this manual
may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or information storage and
retrieval systems, for any purpose other than for the purchaser’s personal use,
without written permission.
Copyright © 1997-2017 ARM Germany GmbH
All rights reserved.
ARM
®
, Keil
®
, µVision
®
, Cortex
®
, TrustZone
®
, CoreSight™ and ULINK™ are
trademarks or registered trademarks of ARM Germany GmbH and ARM Ltd.
Microsoft
®
and Windows™ are trademarks or registered trademarks of Microsoft
Corporation.
PC
®
is a registered trademark of International Business Machines Corporation.
NOTE
We assume you are familiar with Microsoft Windows, the hardware, and the
instruction set of the ARM
®
Cortex
®
-M processor.
Every effort was made to ensure accuracy in this manual and to give appropriate
credit to persons, companies, and trademarks referenced herein.
Getting Started with MDK: Create Applications with µVision
3
Preface
Thank you for using the ARM Keil
®
MDK Microcontroller Development Kit. To
provide you with the best software tools for developing ARM Cortex-M
processor based embedded applications we design our tools to make software
engineering easy and productive. ARM also offers complementary products such
as the ULINK™ debug and trace adapters and a range of evaluation boards.
MDK is expandable with various third party tools, starter kits, and debug
adapters.
Chapter overview
The book starts with the installation of MDK and describes the software
components along with complete workflow from starting a project up to
debugging on hardware. It contains the following chapters:
MDK Introduction
provides an overview about the MDK Tools, the software
packs, and describes the product installation along with the use of example
projects.
CMSIS
is a software framework for embedded applications that run on Cortex-M
based microcontrollers. It provides consistent software interfaces and hardware
abstraction layers that simplify software reuse.
Software Components
enable retargeting of I/O functions for various standard
I/O channels and add board support for a wide range of evaluation boards.
Create Applications
guides you towards creating and modifying projects using
CMSIS and device-related software components. A hands-on tutorial shows the
main configuration dialogs for setting tool options.
Debug Applications
describes the process of debugging applications on real
hardware and explains how to connect to development boards using a wide range
of debug adapters.
Middleware
gives further details on the middleware that is available for users of
the MDK-Professional and MDK-Plus editions.
Using Middleware
explains how to create applications that use the middleware
available with MDK-Professional and MDK-Plus and contains essential tips and
tricks to get you started quickly.
4
Preface
Contents
MDK Tools ............................................................................................................. 7
Software Packs ....................................................................................................... 8
MDK Editions......................................................................................................... 8
Installation .............................................................................................................. 9
Software and hardware requirements ............................................................. 9
Install MDK-Core ........................................................................................... 9
Install Software Packs................................................................................... 10
MDK-Professional Trial License .................................................................. 11
Verify Installation using Example Projects .................................................. 12
Use Software Packs ...................................................................................... 16
Access Documentation ......................................................................................... 20
Request Assistance ............................................................................................... 20
Learning Platform ................................................................................................. 21
Quick Start Guides................................................................................................ 21
CMSIS-CORE ...................................................................................................... 23
Using CMSIS-CORE .................................................................................... 23
CMSIS-RTOS2 ..................................................................................................... 26
Software Concepts ........................................................................................ 26
Using Keil RTX5 .......................................................................................... 27
Component Viewer for RTX RTOS ............................................................. 36
CMSIS-DSP.......................................................................................................... 37
CMSIS-Driver ...................................................................................................... 39
Configuration ................................................................................................ 40
Validation Suites for Drivers and RTOS .............................................................. 41
Preface ........................................................................................................ 3
MDK Introduction .................................................................................... 7
CMSIS ...................................................................................................... 22
Software Components ............................................................................. 42
Compiler:Event Recorder ..................................................................................... 42
Compiler:I/O ......................................................................................................... 43
Board Support ....................................................................................................... 45
Blinky with Keil RTX5 ........................................................................................ 46
Blinky with Infinite Loop Design ......................................................................... 54
Device Startup Variations ..................................................................................... 56
Example: STM32Cube ................................................................................. 56
Secure/non-secure programming .......................................................................... 61
Create ARMv8-M software projects............................................................. 61
Create Applications ................................................................................. 46
Getting Started with MDK: Create Applications with µVision
5
Debug Applications ................................................................................. 62
Debugger Connection ........................................................................................... 62
Using the Debugger .............................................................................................. 63
Debug Toolbar .............................................................................................. 64
Command Window ....................................................................................... 65
Disassembly Window ................................................................................... 65
Component Viewer ....................................................................................... 66
Event Recorder ............................................................................................. 67
Breakpoints ................................................................................................... 69
Watch Window ............................................................................................. 70
Call Stack and Locals Window..................................................................... 70
Register Window .......................................................................................... 71
Memory Window .......................................................................................... 71
Peripheral Registers ...................................................................................... 72
Trace ..................................................................................................................... 73
Trace with Serial Wire Output ...................................................................... 74
Trace Exceptions .......................................................................................... 76
Logic Analyzer ............................................................................................. 77
Debug (printf) Viewer .................................................................................. 78
Event Counters.............................................................................................. 79
Trace with 4-Pin Output ............................................................................... 80
Trace with On-Chip Trace Buffer................................................................. 80
Network Component............................................................................................. 83
File System Component........................................................................................ 85
USB Component ................................................................................................... 86
Graphics Component ............................................................................................ 87
IoT Connectivity ................................................................................................... 88
Migrating to Middleware Version 7 ..................................................................... 89
FTP Server Example ............................................................................................. 90
Middleware .............................................................................................. 81
Using Middleware ................................................................................... 92
USB Device HID Example ........................................................................... 94
Add Software Components ........................................................................... 95
Configure Middleware .................................................................................. 97
Configure Drivers ......................................................................................... 99
Implement Application Features................................................................. 100
Build and Download ................................................................................... 103
Verify and Debug ....................................................................................... 103
Index ....................................................................................................... 105