Keil MDK-ARM uVision Installation

Keil MDK-ARM µVision5 will be used as development environment in all projects that will be made on this site. Keil can be obtained for free on https://www.keil.com/download/product/ where we will select MDK-ARM (Development environment for Cortex and ARM devices).

Version that will be downloaded is free one. Although it has some limits it won’t affect you in creating/running examples which will be provided.

 

MDK is shortened from Microcontroller Development Kit which consists of the MDK Core plus device-specific Software Packs.

 

Installing Device Family Pack(DFP) through Pack Installer

On the first start-up after the installation of Keil MDK-ARM µVision, the Pack Installer will automatically be executed. The Pack Installer is a utility for installing, updating and removing Software Packs.

Keil Pack Installer
Keil Pack Installer

On the left side are listed all devices grouped by vendor and device. The right side lists Software packs and example projects that can be used with the board which had been selected. Device on what we are going to work is STM32F429I so we will install Keil::STM32F4xx_DFP. DFT pack is also downloadable directly from Keil website at http://www.keil.com/dd2/pack/.

After that our Keil MDK-ARM µVision5 and Device Family Pack(DFP) for STM32F429I should be installed.

The next step will be verifying Keil installation and board testing with given example. On the right side of Pack Installer, click Examples and select CMISIS-RTOS Blinky (STM32F429I-Discovery). Press Copy button and save it as new Project.

Verifying system installation and running an example

New project will be created and µVision will start. Picture below is showing µVision development environment with Blinky example. At first glance it looks kind of scary, crowded with options, but there is no need to concern yourself with it because we will only use small part of it at the beginning. In the next part the most important options are going to be explained which are needed for the head start.

µVision Startup Screen
µVision Startup Screen

On the left side of µVision startup screen is placed project source tree from imported Blinky project.

A new file can be added or imported by right clicking on desired folder in which the file we want to accommodate. 

    Download (F8): Download the application, typically to on-chip Flash ROM of a device

    Options for Target: Allows you to configure selected target.

    Build (F7): Only changed files are rebuild

    Rebuild: Rebuilds all files that are included into project

     Pack Installer: Utility for installing, updating and removing Software Packs

    Manage Run-Time Environment: Allows you to manage Software Components of a project

    Start/Stop Debug Session (CTRL + F5): Run the application on the target hardware using a debugger

Now we are gonna setup ST-Link Debugger. Press Options for target…  and navigate to Debug tab.

Setting ST-Link Debugger
Setting ST-Link Debugger

From a drop down menu select ST-Link Debugger.

If you don’t see ST-Link Debugger option, then probably ST-Link driver isn’t correctly installed on Windows. To do this perform the following steps:

Open Windows Device Manager window.

With the STM32F4DISCO board plugged in, under Other devices find STM32 STLink and right-click it to display the context help menu.

Press Update Driver Software and select Browse my computer for driver software.

On the next screen you will be asked to browse for driver by yourself.

Press Browse and navigate to your Keil_v5 installation folder.

Find ARM folder and inside should be STLink.

Select it and press next.

 

Your tree folder structure should look like this.

Path to STLink driver
Path to STLink driver

If installation was successful then in Device Manager window under Universal Serial Bus devices, should be STM32F4 STLink marked as installed.

Next click on Settings option just right from ST-Link Debugger.

Debug Adapter setup
Debug Adapter setup

For Debug Adapter select ST-LINK/V2 and for Port SW. Close settings window and build project with   Rebuild all target files icon. If everything was done correctly there shouldn’t be any errors and compilation should finish without any errors or warnings. After building the project code needs to be written on our STM32F4 board. It can be done by clicking icon or by pressing F8 shortcut.

If everything went okay, µVision should print in output screen something like this:

Output message of flush code command
Output message of flush code command

For entering Debug session press   icon.

Debug screen
Debug screen

By clicking   icon or pressing F5 shortcut code execution starts. Congratulations your first program should be working now as green and red LEDs are alternately blinking. Don’t worry about understanding this code as it was only an example to test if Keil was properly installed. Next time we will setup project using STM32CubeMX.

Related posts

  • Space Engineer

    Very informative, thank you for such a detailed explanation!