ST STM32F401 Discovery User Manual
ST STM32F401 Discovery User Manual

ST STM32F401 Discovery User Manual

Software development tools
Hide thumbs Also See for STM32F401 Discovery:

Advertisement

Quick Links

Introduction
This document describes the software environment required to build an application around
the STM32F401 Discovery board (32F401CDISCOVERY), and provides some development
recommendations.
It provides guidelines to novice users on how to build and run a sample application, and
allows them to create and build their own application.
This document:
presents the toolchains supporting the STM32 families:
describes where to find the ST-LINK/V2 driver to be installed before starting coding on
any Integrated Development Environment;
describes step by step how to execute and debug an existing project with one of the
previously presented toolchains;
describes step by step how to create a new project with one of the toolchains from a
dummy project included in the firmware package;
provides helpful information on the advanced debugging capabilities of the Serial Wire
Viewer (SWV) asynchronous trace supported by ST-LINK. This feature is especially
useful when debugging certain tricky problems you may find during application
development.
This user manual cannot cover all the topics relevant to software development
environments, but it demonstrates the first basic steps necessary to get started with the
compilers/debuggers and provides links to the required documents to fully understand every
step.
October 2013
Getting started with STM32F401 Discovery
IAR Embedded Workbench
Microcontroller Development Kit for ARM (MDK-ARM) by Keil™,
®
TrueSTUDIO
by Atollic;
DocID025194 Rev 1
software development tools
®
for ARM (EWARM) by IAR Systems,
UM1671
User manual
www.st.com
1/19

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F401 Discovery and is the answer not in the manual?

Questions and answers

Summary of Contents for ST STM32F401 Discovery

  • Page 1 – TrueSTUDIO by Atollic;  describes where to find the ST-LINK/V2 driver to be installed before starting coding on any Integrated Development Environment;  describes step by step how to execute and debug an existing project with one of the previously presented toolchains;...
  • Page 2: Table Of Contents

    IDEs supporting STM32 families ....... . 6 ST-LINK/V2 installation and development ......7 Firmware package .
  • Page 3 Toolchains supporting STM32F401 Discovery ........6...
  • Page 4 STM32F401 Discovery package content ........
  • Page 5: Getting Started

    STM32F401 Discovery board as follows. Figure 1. Hardware environment The above steps will be detailed in the following sections. To run and develop any firmware application on your STM32F401 Discovery board, the minimum requirements are as follows: ...
  • Page 6: Ides Supporting Stm32 Families

    (free versions up to 64 KB of code, depending on the partner), completed with innovative tools from STMicroelectronics. The following table provides some general information about the most popular integrated development environments, as well as the version supporting officially the STM32F401 product. Table 1. Toolchains supporting STM32F401 Discovery Toolchain Company Compiler Version Download link www.iar.com/en/Products/IAR-Embedded-...
  • Page 7: St-Link/V2 Installation And Development

    The STM32F401 Discovery board includes an embedded ST-LINK/V2 debug tool interface. The interface needs an ST-Link/V2-dedicated USB driver to be installed. This driver is available from the ST Website www.st.com ST-LINK V2 and is supported by the software toolchains: ...
  • Page 8: Figure 2. Stm32F401 Discovery Package Content

    Getting started UM1671 Figure 2. STM32F401 Discovery package content Template project: pre-configured project with empty main function to be customized by the user. This is helpful to start creating your own application based on the peripheral drivers. Master workspace: collection of all projects available within this firmware package.
  • Page 9: Executing And Debugging Firmware Using A Software Toolchain

    The steps below can be applied to an already existing example, demonstration or template project available at STM32F401-Discovery_FW_VX.Y.Z firmware available at www.st.com/stm32f4-discovery. First of all, you need to go through the firmware readme.txt file which contains a description of the firmware and hardware/software requirements.
  • Page 10: Figure 4. Ewarm Project Successfully Compiled

    Executing and debugging firmware using a software toolchain UM1671 Figure 4. EWARM project successfully compiled If you need to change your project settings (Include and preprocessor defines), simply go through the project options:  For Include directories Project>Options…>C/C++ compiler>  For pre-processor defines Project>Options…C/C++ compiler>pre-processor>...
  • Page 11: Mdk-Arm Toolchain

    UM1671 Executing and debugging firmware using a software toolchain Figure 7. IAR Go button MDK-ARM toolchain Open the Keil MDK-ARM Microcontroller Kit. Figure 8 shows the basic names of the Keil uVision4 windows referred to in this document. Figure 8. uVision4 IDE In the Project menu, select Open Project...
  • Page 12: Figure 10. Mdk-Arm Start/Stop Debug Session Button

    Executing and debugging firmware using a software toolchain UM1671 If you need to change your project settings (Include and preprocessor defines), simply go through the project options:  For Include directories Project>Options for Target > C/C++ > Include Paths  For pre-processor defines Project>Options for Target >...
  • Page 13: Truestudio Toolchain

    UM1671 Executing and debugging firmware using a software toolchain Figure 12. MDK-ARM Run button TrueSTUDIO toolchain Open the Atollic TrueSTUDIO® for ARM product. The program launches and prompts for the Workspace location. Figure 13. TrueSTUDIO workspace launcher dialog box Browse to select a TrueSTUDIO workspace of either an example or demonstration or template workspace file, and click OK to load it.
  • Page 14: Figure 14. Truestudio Import Source Select Dialog Box

    Executing and debugging firmware using a software toolchain UM1671 Figure 14. TrueSTUDIO import source select dialog box Click Select root directory; then browse to the TrueSTUDIO workspace folder. Figure 15. TrueSTUDIO import projects dialog box In the Projects panel, select the project and click Finish. In the Project Explorer, select the project, open the Project menu, and click Build Project.
  • Page 15: Figure 16. Truestudio Project Successfully Compiled

    UM1671 Executing and debugging firmware using a software toolchain Figure 16. TrueSTUDIO project successfully compiled If you need to change the project settings (Include directories and preprocessor defines), simply go through Project>Properties, and select C/C++ Build>Settings from the left panel: ...
  • Page 16: Stm32F401 Advanced Debugging

    – Return: when all the exceptions have returned to the main XXX  How to use it: – EWARM: ST-LINK > Interrupt log – MDK-ARM: View > Trace > Exceptions – TrueSTUDIO: View > SWV Exception Trace Log Function profiler: shows timing information for the functions in an application –...
  • Page 17: Software Toolchains Helpful References And Links

    UM1671 Software toolchains helpful references and links Software toolchains helpful references and links The following table provides useful references about the integrated development environments described in this document. Table 2. Links to software toolchains Toolchain Download link www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/ EWARM – EWARM_UserGuide www.keil.com/demo/eval/arm.htm MDK-ARM www.keil.com/arm/mdk.asp...
  • Page 18: Revision History

    Revision history UM1671 Revision history Table 3. Document revision history Date Revision Changes 02-Oct-2013 Initial release. 18/19 DocID025194 Rev 1...
  • Page 19 No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.

This manual is also suitable for:

32f401cdiscovery

Table of Contents