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



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

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

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

AN3354 Application note

AN3332 Application note

AN4108 Application note

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

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

AN2557 Application note

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

EVL185W-LEDTV. 185 W power supply with PFC and standby supply for LED TV based on the L6564, L6599A and Viper27L. Features.

Getting started with software and firmware environments for the STM32F0DISCOVERY kit

AN3990 Application note

M24LRxx/CR95HF application software installation guide

AN4156 Application note

2STBN15D100. Low voltage NPN power Darlington transistor. Features. Application. Description

DDSL01. Secondary protection for DSL lines. Features. Description

AN3265 Application note

AN3998 Application note

AN2389 Application note

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

BD238. Low voltage PNP power transistor. Features. Applications. Description. Low saturation voltage PNP transistor

BD135 - BD136 BD139 - BD140

AN3110 Application note

AN2824 Application note

TN0023 Technical note

AN3353 Application note

BD241A BD241C. NPN power transistors. Features. Applications. Description. NPN transistors. Audio, general purpose switching and amplifier transistors

ST High voltage fast-switching NPN power transistor. Features. Applications. Description

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

ULN2801A, ULN2802A, ULN2803A, ULN2804A

Single LNB supply and control IC DiSEqC 1.X compliant with EXTM based on the LNBH29 in a QFN16 (4x4) Description

AN2604 Application note

ULN2001, ULN2002 ULN2003, ULN2004

AN2680 Application note

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

ESDLIN1524BJ. Transil, transient voltage surge suppressor diode for ESD protection. Features. Description SOD323

Order code Temperature range Package Packaging

How To Write To An Eeprom Memory On A Flash Memory On An Iphone Or Ipro Memory On Microsoft Flash Memory (Eeprom) On A Microsoft Microsoft Powerbook (Ai) 2.2.2

BZW50. Transil, transient voltage surge suppressor (TVS) Features. Description

TN0072 Technical note

AN3359 Application note

AN4128 Application note

STTH2R06. High efficiency ultrafast diode. Features. Description

ETP01-xx21. Protection for Ethernet lines. Features. Description. Applications. Benefits. Complies with the following standards

LM135-LM235-LM335. Precision temperature sensors. Features. Description

STEVAL-IEG001V2. Smart real-time vehicle tracking system. Features

DSL01-xxxSC5. Secondary protection for DSL lines. Features. Description. Applications. Benefits. Complies with the following standards

AN2146 APPLICATION NOTE

MC Low noise quad operational amplifier. Features. Description

EN: This Datasheet is presented by the m anufacturer. Please v isit our website for pricing and availability at ore.hu.

UM1613 User manual. 16-pin smartcard interface ST8034P demonstration board. Introduction

AN3270 Application note

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

AN3252 Application note

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

SPC5-CRYP-LIB. SPC5 Software Cryptography Library. Description. Features. SHA-512 Random engine based on DRBG-AES-128

STP60NF06. N-channel 60V Ω - 60A TO-220 STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

L78MxxAB L78MxxAC. Precision 500 ma regulators. Features. Description

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

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

L6234. Three phase motor driver. Features. Description

P6KE. Transil, transient voltage surge suppressor (TVS) Features. Description. Complies with the following standards

AN2866 Application note

STP60NF06FP. N-channel 60V Ω - 30A TO-220FP STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

Description. Table 1. Device summary

Description. Table 1. Device summary. Order code Temperature range Package Packaging Marking

STN3NF06L. N-channel 60 V, 0.07 Ω, 4 A, SOT-223 STripFET II Power MOSFET. Features. Application. Description

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

AN3997 Application note

Figure 1. STM32F429 Discovery board: STM32F429I-DISCO

Table 1. Absolute maximum ratings (T amb = 25 C) Symbol Parameter Value Unit. ISO C = 330 pf, R = 330 Ω : Contact discharge Air discharge

STTH1R04-Y. Automotive ultrafast recovery diode. Features. Description

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

UA741. General-purpose single operational amplifier. Features. Applications. Description. N DIP8 (plastic package)

AN2760 Application note

AN3155 Application note

TDA W CAR RADIO AUDIO AMPLIFIER

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

STP55NF06L STB55NF06L - STB55NF06L-1

AN2703 Application note

AN3969 Application note

STDP2690. Advanced DisplayPort to DisplayPort (dual mode) converter. Features. Applications

Description SO-8. series. Furthermore, in the 8-pin configuration Very low-dropout voltage (0.2 V typ.)

STGB10NB37LZ STGP10NB37LZ

AN2328 Application note

VN05N. High side smart power solid state relay PENTAWATT. Features. Description

STCS A max constant current LED driver. Features. Applications. Description

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

3. Programming the STM32F4-Discovery

TDA2004R W stereo amplifier for car radio. Features. Description

STB75NF75 STP75NF75 - STP75NF75FP

STM32F4DISCOVERY. Discovery kit with STM32F407VG MCU. Features. Description

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

STTH110. High voltage ultrafast rectifier. Description. Features

AN4368 Application note

AN1754 APPLICATION NOTE

STP10NK80ZFP STP10NK80Z - STW10NK80Z

Transcription:

User manual Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software Introduction This document provides an introduction on how to use IAR Embedded Workbench for ARM software development toolchain (EWARM version 5.40 and later) with the STM32VLDiscovery board. It provides novice users of the IAR Embedded Workbench with some guidelines to build and run a sample program provided with this document. This should provide them with the skills required to create and build their own applications. The DISCOVER project, referenced in this document, corresponds to the demo Flashed into the STM32VLDISCOVERY board during production. The project is available within the STM32VLDISCOVERY firmware package available at http://www.st.com/stm32vldiscovery. Although this application note cannot show all the topics relevant to IAR Embedded Workbench tool, it demonstrates the first basic steps necessary to get started with the compiler/debugger. September 2010 Doc ID 17875 Rev 1 1/19 www.st.com

Contents UM0985 Contents 1 About IAR Embedded Workbench for ARM toolchain.............. 3 2 Starting an existing IAR Embedded Workbench project............ 4 3 Creating your first application................................. 9 3.1 Source file management...................................... 9 3.2 Project options configuration.................................. 12 4 Revision history........................................... 18 2/19 Doc ID 17875 Rev 1

About IAR Embedded Workbench for ARM toolchain 1 About IAR Embedded Workbench for ARM toolchain The IAR Embedded Workbench for ARM is a window-based software development platform that combines a robust and modern editor with a project manager and make facility tool. It integrates all the tools needed to develop embedded applications including C/C++ compiler, macro assembler, linker/locator, and a HEX file generator. The IAR Embedded Workbench helps expedite the development process of embedded applications by providing the following: Integrated development environment with project management tools and editor. Highly optimizing C and C++ compiler for ARM. Automatic checking of MISRA C rules (MISRA C:2004). ARM EABI and CMSIS compliance. Run-time libraries including source code. Relocating ARM assembler. Linker and librarian tools. C-SPY debugger with ARM simulator, JTAG support and support for RTOS-aware debugging on hardware. RTOS plugins available from IAR Systems and RTOS vendors. User and reference guides in PDF format. Context-sensitive online help. Doc ID 17875 Rev 1 3/19

Starting an existing IAR Embedded Workbench project UM0985 2 Starting an existing IAR Embedded Workbench project Installing the IAR Embedded Workbench toolchain (using the default settings) results in the toolchain being installed in C:\Program Files\IAR Systems\Embedded Workbench 5.4 on the PC s local hard disk. To start an existing project, follow these steps: 1. Open IAR Embedded Workbench from the Start menu. Figure 1 shows the names of the windows referred to in this document. Figure 1. IAR Embedded Workbench windows Files window Workspace window Build window 4/19 Doc ID 17875 Rev 1

Starting an existing IAR Embedded Workbench project 2. Select Open -> Workspace... from the File menu. Figure 2. Open workspace 3. From the Open Workspace dialog box, browse and find DISCOVER.eww. Figure 3. Find Discover.eww Doc ID 17875 Rev 1 5/19

Starting an existing IAR Embedded Workbench project UM0985 4. Double-click this file to launch it within the Project window Figure 4. Launch the project 5. Select Rebuild All from the Project menu. Figure 5. Rebuild all 6/19 Doc ID 17875 Rev 1

Starting an existing IAR Embedded Workbench project 6. Your project is successfully compiled. Figure 6. Successful compile 7. Before running your application, you should establish the connection with the STM32VLDiscovery board as shown in Figure 7. Figure 7. Hardware environment Computer with EWARM running STM32VLDISCOVERY USB cable type A to mini-b Note: For more details on how to establish your hardware environment you can refer to the UM0919 User Manual: STM32VLDiscovery board available at www.st.com/stm32-discovery. 8. Choose Project>Download and Debug. Alternatively, click the Download and Debug button in the toolbar to program the Flash and begin debugging. Figure 8. Download and debug a project Doc ID 17875 Rev 1 7/19

Starting an existing IAR Embedded Workbench project UM0985 9. The debugger in IAR Embedded Workbench allows for source code debugging at C and assembly levels, breakpoint setting, individual variables monitoring and watching during the code execution. Figure 9. Debug screens 10. Choose Debug>Go. Alternatively, click the Go button in the toolbar to run your application. Figure 10. Go button If everything is working correctly, LED3 should be blinking. Every time the user button is pressed, the LED3 blinking frequency changes and LED4 turns on. 8/19 Doc ID 17875 Rev 1

Creating your first application 3 Creating your first application 3.1 Source file management 1. Select Create New Project from the Project menu. Figure 11. Create New Project 2. Click on OK. Figure 12. Create New Project OK Doc ID 17875 Rev 1 9/19

Creating your first application UM0985 3. Name the project newproj.ewp. 4. Click on Save. Figure 13. Save newproj.ewp 5. The IDE interface is displayed. Figure 14. IDE 10/19 Doc ID 17875 Rev 1

Creating your first application 6. You may create a new source file with the menu File New File. This opens an empty editor window where you can enter your source code. IAR Embedded Workbench enables the C color syntax highlighting when you save your file with the dialog File Save As under a filename with the extension *.c. We are saving our example file under the name main.c. Figure 15. Main.c 7. Once you have created your source file you can add this file to your project by selecting Add -> Add main.c. Figure 16. Add Files Your main.c file is successfully added. Doc ID 17875 Rev 1 11/19

Creating your first application UM0985 Figure 17. Successful creation of main.c.. 3.2 Project options configuration 1. Right-click on the project name in the Project window. 2. Select Options. Figure 18. Select options 3. Select General Options - Target. Figure 19. Target options 12/19 Doc ID 17875 Rev 1

Creating your first application 4. Select Device - ST -STM32F100xB. Figure 20. Select device Doc ID 17875 Rev 1 13/19

Creating your first application UM0985 5. Select Linker - Config. Figure 21. Linker configuration options 6. Check Override default linker. 7. Click on Edit. 8. Set the.intvec.start at 0x08000000. Figure 22. Save vector table 9. Fill memory regions. Figure 23. Define memory regions 10. Click on Save to save the linker settings. The linker file is saved automatically under the project directory. 14/19 Doc ID 17875 Rev 1

Creating your first application 11. If your source files include header files, you should specify their paths in the project settings as shown in Figure 24. Figure 24. Include header files 12. The path of the include directory is a relative path, it always starts by the project directory location referenced by $PRO J_D IR$ 13. Select Debugger - Set up. 14. Choose ST-Link from the Driver menu Figure 25. Select ST-Link 15. Select Download and check the Use Flash loader(s) case. Figure 26. Use Flash loader(s) Doc ID 17875 Rev 1 15/19

Creating your first application UM0985 16. Select ST-Link and SWD as connection protocol. Figure 27. Select SWD protocol 17. Click on OK to save the project settings. 18. Build your project using Project -Rebuild All. 19. IAR Embedded Workbench then asks you to save your workspace. Save it under the name newproj.eww. Figure 28. Save workspace 16/19 Doc ID 17875 Rev 1

Creating your first application 20. In the Build window it should report 0 Errors (s), 0 Warnings. Figure 29. Success 21. Before running your application, you should establish the connection with the STM32VLDiscovery board as shown in Figure 7: Hardware environment. 22. Choose Project>Download and Debug to program the Flash and begin debugging. 23. Now you can start debugging your application. Doc ID 17875 Rev 1 17/19

Revision history UM0985 4 Revision history Table 1. Document revision history Date Revision Changes 09-Sep-2010 1 Initial release. 18/19 Doc ID 17875 Rev 1

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. 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. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2010 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com Doc ID 17875 Rev 1 19/19