Keil MDK-ARM on STM32F4

MDK – Microcontroller Development Kit

The MDK-ARM is a complete software development environment for Cortex-M, Cortex-R4, ARM7 and ARM9 processor-based devices. MDK-ARM is specifically designed for microcontroller applications, it is easy to learn and use, yet powerful enough for the most demanding embedded applications.

A Lite/evaluation version is available for free, but limited to 32KBytes of code.

Install  Keil MDK-ARM / STM32F4 drivers

1 – DOWNLOAD AND INSTALL KEIL-MDK
http://www.keil.com/arm/mdk.asp

2 – INSTALL DRIVERS

– Download driver STSW-Link006.   http://www.st.com/web/catalog/tools/FM147/SC1887/PF259459
Unzip and launch :   dpinst_amd64  (x64)   or    dpinst_x86  (x86)

or launch   C:\ Keil \ ARM \ STLink \ USBDriver \ ST-Link_V2_USBdriver.exe

–   Launch C:\ Keil \ARM \ ULINK installULINK.exe
ULINKpro uses a specific Keil USB driver, which is part of the Keil tools. When connecting ULINKpro for the first time
to the PC, Windows detects the new hardware.

–  Connect to USB cable the ST32F407-Discovery board and launch    C: \ Keil \ ARM \ STLink \ ST-LinkUpgrade.exe

–  Verify if correctly installed at Device Manager

5

CONFIGURE TEMPLATE PROJECT

5 – Download STM32F4 Libraries   http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257901
-> stm32f4_dsp_stdperiph_lib.zip downloaded
-> unzip file ->  created folder :    STM32F4xx_DSP_StdPeriph_Lib_V1.3.0

3

– Download  https://github.com/nabilt/STM32F4-Discovery-Firmware/tree/master/Utilities/STM32F4-Discovery

to get the fowwing files and move them to a STM32F4-Discovery Folder

111

– Create a Template Project Folder :
Create folder \STM32F4x_Template   and   \STM32F4x_Template\stm32f407xx_lib
copy the folders :
– CMSIS                                                  (Cortex Microcontroller Software Interface Standard for Cortex-M processors )
– STM32F4xx_StdPeriph_Driver      ( STM32F407 peripheral drivers )
– STM32F4-Discovery                         ( firmware to manage LEDs, Buttons, audio and acceloremeter chips, on discovery board )
to the template project folder : STM32F4x_Template\stm32f407xx_lib

You now have a template project folder that you can use to every new project.
main.c is your code, and
STM32F4x_Template.uvproj has all Keil configuration that you still have to make, see next chapter “Configuring Keil”.)

2

 

Installed files…

C:\Keil\UV4\PackInstaller.exe

C:\Keil\Eclipse\MDKEclipsePlugIn.zip

 


 

Similar option

http://www.electroons.com/blog/2013/04/keil-project-setup-for-stm32f4-discovery   :
you can download the standard STM32F4 board support package ( BSP) provided by ST Micro.
www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stsw-stm32068.zip

 


Configuring Keil

Project -> new uVision  Project
select STM32F0407VG

1

.

Image3

.

.

Image2

Flashing

3

but first you have to add flash programming algorithm :

ALT-F7       or        Project -> Options for target       or       right-click like in pricture below

Image2

or     click icon like picture below

3

 


 

 

Debug

configure :

2

 

 

http://www.keil.com/support/man/docs/ulink2/ulink2_trace_itm_viewer.htm

111

 

222

 

 


 

 

Run-Time Environment

The Manage Run-Time Environment (RTE) dialog allows selecting pre-built Software Components that will be part of a project.

Image4

.

 

.

 

.

 

 

.

.

.

.

.

.

.

.

.

.

.

.

Leave a comment