ARM? Cortex? M4 Cookbook
上QQ阅读APP看书,第一时间看更新

Installing uVision5

A free evaluation version of the IDE known as the MDK-ARM Lite edition, running (albeit with limited functionality) under the Windows operating system, is available for download. The main limitation of the environment is that programs that generate more than 32 KB of code cannot be compiled and linked (see http://www.keil.com/demo/limits.asp). However, since most programs written by novices tend be quite small, this limitation is not a serious problem. For those who expect their executable image to exceed 32 KB, other open source compiler and IDE options are considered in Chapter 9, Embedded Toolchain.

uVision5, the latest version of the IDE is distributed as two components. An MDK core contains all the development tools, and software packs, together with Cortex Microcontroller Software Interface standard (CMSIS) and middleware libraries, which add support for target devices.

Installation involves downloading and running an executable (.exe) file. Users can download and install the latest version after first registering their contact details at http://www2.keil.com/mdk5/install/.

How to do it…

  1. Download the latest version of the software by following the instructions provided by Keil. Device-specific libraries are not included in installations from version 5 onwards, so at the end of the installation, we must configure the IDE using the Pack Installer to choose the resources (that is target devices, boards, and examples) that we need.
  2. Select the Boards tab, choose the MCBSTM32F400 Keil evaluation board featuring the STM32F407IGHx STMicroelectronics part, as this is the target for all the practical examples described in this cookbook.
  3. With the Packs tab, in addition to the default installation options: CMSIS and Keil ARM Processional Middleware for ARM Cortex-M-based devices, board support for MCBSTM32F400 is also needed. Select the latest version Keil::32F4xx_DFP (2.6.0).
  4. Select the Examples tab, and copy the board-specific example programs to a convenient local folder. Note: the example programs illustrate many useful features of the evaluation board, and are an invaluable resource.
  5. Once we have downloaded and installed MDK-ARM uVision5, the IDE can be invoked from the Windows Taskbar. If we wish to update the installation, the pack installer can be invoked by selecting the pack installer icon on uVision5 toolbar.
  6. We demonstrate the basic features of uVision in this chapter, but later on, we'll probably need to access the uVision user guide via the Help menu (also available at http://www2.keil.com/mdk5) to learn about the more advanced features of the IDE. A useful guide to getting started with uVision5 can be found at https://armkeil.blob.core.windows.net/product/mdk5-getting-started.pdf. An overview of uVision5 is available at http://www2.keil.com/mdk5, and this includes some video clips that describe the design philosophy, and explain how to use the Pack Installer and create a new project.

How it works…

Computer programming involves specifying a sequence of binary codes that are interpreted by the machine as instructions that together enable it to undertake some task. The instruction sets of early computers were small and easily memorized by programmers, so programs were written directly in machine code, and each instruction code word was set up on switches and written to memory. Finally, once all the instructions had been entered, the program was executed. With the development of more powerful machines and larger instruction sets, this approach became unworkable. This motivated the need to program in higher level (human understandable) languages that are translated into machine code by a special program called a compiler. Modern day programmers rarely need to interpret inpidual binary codes; instead, they use a text editor to enter a sequence of high-level language statements, a compiler to convert them into machine code, a linker to allow programs to reuse previously written (library) code, and a loader to write the binary codes to memory. The steps comprising edit, compile, link, load can be undertaken by running each program (editor, compiler, linker, loader) separately. However, nowadays they are usually packaged together within a wrapper called an IDE. Some IDEs are language-specific and some are customizable, allowing developers to create bespoke programming environments for any target language and/or machine.

The pack installer framework allows MDK-ARM uVision5 to be customized and extended to target a large number of devices and evaluation boards using ARM cores. But while, IDEs represent the most popular and efficient route to programming, uVision represents just one of a number of IDEs that are widely available. Other manufacturers and open source communities offer alternatives, some of which we investigate later in the book.