Home
UM1467 User manual - STMicroelectronics
Contents
1. e71 UM1467 YZ User manual Getting started with software and firmware environments for the STM32F4DISCOVERY Kit 1 Introduction This document describes the software firmware environment and development recommendations required to build an application around the STM32F4DISCOVERY board It presents the firmware applications package provided within this board with details on its architecture and contents 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 is structured as follows m System requirements to use this board and how to run the built in demonstration are provided in Section 2 Getting started B Section 3 describes the firmware applications package B Section 5 presents development toolchain installation and overview of ST LINK V2 interface m Section 6 Section 7 Section 8 and Section 9introduce how to use the following software development toolchains TAR Embedded Workbench for ARM EWARM by IAR Systems Microcontroller Development Kit for ARM MDK ARM by Keil TrueSTUDIO by Atollic TASKING VX toolset for ARM Cortex by Altium Although this user manual cannot cover all the topics relevant to software development environments it demonstrates the first basic steps necessary to get started with the compilers debuggers Reference documents B SIM32FADISCOVERY high performance discovery board data
2. Click Save to save the linker settings automatically in the Project directory Doc ID 022172 Rev 1 UM1467 i Using IAR Embedded Workbench for ARM 7 f your source files include header files select the C C Compiler category open the Preprocessor tab and specify their paths as shown in Figure 18 The path of the include directory is a relative path and always starts with the project directory location referenced by SPROJ DIR Figure 18 C C Compiler gt Preprocessor tab CIC4 Compiler Assembler Output Converter Language Code Optimizations Dutput List Preprocessor D sai Custom Build Build Actions C Ignore standard include directories TODLKIT DIR MINEN Linker Debugger Additional include directories one per line Simulator Angel GDB Server TAP ROM monitor 8 To set up the ST Link embedded debug tool interface select the Debugger category open the Setup tab and from the drop down Driver menu select ST Link as shown in Figure 19 Figure 19 Debugger 5 Setup tab Assembler EE Output Converter Setup Download Images Extra Options Plugins Custom Build Build Actions i Run to Linker Cc oie J main Debugger Simulator Setup macros Angel Use macro file s GDB Server CTTO 9 Open the Debugger tab and select Use flash loader s as shown in Figure 20 Figure 20 Select Flash loaders Output Converter Setup Download Images Extra Options Plugins Custom B
3. Select root directory C PWA 2007 Manks Discovery KUFIRMWA Browse 3 Select archive ffe Projects STMS2F4 Discovery_Demo CAPRA 20071Manta Discovery KEF Select Al Deselect all Refresh 4 Copy projects nto workspace Working sets Add project to working sets 6 Inthe Projects pane select the STM32F4 Discovery and click Finish 7 Inthe Project Explorer select the STM32F4 Discovery project Open the Project menu and click Build Project 8 If your project is successfully compiled the following window is displayed Figure 40 TrueSTUDIO project successfully compiled HE bro kina ij Taas O casas 77 NA Pogai p Pong cas It d ka a w UL C R dh STEFA Diana IJ AYES PO0kLS007 Kanta Discovery Ki FIPBUARZ Froierct Peripaners1 Exsmpises PCC Tru esTUDIO PCC Librsriesz cHs 7 IB CH3 Devire3unpparr BET 3TEsz723 Un o5rn agapslce wich cpp aTEeGesTUBIOA srarrup atwizf4xw n EMT hte hirer iege CASTA AT ATHA Pass Baur ie Temp Imre Tris S TORTS apar tap mrtm3zIAxx oa acoratollic sabi gec lser amp Meysten stmisti xs o Userieboetdan_it o Userinmain o IrwenIUDICAstarcup stxizfdxx o STHI2F4xe_StdPeciph Driver scmlJ2f4xx rcc d STE32Fdxx StdPeriph Drliver stwmiz25xx qgpio 2 SITEIT ScdPeriph Driverhizisc c ETES2F4 DiazrawcEevy iadrn3zri Blasogvary co o ETH3EJT DizcoavcEWv clf ibEumbh COC Ng T 3arm3rz floch ld pbuHtirm mrepui rnurEbgs nd mi p r H i Renel Hamitler WI Fap ETEZ2PF
4. 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 2011 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 AY Doc ID 022172 Rev 1 46 46
5. a debug session Doc ID 022172 Rev 1 UM1467 Using MDK ARM Microcontroller Development Kit by Keil The debugger in the MDK ARM IDE can be used to debug source code at C and assembly levels set breakpoints monitor individual variables and watch events during the code execution as shown below in Figure 25 Figure 25 MDK ARM IDE workspace V IDISGOVERGSHVISIOD A File Edit View Project Flash Debug Peripherals Extension ExtensionB Tools Window Help GABI RC R NET RI ELO 000 0 7 SCS is m mum uum y JET a P ges Registers lw 8X Disassembly Co a E Piste 58 Enable PUR and GPIOx Clocks 008000465 decens 58 RCC APBiPeriphClockCmd RCC APBiPeriph PWR ENABLE Ox0800098A 2101 Moves ri 0x01 Ox0800048c 0708 LSLS ro ri 28 Ox0800098E FYFFFEE1 BL W RCC APBiPeriphClockCmd Ox08000 is Bb RCC APBlPeriphcClockUomd RCC APBzPeriph GPIOC ENABLES in HB Dx00000000 c n9nnnaao 94n4 More mi d4neni H R7 Ox00000000 R8 Ox00000000 in RE Ox00000000 B ps R10 OxQ0000000 cu ATT Ox0Q0000000 pena CODO DONI c R13 SP Ox200004 35 uu F 14 LA Ox08000175 sa F15 PC 8000488 NE Ph co nternal Ox0200047b OxOB00063c Main program Kone Description ofrgput ntput Kone Bogen ORE fie tte ee a lt lt xbox a ooo at oe ot lt tt oo at lt lt oo lt ot lt lt Xxx ot ak of ak ot 056 int mainivoidi Icos H 058 Enable PWE and GPIUx Clocks 05
6. brief B SIM32FADISCOVERY peripherals firmware examples AN3983 BH STM32F40x reference manual RM0090 B STM32F405xx STM32F407xx datasheet The above documents are available at www st com stm32f4 discovery September 2011 Doc ID 022172 Rev 1 1 46 www st com UM1467 Contents Contents 1 INUOGUCGHON ss xc3234RxEEESURPE A KA DRAKE MEAN KA ESSERE REA 1 2 Gening Started osos bau Ed ux Rr AA AA 4 2 1 System requirements llle 4 2 2 Running the built in demonstration llle 5 3 Description of the firmware package 6 3 1 Libraries folder 0 0 0 ccc ee ne 6 3 1 1 CMSIS subfolder 2 oud vex sw te eee ba ewe ew be kala 1 9 Ha 6 3 1 2 STM32 USB Device Library subfolder 7 3 1 3 STM32 USB HOST Library subfolder 0005 7 3 1 4 STM32 USB OTG Driver subfolder llli 7 3 1 5 STM32F4xx StdPeriph Driver subfolder nnana nananana naaa 7 3 2 mese seen rrine ETERNE Hho BREER ELETE RRAS 7 3 2 1 Demonstration subfolder 0 0 0 cee eee 7 3 2 2 Master Workspace subfolder 0 0 00 cece ee eee 8 3 2 3 Peripheral Examples subfolder aaa 8 3 3 Uulites tolder AA AY 8 4 Binary images for reprogramming firmware applications 9 5 ST LINK V2 installation and development 10 6 Using IAR Embedded Workbench for ARM 11 6 1 Building an existing EWAR
7. fully CMSIS compliant High performance is achieved through maximum use of Cortex M4F intrinsics STM32F4xx CMSIS files consist of stm32f4xx h this file contains the definitions of all peripheral registers bits and memory mapping for STM32F4xx devices The file is the unique include file used in the application programmer C source code usually in the main c system stm32f4xx c h This file contains the system clock configuration for STM32F4xx devices It exports SystemInit function which sets up the system AY Doc ID 022172 Rev 1 6 46 Description of the firmware package UM1467 3 1 2 3 2 3 2 1 clock source PLL multiplier and divider factors AHB APBx prescalers and Flash settings This function is called at startup just after reset and before connecting to the main program The call is made inside the startup stm32f4xx s file startup stm32f4xx s Provides the Cortex MAF startup code and interrupt vectors for all STM32F4xx device interrupt handlers STM32 USB Device Library subfolder This subfolder contains USB Device Library Core and the class drivers The Core folder contains the USB Device library machines as defined by the revision 2 0 Universal Serial Bus Specification The Class folder contains all the files relative to the Device class implementation It is compliant with the specification of the protocol built in these classes STM32 USB HOST Library subfolder This subfolder contains USB Hos
8. images to reprogram the firmware applications The STM32F4DISCOVERY firmware package contains binary images hex and dfu of the provided applications which allow to use the STM32F4xx s embedded Bootloader or any in system programming tool to reprogram these applications easily Below are the steps to follow e Using in system programming tool Connect the STM32F4DISCOVERY board to a PC with a USB type A to Mini B cable through USB connector CN1 to power the board Make sure that the embedded ST LINK V2 is configured for in system programming both CN3 jumpers ON Use hex binary for example Project Demonstration Binary S TM32F4 Discovery Demonstration V1 0 0 hex with your preferred in system programming tool to reprogram the demonstration firmware ex STM32 ST LINK Utility available for download from www st com e Using Bootloader USB FS Device in DFU mode Configure the STM32F4DISCOVERY board to boot from System Memory boot pins BOOTO 1 BOOT1 0 Set BOOTO pin to high level on the male header P2 place a jumper between BOOTO pin and VDD pin Set BOOT 1 PB2 pin to low level on the male header P1 place a jumper between PB2 pin and GND pin Connect a USB type A to Mini B cable between PC and USB connector CN1 to power the board Connect a USB type A to Micro B cable between PC and USB connector CN5 the board will be detected as USB device Use dfu binary for example Project Demonstration Binary
9. shows the first step for debugging and running your TASKING project From the project toolbar menu select Debug gt Debug STM32F4 Discovery Demo Figure 53 TASKING debug window w TASKING Debug 5TM37F4 Discovery Demodlserfmaln c TASKING VX loolse for ARM Corie t Im Fie Ect Source Refactor Nasigate Search Project Debug Window Hep Pa aig So J tt dm mu Ni E339 TASKING Debug i o yo 7 TASKING CIC LE M Debug ij O t variable C Po Breakpo Ci WM TASKING Registers an E 4 Cj a A7 ES EFE am 3 T sTM3zP4 Deenveny Demo TASA 3 GFP TASKING Debugger 9 15 11 iba zou Thread L ARM Susp Ox40023600 2 mai main c700 3 rc BOIS d e E 2 d hert rckortll rnc 0 xp PR O bii TASKING Dissssembly E Address 0002578 Ecole Zi tot o Copyright 2008 2011 Altium EV ni ARE debug instrument is running in tris Loading application CiW b ocumenEg and 3 na The debugger in TASKING 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 your application from the Run menu select Resume or alternatively click the Resume button in the toolbar Doc ID 022172 Rev 1 40 46 i Using TASKING UM1467 9 3 Creating your first application using TASKING toolchain The debug session is launched as follows 1 Open TASKING VX Toolset for ARM Cortex The program launches and asks for the Workspace locat
10. 0 F Use Cross Module Opimizatan lt i Use Merl r Resad Oriy Memory Areas detak off chip ia Startup defauk off chip Start 3 Open the Debug tab click Use and select the ST Link Debugger Then click Settings and select the SWD protocol Click OK to save the ST Link setup settings 4 elect Run to main a 25 46 Doc ID 022172 Rev 1 UM1467 Using MDK ARM Microcontroller Development Kit by Keil Figure 33 Target Options dialog box Debug tab x Linker Gebua utiities Linker Utilities Use ADI Interface Driver Settings Hee Use 5T Link D ebugger Settings ULINE Cortex Debugger ACI Interface Driver q Load tera Blaster Cortex Debugger i Iv Load Application at Startup Sun to maini 5tellaris ICI Initialization File ST Link E Debugge Ed L Brtes I ME Al T race oe STLink Setup i ULINE Fra Cortes Debug ger Protocol C JTAG 5 Open the Utilities tab select Use Target Driver for Flash Programming and select the ST Link Debugger from the drop down menu 6 Verify that the Update Target before Debugging option is selected 7 Click OK to save your settings Figure 34 Target Options dialog box Utilities tab m SEX m User C C Asm Linker Debug Configure Flash Menu Command u ze Target Driver for Flash Programming ULINK Cortes Debugger E tv i update Target before Debugging ULINE Cortes Debugger Tm Init File
11. 5mxreis m 7 3TMxzF217 a Emef Ca Smera O STATE O STA22F4011G a a i SO E STEFA gt sierra D smazano To configure the project for Manta DISCOVERY board select Debug gt Debug configurations and choose STMicroelectronics STM32F4 Manta Discovery Kit Choosing STMicroelectronics STM32F4 Manta Discovery Kit as the evaluation board will add automatically the needed linker file and will configure the project as follows e Microcontroller STM32F407VGT6 e Debug probe ST LINK e Connection Serial Wire Debugging SWD Figure 57 Debug configuration Project window Help m G 1 Debug 5TM3 PF4 Discovery Demo i Doc ID 022172 Rev 1 42 46 Using TASKING UM1467 4 To add source file to your project right click on the project from the C C project window and select Import 5 The Import dialog box is displayed select General and the desired file as shown in Figure 58 TASKING Import dialog box Figure 58 TASKING Import dialog box Select Create new projects from an archive File or directory Select an import source i lob General S Archive File BF itn Projects nto Workspace Fle System Preferences cic ko CYS gt RuniDebug Be Lek TASKING C C bil eee Team 6 Click Next Fill the displayed window as following and then browse to your source file a 43 46 Doc ID 022172 Rev 1 UM1467 a Using TASKING Figure 59 Adding a new source file window LB import File syste
12. 9 ROC APElPeriphClockCmAd RCC APElPeriph PUR ENABLE WRiRt Wh id 4 k CA DOT nDRdLDawdinuh Himel7 dd D ADCR DODSrinh ADOTT Address D 20000000 i Ox20000000 Ox20000020 Ox20000040 Ox20000060 Ox20000050 Ox200000A0 Ox200000CO0 Ox2Q00000EO0 E3Call stack FAlocals 00000000 04030201 00000000 O0000000 00000000 00000000 00000000 00000000 00000000 o906o0706 00000000 00000000 00000000 00000000 00000000 00000000 hatch 1 D0000000 20010800 D0000000 D0000000 O0000000 D0000000 O0000000 D0000000 00000000 20011000 00000000 O0000000 00000000 O0000000 00000000 O0000000 Ig symbols ST Link Debugger E 00000000 20011000 00000000 O0000000 00000000 O0000000 00000000 O0000000 O16E3600 oo000000 00000000 O0000000 00000000 00000000 00000000 O0000000 00000000 OD000000 00000000 OD000000 00000000 OD000000 OD000000 OD000000 00000000 O0000000 00000000 O0000000 00000000 O0000000 00000000 O0000000 Doc ID 022172 Rev 1 22146 Using MDK ARM Microcontroller Development Kit by Keil UM1467 7 3 7 3 1 Note 23 46 Creating your first application using the MDK ARM toolchain Managing source files Follow these steps to manage source files 1 In the Project menu select New pVision Project to display the Create Project File dialog box Name the new project and click Save Figure 26 Creating a new project Project Flash Debug Periph
13. BD Interface Driver a E dit Stellaris ICD Signum Systeme JTAG jet C UseEsterpeanpig prem seo MEE Al Trace Arguments Rurinde pendent a Cancel Defaults 8 Inthe Project menu select Build Target 9 f your project is successfully built the following window is displayed Doc ID 022172 Rev 1 26 46 i Using MDK ARM Microcontroller Development Kit by Keil UM1467 27 46 Figure 35 MDK ARM pVision4 project successfully built 11 Build Output Build target Taryet 1 linking Program Size Code 344 Ro data 408 Ril data U0 zI data 183Z TMeuvProjecr axt 0 Error ial O WarnindgizLi Before running your application establish the connection with the STM32F4DISCOVERY board as described in Section 2 Getting started To program the Flash memory and begin debugging follow the instructions given in Section 6 2 Debugging and running your EWARM project on page 12 Doc ID 022172 Rev 1 ky UM1467 8 8 1 Using Atollic TrueSTUDIO Using Atollic TrueSTUDIOG Building an existing TrueSTUDIO project 1 Open the TrueSTUDIOG STM32 product folder and select the Atollic TrueSTUDIO STM32 product name The program launches and asks for the Workspace location Figure 36 TrueSTUDIO workspace launcher dialog box amp Workspace Launcher Select a workspace Akollic TrueS TUDIO J5TM32 Lite stores your projects in a folder called a workspace Cho
14. Driver TL XDS100 Erden mode DEA vx x 5T 5TM321151 5T 5TM321151xB 5T STM32L152x8 ST STMX2L152x8 5T 5TM32W 18 5T 5TRT1D ST STR711 5T STR 712 5T 5TR 715 5T STR 73D ST SIRIA 5T STR 735 5T STR FIG 5T 5TR73D ST STRTSI ST STR 7S2 ST STR755 3T S5TR910F ONSemiconduckor Samsung LI b k b LI I i LI LI b ir i b h i b i F EF Doc ID 022172 Rev 1 16 46 Using IAR Embedded Workbench for ARM UM1467 17 46 3 elect the Linker category open the Config tab in the Linker configuration file pane select Override default and click Edit to display the Linker configuration file editor Figure 15 Linker 5 Config tab Assembler Output Converter Config Libra Input Output List define Diagnostics Custom Build Build Acti Linker configuration file Debugger Override default Simulator 4 Inthe Linker configuration file editor dialog box open the Vector Table tab and set the intvec start variable to 0x08000000 Figure 16 Linker configuration file editor dialog box Vector Table tab Linker configuration file editor Vector Table Memory Regions Stack Heap Sizes inbwec stark Ox08000000 Save Cancel 5 Open the Memory Regions tab and enter the variables as shown in Figure 17 Figure 17 Linker configuration file editor dialog box Memory Regions tab Linker configuration file editor End Ox 0000000 En E ET E Save Cancel 6
15. EF4 DescoveryATraeSTUDIOYSTHM KI STE Successufuliy completed reset operation Tort Imet gi 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 your application from the Run menu select Resume or alternatively click the Resume button in the toolbar Creating your first application using TrueSTUDIO toolchain TrueSTUDIO includes a dedicated connection to the STM32F4DISCOVERY board When choosing this connection all required files startup file firmware library etc are added to the workspace and sample files are generated in the project folder to simplify development The debug settings are automatically configured by selecting STM32FADISCOV ERY as the evaluation board Follow these steps to create your first application using TrueSTUDIO toolchain 1 Open the TrueSTUDIOG STM32 product folder and select the Atollic TrueSTUDIO STM32 product name The program launches and asks for the Workspace location Browse to select an existing workspace or enter a new workspace location and click OK to confirm Doc ID 022172 Rev 1 32 46 Using Atollic TrueSTUDIO UM1467 Figure 43 TrueSTUDIO workspace launcher dialog box amp Workspace Launcher Select a workspace 4tollic TrueS TUDIO mJ5TM32 Lite stores your projects in a folder called a workspace Choose a workspace Folder to use Far thi
16. ID 022172 Rev 1 ky 7 46 UM1467 3 2 2 3 2 3 3 3 Description of the firmware package A binary images hex and dfu of this demonstration is provided under Binary subfolder You can use the STM32F4xx s embedded Bootloader or any in system programming tool to reprogram the demonstration using this binary image Master Workspace subfolder This subfolder contains for some toolchains a multi project workspace allowing you to manage all the available projects provided under the subfolders listed below from a single workspace window Peripheral Examples subfolder This subfolder contains a set of examples for some peripherals with preconfigured projects for EWARM MDK ARM TrueSTUDIO and TASKING toolchains See Section 5 and STM32F4DISCOVERY peripheral firmware examples AN3983 for further details Utilities folder This folder contains the abstraction layer for the STM32F4DISCOVERY hardware It provides the following drivers stm32f4_discovery c provides functions to manage the user push button and 4 LEDs LD3 LD6 stm32f4 discovery audio codec c h provides functions to manage the audio DAC CS43L22 stm32f4 discovery lis302dl c h provides functions to manage the MEMS accelerometer LIS302DL Doc ID 022172 Rev 1 8 46 Binary images for reprogramming firmware applications UM1467 4 9 46 Binary images for reprogramming firmware applications This section describes how to use the provided binary
17. M 4 f your project is successfully compiled the following window in Figure 4 is displayed Figure 4 EWARM project successfully compiled Messages Errors none Warnings none Link time O 05 CPU 0 03 elapsed Total number of errors D Total number of warnings 6 2 Debugging and running your EWARM project In the IAR Embedded Workbench IDE from the Project menu select Download and Debug or alternatively click the Download and Debug button the in toolbar to program the Flash memory and begin debugging Figure 5 Download and Debug button T X Download and Debug The debugger in the 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 STi Doc ID 022172 Rev 1 12 46 Using IAR Embedded Workbench for ARM UM1467 Figure 6 IAR Embedded Workbench debugger screen IAR Embedded Workbench IDE Fie Edt View Project Debug Disessembly ST IME Took Window Help iD o Ad Ha amp z TET I ACESTIA amma mi ox Current CPU Registers na RO Ox00000000 Ox09005ECC 0208006283 x2 00017C Ox00000000 0x200000009 OBx00000000 Files fs 8 S MEADER ee Disessembby B JSTM32F4Dis v wi 0x80023c2 0 Fl LB CI EWARM Wist nain woid R2 EE STM32 LISB E ded VE 72 ACC ClocksTypebef PCC C Ls ON HA Ra C3STM32 USB a macman Mia ds 0x80023cs 0 Rs Ux80023ce
18. M project 0 00 11 6 2 Debugging and running your EWARM project 12 6 3 Creating your first application using the EWARM toolchain 14 6 3 1 Managing source files llle 14 6 3 2 Configuring project options cee ees 16 7 Using MDK ARM Microcontroller Development Kit by Keil M 20 7 1 Building an existing MDK ARM project 00 0c eee eee 20 7 2 Debugging and running your MDK ARM project 21 7 3 Creating your first application using the MDK ARM toolchain 23 AY Doc ID 022172 Rev 1 2 46 Contents 10 3 46 UM1467 7 3 1 Managing source files 0 0 0 cc eee 23 7 3 2 Configuring project options 0 0 ce es 25 Using Atollic TrueSTUDIO 0 ee 28 8 1 Building an existing TrueSTUDIO project 28 8 2 Debugging and running your TrueSTUDIO project 31 8 3 Creating your first application using TrueSTUDIO toolchain 32 Using TASKING 222 0 ce KA rre 36 9 1 Building an existing TASKING project eee 36 9 2 Debugging and running your TASKING project 40 9 3 Creating your first application using TASKING toolchain 41 Revisi n NISIOIN panga uka a dua 432 295 9E P Ud eiu dada dig E 45 Doc ID 022172 Rev 1 ky UM1467 Getting started 2 Getting started 2 1 System requirements Before running your application y
19. NNA sgsres StmIZf4xx c nBEm 2taollir scabi gcc Der system strdzf4xx c Userjscmizfixx ic c Userjmair n TruesTUD IO startup stmi2fdvx o 5TN32 Faxx StdPeeiph DriveEVsrui2fdvw rcc a SIM3zF xx StdPeripa Driver stmg2ftxy gpic o STNSZEX4XX ScdP criph Drtvee mi zm n STN52Fd4 Dlseove E5 4ATMIZEN d iucovrr y n o HWewFrnjecr el mrhurh WPT aor ees sms T AITH a laji 1d ataric 01 2EET CU NO Set Fandice Wl Aap Ne TEN EE mp Wi ge secLionas Wi dpefayu mallnco gernpagesims Poy i ooo Ic iTEDHTAS Filesi Atolli Trung Tid STE32 Line z i 0 amp 1deyjrz bhin java tar Cii Progress i Files 4rgiiicsTEuesTHDIO STH33 Lire 2 1 0 Toolaysrr atollic reporca jar alzeinfo MewPeojecc elrf IRepoarr and Converter ogle only available in TEwesTUIDIO Professional Build complete for project MeuProjer Time c nsured 6350 Ng 9 Before running your application establish the connection with the SIMS2FADISCOVERY board as described in Section 2 Getting started To program the Flash memory and begin debugging follow the instructions given in Section 8 2 Debugging and running your TrueSTUDIO project on page 31 35 46 Doc ID 022172 Rev 1 UM1467 Using TASKING 9 Using TASKING 9 1 Building an existing TASKING project Follow these steps to build an existing TASKING project 1 Openthe TASKING VX toolset for ARM Cortex IDE The program launches and asks for the Workspace location Figure 48 TASKING workspace launcher dialog box Workspace Laun
20. Ow KG M 74 y Initialize LEDs and it STHM32FA Disceverg Demo 1 ag Messages Building configuration S TM32F4 Discovery Demo Demo Updeting build tree 13 46 Ready configuration r up to date 00000000 00000010 00000020 00000030 00000040 00000050 00000060 00000070 00000050 00000090 000000820 000000b0 Figure 7 2000026 guus731 00000000 08005739 O8005f 5 08006005 08006015 08006025 08006035 08006045 D8006055 08006065 08005733 00000000 D0000000 D8005ff3 08006003 09006013 08006023 03006039 o8oo06049 DA006059 030060639 Go button 08005 735 00000000 08005 73b 09005ffd 08005 ied 0800601d 0800602d 08006034 08006044 09006054 0800606d 082005 72f 00000000 08005737 08005 73d 02006001 Q8006011 He002sbb 08006031 08006041 08006051 08006061 08006071 Errors D Wamings D To run your application from the Debug menu select Go in the toolbar to run your application Doc ID 022172 Rev 1 Alternatively click the Go button A UM1467 Using IAR Embedded Workbench for ARM 6 3 Creating your first application using the EWARM toolchain 6 3 1 Managing source files Follow these steps to manage source files 1 In the Project menu select Create New Project and click OK to save your settings Figure 8 Create New Project dialog box Create Mew Project Tool chain Project templates o gt Empty project E asm 5 C S C Externally built execu
21. S TM32F4 Discovery Demonstration V 1 0 0 dfu with DFUse DFUse Demonstration tool available for download from www st com to reprogram the demonstration firmware Doc ID 022172 Rev 1 ky UM1467 5 Note ST LINK V2 installation and development ST LINK V2 installation and development STM32F4DISCOVERY board includes an ST LINK V2 embedded debug tool interface that is supported by the following software toolchains IAR M Embedded Workbench for ARM EWARM available from www iar com The toolchain is installed by default in the C Program FilesUARH Systems Embedded Workbench 6 2 directory on the PC s local hard disk After installing EWARM install the ST LINK V2 driver by running the ST Link V2 USB exe from IAR INSTALL DIRECTORY lEmbedded Workbench 6 2 arm drivers S T Link IST Link V2 USBariver exe RealView Microcontroller Development Kit MDK ARM toolchain available from www keil com The toolchain is installed by default in the C Keil directory on the PC s local hard disk the installer creates a start menu uVision4 shortcut When connecting the ST LINK V2 tool the PC detects new hardware and asks to install the ST LINK V2 USB driver The Found New Hardware wizard appears and guides you through the steps needed to install the driver from the recommended location Atollic TrueSTUDIO STM32 available from www atollic com The toolchain is installed by default in the C Program Files Atollic directory on the PC s local h
22. ard disk The ST Link V2 USB exe is installed automatically when installing the software toolchain Altium TASKING VX toolset for ARM Cortex M available from www tasking com The toolchain is installed by default in the C Program Files TASKING directory on the PC s local hard disk The ST Link V2 USB exe is installed automatically when installing the software toolchain The embedded ST LINK V2 supports only SWD interface for STM32 devices Hefer to the firmware package release notes for the version of the supporting development toolchains Doc ID 022172 Rev 1 10 46 Using IAR Embedded Workbench for ARM UM1467 6 Using IAR Embedded Workbench for ARM 6 1 Building an existing EWARM project The following is the procedure for building an existing EWARM project 1 Open the IAR Embedded Workbench for ARM EWARM Figure 3 shows the basic names of the windows referred to in this document Figure 3 IAR Embedded Workbench IDE Integrated Design Environment JE JAR Embedded Workbench IDE Seles File Edit View Project Tools Window Help D ehga Bloa Messages 2 Inthe File menu select Open and click Workspace to display the Open Workspace dialog box Browse to select the demonstration workspace file and click Open to launch itin the Project window 3 In the Project menu select Rebuild All to compile your project 11 46 Doc ID 022172 Rev 1 ky UM1467 Using IAR Embedded Workbench for AR
23. cher Select a workspace TASKING VA boolset For KAM Cortes v4 0r stores your projects in a Folder called a workspace Choose a workspace Folder bo use For this session Warkenace Ciara Discovery Ki FIRMWAREIProjectlDemonstratian TASKING v Browse Lise this as the default and da not ask again ees 2 Browse to select the STM32F4DISCOVERY Demonstration TASKING workspace and click OK to save your settings and to display the Welcome screen To start using TASKING click Go to the workbench Figure 49 TASKING VX Toolset for ARM Cortex welcome screen TASANG Cie TASKING VX canlsez Tor ARM Carite wT 2r TR TASKING AY Doc ID 022172 Rev 1 36 46 Using TASKING UM1467 3 The TASKING Discovery workspace contains a demo project for the STM32F4DISCOVERY kit To load this project in the File menu select Import to display the Import dialog box 4 In the Import window open General select Existing Projects into Workspace and click Next Figure 50 TASKING import source select dialog box Import Select Create new projects From an archive File or directory Select an import source wpeBertet a gt General 5 Archive File I Existing Projects into Workspace C File System EL Preferences E Cc E e CVS gt Run Debug gt TASKING C C HL Team neto J ru cave a 37 46 Doc ID 022172 Rev 1 UM1467 Using TASKING 5 Click Select root directory browse t
24. d Diumivery mapn 01 Ye eeu ki Ha Hl neteym malloc_gebpagesise_F Ux1l0uu Ci Progesam Files atellisi TeweSTOLIO FTH Z Lite 2 1 0 ide gre bin java ysr Ci Proegeam Filesi drollis TErus3TUDIO STE3Z Lite 1 0 Tools arn atollic reporcs jae sizcinfo ETHi2Ed DiscovcE T clf rr and boner ter Coola only available in Tews3TODIS Prafezaianal SS ETHS SP 4 ecoveru i Doc ID 022172 Rev 1 30 46 Using Atollic TrueSTUDIOG UM1467 8 2 Debugging and running your TrueSTUDIO project In the Project Explorer select the STM32F4 Discovery project and press F11 to display the Debug Configuration dialog box Figure 41 TrueSTUDIO Debug Configuration dialog box Debug Configurations Create manage and run configurations E Program does not exist UE T x E Mame NewProject cmulstor EF Main 63 Arguments E Debugger o S Sauce 7 Comman E TASKING C C Debi CX NewProject sina Execution Environment Communication Setup Tnitiakzation Miscellaneous Target ARM Simulator ARM Simulator Memory configuration Altium General oTi raeiectronics STIFA rants Discovery kk amp Filter matched 2 af 8 items CP 9 Inthe Main tab configure the project as shown in Figure 47 and click OK to save your settings and to program the Flash memory and begin debugging a 31 46 Doc ID 022172 Rev 1 UM1467 i Using Atollic TrueSTUDIO Figure 42 TrueSTUDIO Debug window amp Debug 5TM37FA4 Discavery
25. e with the c extension In this example Figure 29 the file is saved as main c Figure 29 main c example file d E main c MDK ARM offers several ways to add source files to a project For example you can select the file group in the Project Window Files page and right click to open a contextual menu Select the Add Files option and browse to select the main c file previously created Figure 30 Adding source files Project V Options Far Group Source Group 1 Alt F ES Rebuild all target Files a Build target Add Group Add Files to Group Source Group 1 Remove Group Source Group 1 and its Files ut Manage Components Show Include File Dependencies If the file is added successfully the following window is displayed Figure 31 New project file tree structure Project ET 59 Target X Source Group f startup stma2f4xx 5 main c Doc ID 022172 Rev 1 24 46 Using MDK ARM Microcontroller Development Kit by Keil M UM1467 7 3 2 Configuring project options 1 In the Project menu select Options for Target 1 to display the Target Options dialog box 2 Open the Target tab and enter IROM1 and IARM1 start and size settings as shown in Figure 32 Figure 32 Target Options dialog box Target tab Tapon tonaareci large Device Target Output Listing User CA Asm Linker Debug Utiities ST Microelectioncs 5TM33L152RB Code Generation dal MHz B
26. erals N EE Mew Multi Project Workspace Open Project Export Manage 2 When anew project is saved the IDE displays the Device selection dialog box Select the device used for testing In this example we will use the STMicroelectronics device mounted on the STM32F4DISCOVERY board In this case double click on STMicroelectronics select the STM32F407VGT6 device and click OK to save your settings Figure 27 Device selection dialog box Vendor 5T Microelectronics Device 5TM32F407YGTE Toolset ARM 5T Microelectronics Core ARM 32 bit Cortes M4 CPU with 7 Ente uci Adaptive real time ART accelerator allowing 3 Click Yes to copy the STM32 Startup Code to the project folder and add the file to the project as shown in Figure 28 Figure 28 Copy the STM32 Startup Code dialog box 3 Copy 5TM32 Startup Code to Project Folder and Add File to Project 7 ane w The default STMS2 startup file includes the Systemlnit function You can either comment out this file to not use it or add the system stm32f4xx c file from the STM32f4xx firmware library Doc ID 022172 Rev 1 ky UM1467 i Using MDK ARM Microcontroller Development Kit by Keil To create a new source file in the File menu select New to open an empty editor window where you can enter your source code The MDK ARM toolchain enables C color syntax highlighting when you save your file using the dialog File Save As under a filenam
27. ion Browse to select an existing workspace or enter a new workspace location and click OK to confirm Figure 54 TASKING workspace launcher dialog box Workspace Launcher Select a workspace TASKING vX Eaalset For ARM Cortex v3 zrl1 stores your projects in a Folder called a workspace Choose a warkspace Folder to use For this session Workspace c Wew Wworkspace w C Use this as the default and do not ask again 2 When TASKING displays its Welcome window click Go to workbench to open the main window In the File menu select New gt TASKING VX toolset for ARM C C Project 3 Inthe New C C Project dialog box enter the new Project name then in the Project type box select TASKING ARM Application and click Next Figure 55 TASKING New C C Project dialog box W New CIC Project C C Project Creabe a new Chil project For the TASKING k toolset For ARM Use default location Project type Lo TASKING ARM Application SEV TYSIEC Helo World C Project Helo World C Project CI TASKING ARM Library LI TASKING ARM FIL Library a 41 46 Doc ID 022172 Rev 1 UM1467 Using TASKING The list of the supported devices is shown select STMicroelectronics 5 STM32F407VG 5 STM32F407VGT6 as shown below in Figure 56 Figure 56 Processor selection Processor selection ape Expand 41 lp Med nics gt B SIRE 8 Li S3THTXFIJ1 EB Li STASSFIA Im F1 mFS w 51MX 207 gm
28. lUsermain c Atollic Troues TUDORS TMAA Lite Ele Edi Source Relacter Havigale Search Protect Bun Mamuak Window Hap Ber Ors eee E Qi NG Pi Batay E Cice x pg mj a y T B87 Olan 8 958e GSE OM Re Eho STMGFA Descoreery etf Embedded CfCs amp pplication fou oS F Embe dded CIC Application 9 15 11 4 29 FM Suspended z dii cto Int amp retun 3 B ogi Thread 1 Suspended Broakpoint hi X GPIO Fin D Laman man cu t Qx05000332 5 pi ST LISE pi C frogram Files bob Troes UDR SIM Libo 2 LU ARIITooEbiniarm sbolbc eabisgdb 9 15 11 4 pi CASS PARI Marka Dicoovery SPAM RE Project Peripheral Ex amplesis TH s Disceree Jb C3 GPR Mede 157 ba GPIO Speed GAO Speed PH Xe GP CT um ETE OiTyne PP stm f4 decovery h strdafxx i c maine ki C0 B cuna Et Law o X Ni em J stm32l4 discovery th B ss Delaying f void T inltimizze LEDs mounted on SEIS 4 Diseovecy JM wal maged lang STM EVAL LEDInit LEDIN marad woid int STH EVAL LEPINI LEDOJ Delay iinet void 5TH EVAL LEPInit LEDS F nasar fadedrum E mki t STH EVAL LEDInitiLEio4p Turn on LEPI and LEDS r 5TH EVAL LEDUn LED 5TH EVAL L EDp n L03 it This function fili Ehe Boc Clock feed structure With El console i F3 Taske E Problems D Execuzkins Hesry m H ah 2 EmBm r u STAF boa y ex Embedded 4 Application C WSS PWADIOT MM ana Discover y KI IRMNVABEIPrajecti Peripheral Examples 5 TM3
29. m Import resources from the local file system From directory C NesWworksnace 8 Gs Mew rarkspace Fiber Types Select Al Deselect Al Into Polder NewProject Options Overarite existing resources vethout warning 7 Create complete folder structure 9 Create selected folders only ami 0 9 A7 Create links in workspace Create wrtual Folders l Create Ink locations relative to PROJECT LOC ee 7 Select main c file and click Finish 8 To build your project click on Project Build Project from the toolbar menu 9 Your Project is successfully compiled Figure 60 Tasking project successfully built ED Problems X Console C Properties 33 items Description Resource OfC build completed successfully NewProject 10 Before running your application establish the connection with the SIMS2FADISCOVERY board as described in Section 2 Getting started Doc ID 022172 Rev 1 44 46 Revision history UM1467 10 Revision history Table 1 Document revision history BEN GNE NN 23 Sep 201 1 Initial release UM1467 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 no
30. o the TASKING workspace folder and select the STM32F4 Discovery project Figure 51 TASKING import projects dialog box EI F LB Impori im Import Properts a o p jec lang Select a directory to search for existing Eclipse projects p j Dry nq Echpse proe x Cs geleet roct directory CPA 2007 Mantes Discovery Kit FIRMWAAI Browse Select archive Fie Projects v STIM22F4 Ciscovery Demo C APAWA 2007 Marta Discovery KRIF select Deselect all Refresh 4 CI Copy projects into workspace Working pets Add project bo working sets 6 Inthe Projects window select the STM32F4 Discovery and click Finish 7 Inthe Project Explorer select the STM32F4 Discovery project Open the Project menu and click Build Project i Doc ID 022172 Rev 1 38 46 Using TASKING UM1467 8 f your project is successfully compiled the following window is displayed Figure 52 TASKING project successfully compiled LB import Import Projects Select a directory to search for existing Eclipse projects Select root directory CPA 20071Marka Discovery KUFIRMYAY J Select archive ffe Projects Pe STMS2F4 Discovery Demo CAPRA 20071Manta Discovery KEF select Al Deselect All Refresh 4 Copy projects into workspace Working sets Add project bo working sets a 39 46 Doc ID 022172 Rev 1 UM1467 Using TASKING 9 2 Debugging and running your TASKING project Figure 53
31. ose a workspace Folder to use For this session Workspace ci MewWnrkspace ng bk Copy Settings 2 Browse to select the STM32FADISCOVERY Demonstration TrueSTUDIO workspace and click OK to save your settings and to display the Welcome screen To start using Atollic TrueSTUDIO click Start using TrueSTUDIO Figure 37 Atollic TrueSTUDIOG STM32 Lite welcome screen Lite wersion Click here to continue 3 The TrueSTUDIO Discovery workspace contains a demo project for the STM32F4DISCOVERY kit To load this project in the File menu select Import to display the Import dialog box Doc ID 022172 Rev 1 28 46 Using Atollic TrueSTUDIOG UM1467 4 Inthe Import window open General select Existing Projects into Workspace and click Next Figure 38 Atollic TrueSTUDIOG STM32 Lite import source select dialog box LE Import Select Create new projects From an archive File or directory Select an import source tvpefitertext oo a bb General E Archive File Existing Projects into Workspace CJ File System E Preferences H CIC Run Debug LS Team 5 Click Select root directory browse to the TrueSTUDIO workspace folder and select the STM32F4 Discovery project 29 46 Doc ID 022172 Rev 1 UM1467 Using Atollic TrueSTUDIO Figure 39 Atollic TrueSTUDIO STM32 Lite import projects dialog box LB TUTTO Import Projects Select a directory to search for existing Eclipse projects
32. ou should establish the connection with the STM32F4DISCOVERY board as following Figure 1 Hardware environment To run and develop any firmware applications on your STM32FADISCOVERY board the minimum requirements are as follows Windows PC 2000 XP Vista 7 USB type A to Mini B cable used to power the board through USB connector CN1 from host PC and connect to the embedded ST LINK V2 for debugging and programming Additional hardware accessories will be needed to run some applications USB type A to Micro B cable used to connect the board through USB connector CN5 as USB Device to host PC Headphone with male jack connector y Doc ID 022172 Rev 1 4 46 Getting started UM1467 2 2 Running the built in demonstration The board comes with the demonstration firmware preloaded in the Flash memory Follow the steps below to run it Check jumper position on the board JP1 on CN3 on Discovery selected Connect the STM32FADISCOVERY board to a PC with a USB type A to Mini B cable through USB connector CN1 to power the board Red LED LD2 PWR then lights up Four LEDs between B1 and B2 are blinking Press User Button B1 then MEMS sensor is enabled move the board and observe the four LEDs blinking according to the motion direction and speed f you connect a second USB type A to Micro B cable between PC and CN5 connector then the board is recognized as standard mouse and its motion
33. s session Workspace ciNew Workspace ng t Copy Settings 2 When the Atollic TrueSTUDIO displays its Welcome window click Start using TrueSTUDIO to open the main window In the File menu select New and click C Project 3 Name the new project in the Project type pane select STM32 C Project and click Next Figure 44 TrueSTUDIO C Project dialog box amp C Project C Project Create C project of selected type Project name NewProject Use default location CtNewworkspacetewProjet Project type Toolchains B E Executable E Atollic ARM Tools Empty Project 2351132 C Project lL Makefile project Show project types and toolchains only if they are supported on the platform Cancel a 33 46 Doc ID 022172 Rev 1 UM1467 Using Atollic TrueSTUDIO 4 Inthe TrueSTUDIO Build Settings dialog box select STM32F4 Discovery as Evaluation board configure the other settings as shown in Figure 45 and click Next Figure 45 TrueSTUDIOG Build Settings dialog box BE C Project TruesTUDID Build Settings Select hardware and build configuration Target Evaluation board sSTIH3zFA4 Discovery Microcontroller Famdy Ficrocontroller JTE32FJ T7Y Flaatirs paint Software implementation Code Ipcaton FLASH retruc ze Thumb Endiamess Little endian Optimization Remove unused code dead code removal v Remove unused data dead data removal Note Choosing STM32F4DISCOVERY as the e
34. t Library Core and the class drivers The Core folder contains the USB Host library machines as defined by the revision 2 0 Universal Serial Bus Specification The Class folder contains all the files relative to the Host class implementation It is compliant with the specification of the protocol built in these classes STM32 USB OTG Driver subfolder This subfolder contains the low level drivers for STM32F4xx USB HS and FS cores It provides an hardware abstraction layer USB communication operations and interfaces used by the high level Host and Device Libraries to access the core STM32F4xx StdPeriph Driver subfolder This subfolder contains sources of STM32F4xx peripheral drivers excluding USB and Ethernet Each driver consists of a set of routines and data structures covering all peripheral functionalities The development of each driver is driven by a common API application programming interface which standardizes the driver structure the functions and the parameter names Each peripheral has a source code file stm32f4xx ppp c and a header file stm32f4xx ppp h The stm32f4xx ppp c file contains all the firmware functions required to use the PPP peripheral Project folder This folder contains the source files of the STM32F4DISCOVERY firmware applications Demonstration subfolder This subfolder contains the demonstration source files with preconfigured project for EWARM MDK ARM TrueSTUDIO and TASKING toolchains Doc
35. table Description Lreates an empty project 2 Name the project for example NewProject ewp and click Save to display the IDE interface Figure 9 IDE interface F IAR Embedded Workbench IDE MBR File Edit View Project Simulator Tools Window OI NewProje NewProject Messages Configuration is up to date E i Build Debug Log To create a new source file in the File menu open New and select File to open an empty editor window where you can enter your source code i Doc ID 022172 Rev 1 14 46 Using IAR Embedded Workbench for ARM UM1467 15 46 The IAR Embedded Workbench enables C color syntax highlighting when you save your file using the dialog File Save As under a filename with the c extension In Figure 10 main c example file the file is saved as main c Figure 10 main c example file int maini void 1 returni Once you have created your source file you can add this file to your project by opening the Project menu selecting Add and adding the selected file as in Figure 11 Adding files to a project Figure 11 Adding files to a project JAR Embedded Workbench IDE Seles File Edit View Project Simulator Tools Window Help Options Make Rebuild All Clean add les Add main c R NE Add Group newpre Source Code Control Fal J Addthes File Properties If the file is added successfully Figure 12 New project file tree struct
36. the basic names of the windows referred to in this section Figure 22 MDK ARM pVision4 IDE environment s CS Window Help m EE E sai Output Window 2 Inthe Project menu select Open Project to display the Select Project File dialog box Browse to select the STM32F4 Discovery uvproj project file and click Open to launch it in the Project window 3 Inthe Project menu select Rebuild all target files to compile your project ky Doc ID 022172 Rev 1 20 46 Using MDK ARM Microcontroller Development Kit by Keil UM1467 7 2 21 46 If your project is successfully compiled the following Build Output window Figure 23 Build Output MDK ARM pVision4 project successfully compiled is displayed Figure 23 Build Output MDK ARM pVision4 project successfully compiled compiling armia discovery c compiling Stm3zrf4xx ECC C compiling misc c compiling BStm3zf4xx gplo c compiling gtm3zr4xx syscfg c compiling Btm3Zf4xx exti c linking Program Size Code 13BB RO dara 45D EW darta 35 ZI derta 1DzB AsTH32F4 Discovery Demo STH3zF4 Discovery Demo axf D Error s O Warningi s Debugging and running your MDK ARM project In the MDK ARM pVision4 IDE click the magnifying glass to program the Flash memory and begin debugging as shown below in Figure 24 Figure 24 Starting a MDK ARM pVision4 debugging session ose e Start Stop Debug Session Ctrl F5 HN Enter ar leave
37. tice 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 TWO AUTHORIZED ST REPRESENTATIVES 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
38. uild Build Actions inke Verify download Attach to program C Suppress download Use flash loader sz GDB Server C Override default board file Debugger Doc ID 022172 Rev 1 18 46 Using IAR Embedded Workbench for ARM UM1467 10 Select the ST Link category open the ST Link tab and select SWD as the connection protocol as shown in Figure 2f Figure 21 ST Link communication protocol Assembler Output Converter Custom Build Build Actions Linker Debugger Simulator ST Link Interface QJT AG n OED GDB Server TAR ROM monibor J Link J Trace LMI FTDI Macraigor RDI 11 Click OK to save the project settings 12 To build your project follow the instructions given in Section 6 1 Building an existing EWARM project on page 1 1 13 Before running your application establish the connection with the STM32F4DISCOVERY board as described in Section 2 Getting started 14 To program the Flash memory and begin debugging follow the instructions given in Section 6 2 Debugging and running your EWARM project on page 12 19 46 Doc ID 022172 Rev 1 SZ UM1467 Using MDK ARM Microcontroller Development Kit by Keil 7 Using MDK ARM Microcontroller Development Kit by Keil 7 1 Building an existing MDK ARM project Follow these steps to build an existing MDK ARM project 1 Open the MDK ARM uVision4 IDE debugger and simulation environment Figure 22 MDK ARM pVision4 IDE environment shows
39. ure is displayed Figure 12 New project file tree structure Files B DB E Piso eden Ha E main c a Doc ID 022172 Rev 1 UM1467 6 3 2 i Using IAR Embedded Workbench for ARM Configuring project options Follow these steps to configure project options 1 In the Project Editor right click on the project name and select Options to display the Options dialog box as in Figure 13 Figure 13 Configuring project options Options COM pil E Rebuild All Clean 2 Inthe Options dialog box select the General Options category open the Target tab and select Device ST STM32F4xx Figure 14 General options Target tab Options for node STM32F 4 Discovery Demo Pi 3T STMS2F 106 ST STM3ZFIOTXB ST STMXeF 10 xt A 5T STMX2F 1 Dt CMNER i l 5T STM32F1Dwe5 General Options ST STM32F10xx8 f Compiler ST STMX2F10xxB Assembler 5T STHMX2Fi xxc Output iCanverber Target Dutpul Library Configuration Libearg Ophors i MISRAC 200 5T STM32FiDx D Custom Buik 5T STM32FlUwxE Buka chong Processot yaman aA bp the Linker 2 el ST STM32F 10x pentes C2 Core ples ST 5STM3ZF205rx mulakor ET CETHI d 5T STM3ZF2D5vx Ange a Device 5T STM 32F dane ST STM32E z GDB Server AR ROM monibar ST STHX2F 207 xx JLink J Traos 5T STMS32F215rx 5T STM3ZF2Z152x TI Stellaris FTOI i Macraigor 5T STM32F21 xx ST STM PE micro RD ST LIME Third Party
40. valuation board will configure the project as follows e Microcontroller STM32F407VGT6 Debug probe ST LINK e Connection Serial Wire Debug SWD 5 Verify that the JTAG Probe is ST LINK and click Finish to confirm your settings Figure 46 TrueSTUDIO Misc Settings dialog box amp cC Project TrueSTUDIO Misc Settings Select miscellaneous project settings JTAG Probe ST LINK ST LIME Akollic TrueS TLIDIO Lite only supports one type of JTAG probe Please purchase the Professional version to get support For a large number of other types of JTAG probes Fa 6 Your project is successfully created Atollic TrueSTUDIO generates target specific sample files main c stm32f4xx it c in the Project folder to simplify development You can tailor this project to your needs by modifying these sample files i Doc ID 022172 Rev 1 34 46 Using Atollic TrueSTUDIOG UM1467 7 To build your project in the Project menu click Build Project 8 Your project is successfully compiled Figure 47 TrueSTUDIO project successfully built Hy Probleme Tasks G Cansele 2 LL Properbes Eg Progress C Buld Heto 82t falaa rs a taak sS sao Libraries CHSIS include Tag haa taa haah aa LITE le COS STATE Fx loclud fee hee 4 Libraries STHIZFtxx StdPeriph Driver Ling I g 224 0 4 4 Uta litias STEI294 Disecerery are to far 00 fZunction secriors f sta zs r icns g Wall O olz ar syst em zcmiz fixx 2 F BA
41. will also control the PC cursor 5 46 Doc ID 022172 Rev 1 ky UM1467 Description of the firmware package 3 Description of the firmware package The STM32F4DISCOVERY firmware applications are provided in one single package and supplied in one single zip file The extraction of the zip file generates one folder STMS2F4 Discovery FW VX Y Z which contains the following subfolders Figure 2 Hardware environment 9 STM32F4 Discovery FW VX Y Z Hi htmresc Libraries H E CMSIS HC STM32 USB Device Library STM32 USB HOST Library t STM32 USB OTG Driver Hi STM32F4xx StdPeriph Driver Project Demonstration Hi Master Workspace HC Peripheral Examples io Utilities STM32F4 Discovery e Release Notes html 1 VX Y Z refer to the package version ex V1 0 0 3 1 Libraries folder This folder contains the Hardware Abstraction Layer HAL for STM32F4xx Devices 3 1 1 CMSIS subfolder This subfolder contains the STM32F4xx and Cortex M4F CMSIS files Cortex M4F CMSIS files consist of Core Peripheral Access Layer contains name definitions address definitions and helper functions to access Cortex M4F core registers and peripherals It defines also a device independent interface for RTOS Kernels that includes debug channel definitions CMSIS DSP Software Library features a suite of common signal processing functions for use on Cortex M processor based devices The library is completely written in C and is
Download Pdf Manuals
Related Search
Related Contents
Programmer`s Manual YSI Pro1030 User Manual - Geotech Environmental Equipment AEG A92200GNM0 Freezer User Manual Copyright © All rights reserved.
Failed to retrieve file