Thursday, May 16, 2013

Getting Started with the STM32F4 Discovery Board using Keil

This short post is deigned to help you get started with Keil and the STM32F4 Discovery board. By the end of this post you should be able to download the pre-reqs, install the software, open up the demo program and debug it using the Keil IDE. The  key things to note are:
  1. You must install the ST-LINK driver.
  2. By default Keil is naturally setup for ULink rather than ST-Link so that has to be changed
  3. The default device will be incorrect and must be changed

Here's the steps:

  • Open up the demo project from the board support package:
    • STM32F4-Discovery_FW_V1.1.0\Project\Demonstration\MDK-ARM\STM32F4-Discovery_Demo.uvproj

  • Configure Keil for ST-Link and Discovery - Project Options (ALT-F7)
  1. Device: STM32F407VG
  2. Debug: use ST-Link Debugger (NOT the deprecated one)
  3. Debug settings:  add STM32F4xx Flash
  4. Utilities: select ST-Link Debugger
  5. Utilities settings:  add STM32F4xx Flash
  6. Utilities: Update target before debugging

·         Build the project from the Project menu – Build target (F7)
·         You should now be able to debug the demo program from the debug menu (Ctrl-F5)