UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction



Similar documents
UM1969 User manual. Getting started with STM32F746G discovery software development tools. Introduction

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

Getting started with software and firmware environments for the STM32F0DISCOVERY kit

STM32F4DISCOVERY. Discovery kit with STM32F407VG MCU. Features. Description

32F072BDISCOVERY. Discovery kit for STM32F072xx microcontrollers. Features. Description

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

32F769IDISCOVERY. Discovery kit with STM32F769NI MCU. Features

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

M24LRxx/CR95HF application software installation guide

Figure 1. STM32F429 Discovery board: STM32F429I-DISCO

UM0834 User manual. Developing and debugging your STM8S-DISCOVERY application code. Introduction. Reference documents

UM1075 User manual. ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32. Introduction

AN4571 Application note

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

UM1075 User manual. ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32. Introduction

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

AN3354 Application note

Start A New Project with Keil Microcontroller Development Kit Version 5 and Freescale FRDM-KL25Z

Building and Debugging a project using Keil MDK-ARM Eclipse plug-in

Getting Started with Kinetis SDK (KSDK)

AN4108 Application note

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

AN3990 Application note

AN4296 Application note

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

TN0072 Technical note

AN2557 Application note

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

3. Programming the STM32F4-Discovery

Microsoft Visual Studio 2010 Instructions For C Programs

AN3332 Application note

Nuvoton Nu-Link Debug Adapter User Manual

Using DAVE with MDK Version 5

Sage HRMS 2014 Sage Employee Self Service Tech Installation Guide for Windows 2003, 2008, and October 2013

Instructions for Installing and Using the FOCUS DL-15 Data Transfer Software

Getting started with the X-CUBE-SOUNDTER1 sound terminal software expansion for STM32Cube

HVP-KV31F120M Quick Start Guide

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

How To Develop A Toolstick

Using Microsoft Visual Studio API Reference

Section 1 Introduction to the AT91SAMD20 and the Development Environment

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

CB-OLP425 DEVELOPMENT KIT GETTING STARTED

STSW-IDW002. Hands-On Training for SPWF01SC and SPWF01SA Wi-Fi modules. Features. Description

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Quick Start Guide. USB Packet Sniffer/Dongle for Kinetis MKW22D and MKW24D Wireless MCUs USB-KW24D512

SIM900 Eclipse environment install Application Note_V1.00

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

AN2824 Application note

INSTALLATION GUIDE. AXIS Camera Station

UML - Getting Started EA v4.0

Table of Contents. ARM Evaluation Board (AEB-1) Welcome Guide ARM DGI 0005D. Proprietary Notice

UM0462 User manual. STM32 and STM8 Flash loader demonstrator. Introduction

Installing jabra pc suite. V01_0905 Jabra is a registered trademark of GN Netcom A/S

Guide to Installing BBL Crystal MIND on Windows 7

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

Procedure for updating Firmware of EZ4 W or ICC50 W

AN3265 Application note

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

How To Build A Project On An Eclipse Powerbook For Anarc (Powerbook) On An Ipa (Powerpoint) On A Microcontroller (Powerboard) On Microcontrollers (Powerstation) On Your Microcontroller 2 (Powerclock

Oracle Endeca Information Discovery

Bootloader with AES Encryption

AN3997 Application note

How to Install Eclipse. Windows

How to use the Eclipse IDE for Java Application Development

SPC5-FLASHER. Flash management tool for SPC56xx family. Description. Features

MED-AFEs Design Reference Manual

AN3998 Application note

Installation Instructions for 9555 USB Driver

CS SoftDent Practice Management Software Installation Guide for Client/Server Configurations

AN2146 APPLICATION NOTE

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

Installation and User Guide Zend Browser Toolbar

Installation & Activation Guide

Nios II IDE Help System

Printer Driver Installation Manual

AN4646 Application note

WA1625 Web Services Development Using WebLogic Server v10. Classroom Setup Guide. Web Age Solutions Inc. Copyright 2012 Web Age Solutions Inc.

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

UM0991 User manual. Developing and debugging your STM8L-DISCOVERY application code. Introduction. Reference documents

8x8 Virtual Office Telephony Interface for Salesforce

Figure 1. 8-Bit USB Debug Adapter

TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0

RTX Runtime with Service Pack 2 WES7 DEPLOYMENT GUIDE

Installation of the MMA955xL CodeWarrior Service Pack Author: Fengyi Li Application Engineer

AN4156 Application note

CS SoftDent Practice Management Software Installation Guide for Client/Server Configurations

The following items are trademarks or registered trademarks of Kaba Mas in the United States and/or other countries. GITCON

Sage HRMS 2012 Sage Employee Self Service. Technical Installation Guide for Windows Server 2003 and Windows Server 2008

Installing the USB driver for Firmware 7 or later For use with E-blocks programmer boards and PICmicro Development boards.

Implementing a SAS 9.3 Enterprise BI Server Deployment TS-811. in Microsoft Windows Operating Environments

AN3252 Application note

Dell Statistica Statistica Enterprise Installation Instructions

AN4128 Application note

Quick Start Guide. TWR-MECH Mechatronics Board TOWER SYSTEM

Global VPN Client Getting Started Guide

Transcription:

User manual Getting started with STM32 Nucleo board software development tools Introduction The STM32 Nucleo board is a low-cost and easy-to-use development platform used to quickly evaluate and start a development with an STM32 in 32-pin package, 64-pin package and 144-pin package. This document provides guidelines to beginners on how to build and run a sample application and allows them to build and debug their application. It has the following structure: The first chapter presents software and hardware requirements (some toolchains supporting the STM32 families, ST-LINK/V2-1 installation and firmware package presentation). The second chapter provides step by step guideline on how to build and debug an application using some toolchains: IAR Embedded Workbench for ARM (EWARM) by IAR systems Microcontroller Development Kit for ARM (MDK-ARM) by Keil TrueSTUDIO by Atollic System Workbench for STM32 (SW4STM32) by AC6 This manual does not 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 offers links to the documents needed to fully understand every single step. All boards belonging to the STM32 MCU Nucleo line are supported. Figure 1. Nucleo development tools January 2016 DocID025840 Rev 5 1/22 www.st.com

Contents UM1727 Contents 1 System requirements........................................ 4 2 IDEs supporting STM32 families............................... 6 3 ST-LINK/V2-1 installation..................................... 7 4 Firmware package........................................... 8 4.1 Executing and debugging firmware using software toolchains.......... 8 4.1.1 EWARM toolchain.......................................... 9 4.1.2 MDK-ARM toolchain....................................... 11 4.1.3 TrueSTUDIO toolchain...................................... 14 4.1.4 SW4STM32 toolchain...................................... 18 5 Revision history........................................... 21 2/22 DocID025840 Rev 5

List of figures List of figures Figure 1. Nucleo development tools.................................................. 1 Figure 2. Connector CN1 for Nucleo 144 board......................................... 4 Figure 3. Connector CN1 for Nucleo 64 board.......................................... 5 Figure 4. Connector CN1 for Nucleo 32 board.......................................... 5 Figure 5. Package contents......................................................... 8 Figure 6. IAR Embedded Workbench IDE.............................................. 9 Figure 7. EWARM project successfully compiled......................................... 9 Figure 8. Download and debug button................................................ 10 Figure 9. IAR Embedded Workbench debugger screen.................................. 10 Figure 10. Go button.............................................................. 11 Figure 11. µvision5 IDE............................................................ 11 Figure 12. MDK-ARM project successfully compiled...................................... 12 Figure 13. Start/Stop Debug Session button............................................ 12 Figure 14. MDK-ARM debugger screen................................................ 13 Figure 15. Run button............................................................. 13 Figure 16. TrueSTUDIO workspace launcher dialog box.................................. 14 Figure 17. Atollic TrueSTUDIO import source select dialog box............................. 15 Figure 18. Atollic TrueSTUDIO import projects dialog box................................. 15 Figure 19. TrueSTUDIO project successfully compiled.................................... 16 Figure 20. TrueSTUDIO debug window................................................ 17 Figure 21. SW4STM32 workspace launcher dialog box................................... 18 Figure 22. SW4STM32 import source select dialog box................................... 18 Figure 23. SW4STM32 import projects dialog box....................................... 19 Figure 24. SW4STM32 project successfully compiled..................................... 19 Figure 25. SW4STM32 debug window................................................ 20 DocID025840 Rev 5 3/22 3

System requirements UM1727 1 System requirements Before starting the user should: 1. Install the preferred Integrated Development Environment (IDE). 2. ST-LINK/V2-1 driver will be installed automatically. In case of problem, the user can proceed with manual installation of the driver, from toolchains install directory (further details are available in Section 3). 3. Download the STM32 Nucleo firmware from the www.st.com/stm32nucleo webpage. 4. Establish the connection with the STM32 Nucleo board, by connecting CN1 of the Nucleo board to the USB port of the PC (Figure 2,Figure 3 and Figure 4 show the connector CN1 inside the red circle). The above steps will be detailed in the coming sections. Figure 2. Connector CN1 for Nucleo 144 board 4/22 DocID025840 Rev 5

System requirements Figure 3. Connector CN1 for Nucleo 64 board Figure 4. Connector CN1 for Nucleo 32 board DocID025840 Rev 5 5/22 21

IDEs supporting STM32 families UM1727 2 IDEs supporting STM32 families STMicroelectronics STM32 families of 32-bit ARM Cortex -M core-based microcontrollers are supported by a complete range of software tools. It encompasses traditional integrated development environment IDEs with C/C++ compilers and debuggers from major third-parties (free versions up to 64 Kbytes of code, depending on third-party), completed with innovative tools from STMicroelectronics. Toolchains supporting all Nucleo boards are: EWARM v7.10.3 or later (a) 30-day evaluation edition 32-Kbyte Limited QuickStart edition (16-Kbyte limitation for Cortex M0) MDK-ARM v5.17 or later (a)(b) MDK-Lite (32-Kbyte code size limitation) TrueSTUDIO Lite v5 or later (b) No limitation SW4STM32 v1.5 and later (a) No limitation Information on the toolchain version supporting the STM32 device is available on toolchain release note at third-party web site. a. Registration before the download is required. b. The device support pack is separate from the MDK-ARM releases. 6/22 DocID025840 Rev 5

ST-LINK/V2-1 installation 3 ST-LINK/V2-1 installation Note: All the STM32 Nucleo boards include an ST-LINK/V2-1 embedded debug tool interface. This interface needs a dedicated USB driver to be installed. This driver is available at the www.st.com website and supported within the following software toolchains: IAR Embedded Workbench for ARM (EWARM). The toolchain is installed by default in the C:\Program Files\IAR Systems\Embedded Workbench x.x directory on the PC local hard disk. After installing EWARM, install the ST-LINK/V2-1 driver by running the ST-Link_V2_USB.exe from [IAR_INSTALL_DIRECTORY]\Embedded Workbench x.x\arm\drivers\st-link \ST-Link_V2_USBdriver.exe. Keil Microcontroller Development Kit (MDK-ARM) toolchain. The toolchain is installed by default in the C:\Keil directory on the PC local hard disk; the installer creates a start menu µvision5 shortcut. When connecting the ST-LINK/V2-1 tool, the PC detects new hardware and requires to install the ST-LINK_V2_USB driver. The Found New Hardware wizard appears and guides the user through the steps needed to install the driver from the recommended location. Atollic TrueSTUDIO STM32. The toolchain is installed by default in the C:\Program Files\Atollic directory on the PC local hard disk. The ST-Link_V2_USB.exe file is automatically installed when installing the software toolchain. AC6 System Workbench for STM32 (SW4STM32). The toolchain is installed by default in the C:\Program Files\AC6 directory on the PC local hard disk. The ST-Link_V2_USB.exe file is automatically executed when installing the software toolchain. Complementary information on the firmware package content and the STM32 Nucleo requirements is available on the Getting started with the STM32 Nucleo board firmware package UM1726 User manual at the www.st.com website. The embedded ST-LINK/V2-1 only supports SWD interface for STM32 devices. DocID025840 Rev 5 7/22 21

Firmware package UM1727 4 Firmware package The STM32 Nucleo examples, applications and demonstration are provided in one single.zip file. The extraction of the.zip file generates one folder, STM32 Nucleo_FW_VX.Y.Z, which contains the following subfolders (see Figure 5). Figure 5. Package contents Template project is a pre-configured project with empty main function to be customized by the user. This is helpful to start creating an application based on the peripherals drivers. Example project includes toolchain projects for each peripheral example ready to be run. Applications includes set of applications ready to be run. Demonstration includes the demonstration firmware ready to be run. 4.1 Executing and debugging firmware using software toolchains The steps below can be applied to an already existing example, demonstration or template project available from STM32_Nucleo_FW_VX.Y.Z firmware at the www.st.com website. First of all, the user must read the firmware/readme.txt file, which contains the firmware description and hardware/software requirements. 8/22 DocID025840 Rev 5

Firmware package 4.1.1 EWARM toolchain The following procedure explains how to compile, link and execute an existing EWARM project. 1. Open IAR Embedded Workbench for ARM (EWARM). Figure 6 shows the basic names of the windows referred to in this document: Figure 6. IAR Embedded Workbench IDE 2. In the File menu, select Open and click Workspace to display the Open Workspace dialog box. Browse to select either an example or demonstration or template workspace file and click Open to launch it in the Project window. 3. In the Project menu, select Rebuild All to compile the project. 4. If the project is successfully compiled, Figure 7 is displayed. Figure 7. EWARM project successfully compiled To change the project settings (Include and preprocessor defines), go through the following project options: For Include directories: Project>Options >C/C++ compiler> For pre-processor defines: Project>Options C/C++ compiler>pre-processor> DocID025840 Rev 5 9/22 21

Firmware package UM1727 5. In IAR Embedded Workbench IDE, from the Project menu, select Download and Debug or, alternatively, click the Download and Debug button in the toolbar, to program the Flash memory and start debugging (see Figure 8). Figure 8. Download and debug button 6. The debugger in IAR Embedded Workbench can be used to debug source code at C and assembly levels, set breakpoints, monitor individual variables and watch events during the code execution (see Figure 9). Figure 9. IAR Embedded Workbench debugger screen To run the application from the Debug menu, select Go. Alternatively, click the Go button in the toolbar to run the application (see Figure 10). 10/22 DocID025840 Rev 5

Firmware package Figure 10. Go button 4.1.2 MDK-ARM toolchain 1. Open Keil MDK-ARM Microcontroller Development Kit. Figure 11 shows the basic names of the "Keil µvision5" windows, to which this document refers. Figure 11. µvision5 IDE 2. In the Project menu, select Open Project... Browse to select either an example or a demonstration or a template project file and click Open to launch it in the Project window. 3. In the Project menu, select Rebuild All target files to compile the project. 4. If the project is successfully compiled, the following window is displayed (see Figure 12): DocID025840 Rev 5 11/22 21

Firmware package UM1727 Figure 12. MDK-ARM project successfully compiled If user needs to change his project settings (Include and preprocessor defines), he must go through the project options: For Include directories: Project>Options for Target > C/C++ > Include Paths For pre-processor defines: Project>Options for Target > C/C++ > Preprocessor symbols > Define 5. In MDK-ARM IDE, from the Debug menu, select Start/Stop Debug Session or, alternatively, click the Start/Stop Debug Session button in the toolbar, to program the Flash memory and start debugging (see Figure 13). Figure 13. Start/Stop Debug Session button 6. The debugger in the MDK-ARM can be used to debug source code at C and assembly levels, set breakpoints, monitor individual variables and watch events during the code execution. 12/22 DocID025840 Rev 5

Firmware package Figure 14. MDK-ARM debugger screen To run the application from the Debug menu, select Run. Alternatively, click the Run button in the toolbar to run the application (see Figure 15). Figure 15. Run button DocID025840 Rev 5 13/22 21

Firmware package UM1727 4.1.3 TrueSTUDIO toolchain 1. Open Atollic TrueSTUDIO for ARM product. The program launches and prompts for the workspace location. Figure 16. TrueSTUDIO workspace launcher dialog box 2. Browse to select a TrueSTUDIO workspace of either an example or a demonstration or a template workspace file and click OK to load it. 3. To load an existing project in the selected workspace, select Import from the File menu to display the Import dialog box. 4. In the Import window, open General, select Existing Projects into Workspace and click Next (see Figure 17). 14/22 DocID025840 Rev 5

Firmware package Figure 17. Atollic TrueSTUDIO import source select dialog box 5. Click Select root directory and browse to the TrueSTUDIO workspace folder, as showed in Figure 18. Figure 18. Atollic TrueSTUDIO import projects dialog box DocID025840 Rev 5 15/22 21

Firmware package UM1727 6. In the Projects panel, select the project and click Finish. 7. In the Project Explorer, select the project, open the Project menu, and click Build Project. 8. If the project is successfully compiled, the following messages will be displayed on the console window (see Figure 19). Figure 19. TrueSTUDIO project successfully compiled If user needs to change the project settings (Include directories and preprocessor defines), he must go through Project>Properties and select C/C++ Build>Settings from the left panel: For Include directories: C Compiler>Directories>Include path For pre-processor defines: C Compiler>Symbols> Defined symbols 9. To debug and run the application, select the project in the Project Explorer and press F11 to start a debug session (see Figure 20). 16/22 DocID025840 Rev 5

Firmware package Figure 20. TrueSTUDIO debug window The debugger in the Atollic TrueSTUDIO can be used to debug source code at C and assembly levels, set breakpoints, monitor individual variables and watch events during the code execution. To run the application, from the Run menu, select Resume, or alternatively click the Resume button in the toolbar. DocID025840 Rev 5 17/22 21

Firmware package UM1727 4.1.4 SW4STM32 toolchain 1. Open the AC6 SW4STM32 for STM32. The program launches and prompts for the workspace location (See Figure 21). Figure 21. SW4STM32 workspace launcher dialog box 2. Browse to select a SW4STM32 workspace of either an example or a demonstration or a template workspace file and click OK to load it. 3. To load an existing project in the selected workspace, select Import from the File menu to display the Import dialog box. 4. In the Import window, open General, select Existing Projects into Workspace and click Next (See Figure 22). Figure 22. SW4STM32 import source select dialog box 18/22 DocID025840 Rev 5

Firmware package 5. Click Select root directory, browse to the SW4STM32 workspace folder (See Figure 23). Figure 23. SW4STM32 import projects dialog box 6. In the Projects panel, select the project and click Finish. 7. In the Project Explorer, select the project, open the Project menu, and click Build Project. 8. If the project is successfully compiled, the following messages display on the console window (See Figure 24). Figure 24. SW4STM32 project successfully compiled DocID025840 Rev 5 19/22 21

Firmware package UM1727 To change the project settings (Include directories and preprocessor defines), simply go through Project>Properties, select C/C++ Build>Settings from the left panel: For Include directories follow the path: C Compiler>Directories>Include path For pre-processor defines follow the path: C Compiler>Symbols> Defined symbols 9. To debug and run the application, select the project in the Project Explorer and press F11 to start a debug session (see Figure 25). Figure 25. SW4STM32 debug window The debugger in the AC6 SW4STM32 can be used to debug source code at the C and assembly levels, to set breakpoints, to monitor individual variables and to watch events during the code execution. To run an application select Resume, from the Run menu, or alternatively click the Resume button in the toolbar. 20/22 DocID025840 Rev 5

Revision history 5 Revision history Table 1. Document revision history Date Revision Changes 19-May-2014 1 Initial release 20-Jun-2014 2 09-Sep-2014 3 30-Nov-2015 4 19-Jan-2016 5 Added new part numbers in the cover page. Removed Table1 Nucleo board General information. Replaced all rpns of NUCLEO with reference to the STM32 MCU Nucleo line. Added Section 4.1.4: SW4STM32 toolchain. Updated Section : Introduction, Section 3: ST-LINK/V2-1 installation, Section 4: Firmware package. Updated : Introduction and Section 1: System requirements to introduce the Nucleo 144 board. DocID025840 Rev 5 21/22 21

IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2016 STMicroelectronics All rights reserved 22/22 DocID025840 Rev 5