Home
UM0986 User manual - STMicroelectronics
Contents
1. Enter or leave a debug session 12 Now you can start debugging your application lt Doc ID 17877 Rev 1 UMO986 Revision history 4 Revision history Table 1 Document revision history BINE NENNEN EN 09 Sep 2010 Initial release kI Doc ID 17877 Rev 1 17 18 UMO986 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 OTHE
2. One ELF Section per Function Read write Position Independent Include Paths Misc Controls Compiler ka cpu Cortex M3 g 00 apessinterwork L sinc 1 C SKeill B MNINC l contral C SEeils amp mRMSINESSTSSTM32FTUs a Yo amf browse crf depend d string 5 Select Debug tab a Click on Use check box b Choose ST Link Debugger Figure 22 Select ST Link Linker Debuz tities Use FDI Interface Driver settings LILINE Cortes Debugger HDI Interface Driver Altera Blaster Cortes Debugger wl Bis Stellaris ICDI o main 5 T Link Debugger artex M F J LINEAI T race Edit Restore HLINE Pro Cortes Debugger SI Doc ID 17877 Rev 1 13 18 Creating your first application UM0986 6 Click on Settings button a Choose the SWD as connection protocol in the STLink setup window b Click on OK button c Click on Run to main check box Figure 23 Select SWD protocol B Taken Utilities f Use ST Link Debugger vi lw Load Application at Startup V pun to manl Initialization File 1 Edit Cancel 14 18 Doc ID 17877 Rev 1 kI UMO0986 7 Select Utilities tab a Click on Use Target Driver for Flash Programming Choose ST Link Debugger Veify that Update Target befor Debugging option is checked Click OK to save your settings Q o o Figure 24 Save project Outs iur langei ganger Device Target Output Listing User C C Ast Li
3. ANA UMO986 Sf User manual Developing your STM32VLDISCOVERY application using the MDK ARM software Introduction This document provides an introduction on how to use the MDK ARM M software development toolchain version 4 11 and later with the STM32VLDiscovery board It provides novice users of the MDK ARM tool chain with some guidelines to build and run the 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 the MDK ARM tool it demonstrates the first basic steps necessary to get started with the compiler debugger September 2010 Doc ID 17877 Rev 1 1 18 www sti com Contents UM0986 Contents 1 About MDK ARM toolchain nannan nana 3 2 Starting an existing MDK ARM project 4 3 Creating your first application Les 9 3 1 Source file management e eee enn nn nn n nn n nn nan 9 3 2 Project options configuration e seeseseeoo 12 4 Revision NISIOF occa ana komin n meus cee n ae hc SOR OF RO av CRUS ede CR RO s 17 2
4. 18 Doc ID 17877 Rev 1 oZ UMO0986 1 Note About MDK ARM toolchain About MDK ARM toolchain The MDK 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 an AXF file generator MDK ARM helps expedite the development process of embedded applications by providing the following Full featured source code editor Device Database for configuring the development tool Project manager for creating and maintaining your projects Integrated Make Utility for assembling compiling and linking your embedded applications Dialogs for all development environment settings True integrated source level and assembler level debugger with high speed CPU and peripheral simulator Advanced GDI interface for software debugging on target hardware and for connecting to a Keil ULINK Debug adapter Flash programming utility for downloading the application program into Flash ROM Links to manuals on line help device datasheets and user guides For generic descriptions please refer to the Getting Started Guide of uVision4 available from Keil web site at the following link httip www keil com product brochures uv4 pdf Doc ID 17877 Rev 1 3 18 Starting an existing MDK ARM project UMO986 2 Starting an existing MDK ARM proje
5. 600 oOo0000000 goaod pagaogadu pagaogadu pnagaogaau OOOO0000 OOOO00000 OOo000000 o0000000 OOo000000 Ooo000000 OOOO0000 OoOo000000 OOOO0000 Ooo000000 OOO00000 agada pagagoaad OoOo000000 OOoO00000 OOo000000 OOOOO0000 OoOo000000 G1Call Stack GelLocals Galwatch1 E Memory 1 BSymbals ST Link Debugger 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 x 8 18 Doc ID 17877 Rev 1 UMO986 Creating your first application 3 Creating your first application 3 1 Source file management 1 Select New pvision Project from the Project menu Figure 12 Create new project Project Flash Debug Peripherals Mew Multi Project Workspace Open Project Close Project Export Manage 2 Name the project Empty uvproj click on Save Figure 13 Name the project Create Mew Project Save n le Scratch vi d tj l ky Recent Documents Desktop hy Documents hy Computer T E My Network File name Empty Flaces save as type Project Files uwproj Cancel E Doc ID 17877 Rev 1 9 18 Si Creating your first application UMO986 3 The device window will be displayed Select the part you will be testing with the STMicroelectronics part mounted on the STM32VL Discovery board a Double click on the STMicroelectronics b Scroll down and select the STM32F100RB
6. Hn 3 DISCOVER a CMSIS MDE ARM StdPeriph Driver STM3evldiscovery 9 User Dac 5 Select Rebuild all target Files from the Project menu Figure 5 Rebuild all Project Flash Debug Periphera New pyisian Project New Multi Project Workspace Open Project Close Project Export Manage Select Device For Target DISCO aK Options For Target DISCOVER Clean target ea ee area se 2 Rebuild all target Files 6 Your project is successfully compiled Figure 6 Successful compile EE Build target DISCOVER compiling system stm3zrlU x c compiling core cm3 c assembling startup stm3zrtl Ux md wl s compiling stmszrl Ux pwr c compiling stmszrl x rcc c compiling misc c compiling stmszrfl x exti c compiling stmszrfl Ux dgpio c compiling STM3Zvldiscovery c compiling stm3zrfl x it c compiling main c linking Program Size Code 1636 RO data 346 Ril data 52 zI data 1i0z28 Debug DISCOVER axf f0 Error iaj O Warnindq sil lt Doc ID 17877 Rev 1 UMO986 Starting an existing MDK ARM project 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 MDK ARM running STM32VLDISCOVERY USB cable type A to mini B Note For more details on how to establish your hardware environment you can refer to t
7. 6 main c 6 Once you have created your source file you can add this file to your project 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 click with the right mouse key to open a local menu The option Add Files opens the standard files dialog Select the file main c you have just created Figure 17 Add files Project h x ai Target 1 Es QNM Liz LAN Options For Group Source Group 1 Alt F7 pen List File Open Map File ij Build target anslate File Stop build Add Group Files to Group Source Group l Remove Group Source Group 1 and its Files ut Manage Components Show Include File Dependencies 7 Your main source file is successfully added to your project Figure 18 Successful creation of main c in your project Project 2 25 Target 1 51 55 Source Group 1 e LE STM32F10x s 3 main c Doc ID 17877 Rev 1 11 18 Creating your first application UMO986 3 2 Project options configuration 1 Click on Target 1 in Project menu 2 Click on Project menu and select Options for Target 1 Figure 19 Options for Target 1 Project Flash Debug Peripherals Mew pyision Project New Multi Project workspace Open Project Close Project Export Manage Select Device for Target Target 1 Remove Item 3 Sele
8. Part c Click OK Figure 14 Select test device Salter us sies fur an Pe tal ANPE II ds CPU Vendor STMicraelectranics Device 5TH32F100KRE Toolset ARM Data base Description 3 STM32F100C4 E ARAM 32 bit Cortex M3 Microcontroller 24MHz 128kB Flash 8kB SRAM EJ STH323F100C6 PLL Embedded Internal RC SMHz and 40kHz Real Time Clock r Power Saving Modes JTAG and SWD Ed STM32F100C8 channel DMA Nested Interrupt Controller Ea STM32FIOOCE 12 bit 1E ch A D Converter 2 12 bit 2 ch DWA converters 51 Fast 1 0 Por E Ed STM32F100R4 2 SPL 2120 3 USART CAC calculation unit EI STM32F100R6 ee ue 2 sie duse 3 Dit b ch advanced timer wit E e tann TL b 16 bit Timers with Input Capture Output Compare and Fwd ff STM32F100v9 Ed STM32FTOOVB ff STM32F100ZE ER STM32FTUIC4 4 The Copy STM32 Startup Code message is prompted Select Yes Figure 15 Copy STM32 Startup code pVision l ne Copy STM32 Startup Code to Project Folder and Add File to Project xS lt 1 0 18 Doc ID 17877 Rev 1 UMO0986 Si Creating your first application 5 You may create a new source file with the menu File New This opens an empty editor window where you can enter your source code pVision4 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 save our example file under the name main c Figure 1
9. RWISE 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 STMicroel
10. ct Installing the MDK ARM toolchain using the default settings results in the toolchain being installed in C Keil on the PC s local hard disk The installer creates a start menu uVision4 shortcut 1 Open uVision4 from the Start menu Figure 1 shows the names of the windows referred to in this document Figure 1 MDK ARM windows ki Visions File Edit view Project Flash Debug Peripherals Tools svcs Window Help Files window om aT a E E p Epy A d eeeEeIL LkL kI LLI Find in Files 0 75H4W 00000000000 uo e e EEN MR E Output window S 4 1 8 Doc ID 17877 Rev 1 UMO986 Si Starting an existing MDK ARM project 2 Select Open Project from the Project menu Figure 2 Open project Project Flash Debug Peripherals Tools SYCS Mew pyision Project ka Ta m Hew Multi Projeck Workspace ar dh 3 Using the Select Project File dialog box browse and find the DISCOVER uvproj Figure 3 Select the project Select Project Filz Look in O MDE ARM al w eX 2 amp DISCOYER uvproj Mu A ecent Documents Desktop My Documents hy Computer My Network File name DISEDVER uvpra Flaces Files af type Project Files uvprap up Sura uv o ow L ancel Doc ID 17877 Rev 1 5 18 Starting an existing MDK ARM project UMO986 6 18 4 Double click this file to launch it within the Project window Figure 4 Launch the project
11. ct Target tab The IROM1 and IARM1 start and size are automatically set according to the chosen device just verify the settings and correct them if necessary Figure 20 IROM and IARM settings Options tor Target Marget 1i Device Output Listing User C C Asm Linker Debug Utilities ST Microelectronics 5 TM 3ZFT1UCUVE Code Generation tal MHz 15 0 Operating system Mone m Use Cross Module Optimization Use MicroLIB Big Endian Use Link Time Code Generation ReadOnly Memory Areas pAReadA wirite Memory Areas default off chip Start Size Startup default off chip Start Size Malnit FROM RAMT ROMZ RAM ROMS RAMa on chip on chip inp 08000000 525000 li inan 020000000 Y ZO00 RAMZ Jen 12 18 Doc ID 17877 Rev 1 kI UMO986 Creating your first application 4 If your source files include header files you should specify their paths in the project settings as shown in Figure 21 Figure 21 Include paths Options for Target Target 1 Device Target Output Listing User C C Asm Linker Debug Utilities Preprocessor Symbols Define Lindefine Language Code Generation Strict AMSIC Warnings Optimization Level 0 O0 vi Enum Container always int eunspecitied vi Optimize for Time Plain Char is Signed AA fii Thumb kwi ade Split Load and Store Multiple Read Only Position Independent
12. ectronics 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 18 18 Doc ID 17877 Rev 1 kI
13. he UMO919 User Manual STM32VLDiscovery available at www st com stm32 discovery 8 Select Download from the Flash menu Figure 8 Flash download window FI Ama ash Debug Peripherals Tools Configure Flash Tools 9 Your project is successfully programmed and verified Figure 9 Console window Load C X3Value Line Discover FIRMWARE Project Demo MDE ARIS A Debucr X DIS rase Done Programming Done Verify OR 10 Click the magnifying glass to program the Flash and begin debugging a Start Stop Debug Session Ctrl F5 Figure 10 Download and debug a project en Enter or leave a debug session Si Doc ID 17877 Rev 1 7 18 Starting an existing MDK ARM project UMO986 11 The debugger interface supplied by MDK ARM allows for source code debugging at C and assembly levels breakpoint setting individual variables monitoring and watching during the code execution Figure 11 Debug screens RIDISGOVER d ETSI File Edit Project lle MeL EEN a d gt ou 7 amp Th TR oral E IT Registers Tools Window Help JE ijs lb View Flash Debug Peripherals Extension Extension B Svcs Pe pisassembly 5S5 Enable PUR and GPIOx Clocks Ei Curr ent AB boo H8 RIO Pee RTI pon Ale R13 SP a Fi 14 LA fe 15 PC fee SA I
14. nker Debug Configure Flash Menu Command Use Target Driver for Flash Pragramming ULINE Cortes Debugger vi Settings eu pdate T arget before Debugging ac HLIMK Cortex Debugger m Init File AID Interface Driver y Edit Stellaris ICD Signum Systems d TAG et 5 T Link Debugger C lise Exter Command Arguments Rur Independen par Cancel Defaut Doc ID 17877 Rev 1 Si Creating your first application 15 18 Creating your first application UMO986 16 18 8 Click on Project menu and select Build target Figure 25 Build target files Project Flash Debug Peripherals New pyisian Project Mew Multi Project Workspace Open Project Close Project Export Manage Select Device for Target Target l 1 Options For Target Target l clean target Rebuild all mem files 9 In the Build window it should report O Errors s O Warnings Figure 26 Success Build Output Build target Target 1 assembling STM3ZzFi1Ux s compiling main c linking Program Size Code 3386 RO data 252 RW data zI data 5 08 Empty axtf f Error s O Warnind si 10 Before running your application you should establish the connection with the STM32VLDiscovery board as shown in Figure 7 11 Click the magnifying glass to program the Flash and begin debugging Figure 27 Start Stop debug session E oe a Start Stop Debug Session Ctrl F5
15. nternal 00000459 020000438 OxO0000000 O0800047 b Ox0800063c Ox00000000 OxO0000000 OxO0000000 OxO0000000 Ox00000000 Ox00000000 OxO0000000 Ox20000438 Oe080001 75 OxOB80D0458 061000000 i Project Registers Demos Address Dx20000000 58 ROC APBiPeriphClockCmd RCC APBiPeriph PWR ENABLE OxosOOD45A 2101 Movs ri 0x01 nxp snonasc n708 LSLS ro ri 28 OxOS800048E FUVFFFEE1 BL W ROC APBlPeriphClockCma Ox08000 60 RCC APBiPeriphClockCmd RCC APE2Periph GPIOC ENABLE rneennnmao VAN wear 31 074 EJ Main program Hone Ont put None Return None Se eee Ee EE EE EE EE EEE EE EEE EEE EEE EE EEE EEE EEE EE EEE EEE EE EE ox Description Input int mainivoidi p 057 t O58 Enable PWE and GPIOx Clocks 059 ROC APBIPeriphclockocmdiBCC APBlIPeriph PUR ENABLE AEN DOC ADCEiDlarink lant mA FOOT DES Deri POT FTIA AT Wi Ox20000000 Ox2z0000020 Ox20000040 Ox20000060 Ox20000080 Ox20000040 Ox200000CQ0 Ox200000E0 pnagaogadu 04030201 OoOo0o00000 OoOo0o00000 OoOo0o00000 OooOo0o00000 OOOO0000 ooo000000 agaagaaagu O9060706 ddododd Dgoogg0o0nu aaagaaagu agaagagaagu OOOO0000 ddododd OOoOo00000 40010600 OOoOO0000 pnagaogadu paagaooaaao OOoO00000 OOOO0000 OOo0O00000 Ooo0o00000 40011000 OOO000000 Ooo0o00000 OoOo0o00000 OOo0o00000 OOOO0000 pnagagadu gododd 40011000 Oooo00000 Oooo0o00n00 Oooo00000 OoOoOo00000 OOOO0000 OoOo000000 O16E3
Download Pdf Manuals
Related Search
Related Contents
Techno Source 90610 User's Manual USER`S MANUAL - Boomerang Bead Looms Sprint Nextel G2 User's Manual User Guide - SoleraTec OB12 Manual - Future Skully Companies Instruction Sheet Index Lennox International Inc. MPB35ST-NM User's Manual CR2600 XHD User Manual DVR autónomo serie 1U Manual de Usuario User Manual - Surveillance Copyright © All rights reserved.
Failed to retrieve file