Home
Developing your STM32VLDISCOVERY application using the IAR
Contents
1. 7671 1 0985 YZ 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 hISIOFV a ween
2. Download and Debug 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 F IAR Embedded Workbench IDE File Edit view Project D c amp pe um x ra a EL CL Debug screens Debug Disassembly 5T Link Tools Window Help Output Return Xxx GPIOA GPIOA IDR GPIOA ODR GPIOA BSRR GPIOA GPIOA Files E EJ DISCOV CMSIS DOC EWAR StdPeri STM32 User Je gt DISCOVER son int mainiwoid 1 09000129 Enable and RCC APBlPeriphtlno RCC APBlPeriphtlno RCC APBlPeriphtlno a 1 0 12 0 8000130 20000000 20000010 20000020 20000030 20000040 20000050 20000060 20000070 20000050 20000090 800075t 800075t cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdced cdcdcdcd cdcdcdcd cdcdcdcd 0800063 08000763 cdcdcdced cdcdcdced cdcdcdced cdcdcdced g8uu 767 cdedcded cdcdcdcd cdcdcdcd cdcdcdc
3. 0 0 20000000 _ox20002000 10 Click on Save to save the linker settings The linker file is saved automatically under the project directory 4 Doc ID 17875 Rev 1 UM0985 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 CIC Compiler Assembler Output Converter Language Code Optimizations Output List Preprocessor D 41 Custom Build Build Actions ignore standard include directories TOOLKIT DIR Linker Debugger Additional include directores one per line Simulator Angel GDB Server TAR ROM monibar 12 The path of the include directory is a relative path it always starts by the project directory location referenced by PRO J D TR 13 Select Debugger Set up 14 Choose ST Link from the Driver menu Figure 25 Select ST Link Assembler LA Output Converter Setup Download Images Extra Options Plugins Custom Build Build Actions Driver Run to Linker AEN main Debugger Simulator Setup macros Angel Use macro nieis GDB Server 15 Select Download and check the Use Flash loader s case Figure 26 Use Flash loader s Output Converter Setup Download Images Extra Options Plugins Custom Build Build Actions ine Verify download Attach to program De
4. 18 2 19 Doc ID 17875 Rev 1 Ay UMO0985 1 About IAR Embedded Workbench for ARM toolchain 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 e Integrated development environment with project management tools and editor e Highly optimizing C and C compiler for ARM e Automatic checking of MISRA C rules MISRA C 2004 e ARM and CMSIS compliance e Run time libraries including source code e Relocating ARM assembler e Linker and librarian tools e C SPY debugger with ARM simulator JTAG support and support for RTOS aware debugging on hardware e RTOS plugins available from IAR Systems and RTOS vendors e User and reference guides in PDF format e 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 FilesUAR Systems Embedded Workbench
5. 19 Revision history UMO985 4 Revision history Table 1 Document revision history BINE NENNEN EN 09 Sep 2010 Initial release 18 19 Doc ID 17875 Rev 1 Ay UM0985 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 U
6. 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 Embedded Workbench windows IAR Embedded Workbench IDE File Edit View Project Tools Window Help Workspace Files window Workspace window Messages Build window 4 19 Doc ID 17875 Rev 1 Ay UMO985 Starting an existing IAR Embedded Workbench project 2 Select Open Workspace from the File menu Figure 2 Open workspace Edit View Project Simulator Tools Window Help New K R m Workspace Save Workspace Close Workspace Save CTRL 5 Save All Page Setup 4 Ti Recent Files Recent Workspaces Exil 3 From the Open Workspace dialog box browse and find D SCOVER eww Figure3 Find Discover eww Open Workspace Look in EWARIMYS O F P El Documents Desktop Mu Documents Computer Um a File name DISCOVER EWW v My Network Files of type Workspace Files ewnw v 4 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 MEE JAR Embedded Workbench IDE PIE File Edit View Project Tools Window Help D Ng m 5 Rm EA oc Files CH DISCOSVEHR DIS CMSIS I DOC EARMS
7. SE 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 Chin
8. StdPeriph_Driver STM32_Discovery ser Output DISCOVER 5 Select Rebuild All from the Project menu Figure 5 Rebuild all IAR Embedded Workbench IDE File Edit View BET Tools Window Help e Add Files Add Group Import File List Edit Configurations Remove Create New Project Add Existing Project Options OLT F Source Code Contral Make Cam pile CTRL F Rebuild All Clean Batch build Fa Stop Build CTRL 4TTH 6 19 Doc ID 17875 Rev 1 ky UMO0985 Note 4 Starting an existing IAR Embedded Workbench project 6 Your project is successfully compiled Figure 6 Successful compile Messages Errors none Warnings nane Link time 0 05 CPL 0 03 elapsed Total number of errors 0 Total number of warnings 0 Ready 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 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 gt 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
9. a 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 SZ Doc ID 17875 Rev 1 19 19
10. bugger Suppress download t Use flash loaders GDB Server Override default board file 4 Doc ID 17875 Rev 1 15 19 Creating your first application UMO985 16 Select ST Link and SWD as connection protocol Figure 27 Select SWD protocol Assembler Output Converter ST Link Custom Build Build Actions Linker Debugger Simulator Interface OUTAG Angel Sw GDB Server ROM monitor J Link J Trace LMI FTOI Macraiqar RDI ST Link Third Party Driver 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 Save as type Workspace Files v lt 1 6 19 Doc ID 17875 Rev 1 UM0985 Creating your first application 20 In the Build window it should report 0 Errors s 0 Warnings Figure 29 Success Messages Errors none Warnings nane Link time 0 05 CPU 0 03 elapsed otal number of errars U Total number of warnings U 21 Before running your application you should establish the connection with the STM32VLDiscovery board as shown in Figure 7 Hardware environment 22 Choose Project gt Download and Debug to program the Flash and begin debugging 23 Now you can start debugging your application Ayr Doc ID 17875 Rev 1 17
11. c ID 17875 Rev 1 ST STM32FIUUXB ST STM32F105x8 ST STM32F105xB ST STM32F1 05xC ST STM S2F10 x6 ST STMS2F10 xC ST STMS2F 10xx4 ST STMS2F10xx6 ST STMS2F10xx6 ST STM32F1UxxB ST STMS2F10xxC ST STM32F1 xxD ST STM32FIUxxE ST STM32ZF1IUxxF ST STMS2F10xx6 ST STM32F2Uxxx ST STM32L15xx8 ST STM32L15xxB ST STM32w1 08 ST STR 710 ST STE 711 ST STR 712 ST STR 715 ST STR 730 ST STR 731 ST STR 735 ST STR 736 ST STE 750 ST STR 751 ST STR 52 ST STR 755 ST STR910F ST ST STR211F ST STR311FA ST STR311FA x46 ST STR311FA x4 ST STR312F ST STR312FA ST STR312FA x46 ST STRS12FA x4 13 19 Creating your first application UMO985 14 19 5 Select Linker Config Figure 21 Linker configuration options Assembler Output Converter Config Libra Input Output List Diagnostics Custom Build Build Action Linker configuration file Override default Linker Debugger Simulator 6 Check Override default linker 7 Click on Edit 8 Setthe intvec start at OxO8000000 Figure 22 Save vector table Linker configuration file editor vector Table Memory Regions Stack Heap Sizes start 008000000 Save Cancel 9 Fill memory regions Figure 23 Define memory regions Linker configuration file editor vector Table Memory Regions Stack Heap Sizes Start End 008000000 0x0802000
12. d cdcdcdcd cdcdcdcd cdcdcdcd Us000765 cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd cdcdcdcd Ln 43 Col 10 Choose Debug gt 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 LEDS blinking frequency changes and LED4 turns on Doc ID 17875 Rev 1 4 UMO0985 3 Creating your first application 3 1 Source file management 1 Select Create New Project from the Project menu Figure 11 Create New Project JF IAR Embedded Workbench IDE File Edit View WES Tools Window Help Lot 101715 a Creating your first application Source Code Control 2 Click on OK Figure 12 Create New Project OK Create Mew Project Tool chain Project templates Empty project GH asm l DLIB lt lt Externally built executable Description Creates an empty project ky Doc ID 17875 Rev 1 9 19 Creating your first application UMO985 3 Name the project newproj ewp 4 Click on Save Figure 13 Save newproj ewp Documents Desktop MU Documents Computer File name save as type Project Files ewp v 5 The IDE interface is displa
13. ject window 2 Select Options Figure 18 Select options Options Rebuild All Clean 3 Select General Options Target Figure 19 Target options Options for node newpro Category General Options Assembler Output Converter Target utput Library Configuration Library Uptions MISRA C 200 ms Custom Build Build Actions Linker Debugger Core Processor variant Simulator ios ODE Server IAR ROM monitor J Link J Trace LMI FTOI Macraigor 95 Little RDI Q Big ST Link br o Third Party Driver Endian made 4 12 19 Doc ID 17875 Rev 1 UM0985 Creating your first application 4 Select Device ST STM32F100xB Figure 20 Select device Options for node newpro Category General Options 2 ee Assembler Output Converter Target Library Configuration Library Options MISRA C 200 7 Custom Build Build Actions Linker Debugger Core Simulator in Device SDB Server Mone ROM manibar 1 Actel J Link J Trace End M LMI ndian made nalagDevices Macraigar gt Little Aime RDI Big Cirrus ST Link EnergyMicro Third Party Driver Epson Faraday Freescale Processor variant Fujitsu Hilscher Intel Marvell Micronas Met Silicon Nureobon MXP OKT Samsung Socle 4 Do
14. yed Figure 14 IDE IAR Embedded Workbench IDE Sele File Edit wiew Project Simulator Tools Window Help Workspace Files v 1 0 19 Doc ID 17875 Rev 1 UM0985 Creating your first application 6 You may create a new source file with the menu File New File This opens 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 main c int main 10141 returni i 7 Once you have created your source file you can add this file to your project by selecting Add gt Add Figure 16 Add Files IAR Embedded Workbench IDE Sel File Edit View Project Simulator Tools Window Help D cx E Gl Workspace E int main F Files returni m n Options Make Rebuild All Clean e Add main c Add Group Remove TI PTE zourre Code Control K lt Add the File Properties Your main c file is successfully added 4 Doc ID 17875 Rev 1 11 19 Creating your first application UMO985 Figure 17 Successful creation of main c main c 3 2 Project options configuration 1 Right click on the project name the Pro
Download Pdf Manuals
Related Search
Related Contents
SE Flange Mounted, Spring-Engaged Brakes 20084 Data Entry User Manual programmable transducer of temperature and standard VoIP Analog Telephone Adapter User`s manual BS Series B A B Y S H O W E R & P R E C IO U S User Guide to refill Snowpulse cylinders Samsung T22B300MW دليل المستخدم SELIAtec S.A.S. 53, rue de Rountzenheim B.P. 34 67620 Copyright © All rights reserved.
Failed to retrieve file