Home

STM32 ST-LINK Utility software description

image

Contents

1. 9 2 2 4 Target MENU olus Rl ge eee pda Perdu Sole eas 10 2 2 5 ST LINK menu a a RR Ik hm be ee ebb 12 2 2 6 External Loader menu 12 2 2 7 HelpsMenw 2 ERR IA eb IN A RESP teamed 15 3 STM32 ST LINK utility features 16 3 1 Device information 16 3 2 MAH P 16 3 3 Memory display and modification 18 3 4 Flashmemoryerase 19 3 5 Device programming 21 3 6 Option bytes configuration 23 3 7 MCU core functions 28 3 8 Automatic mode functions 29 3 9 Developing customized loaders for external memory 30 3 10 Printf via SWO viewer 31 4 STM32 ST LINK utility command line interface CLI 32 4 1 Command line USAGE 32 4 1 1 Connection and memory manipulation commands 32 4 1 2 Core commands sss 33 2 47 DoclD16987 Rev 20 Ly UM0892 Contents 4 1 3 Flash commands 35 4 1 4 Miscellaneous commands 36
2. 12 External Loader window ee hne 13 ErternalLoadersubmenus 13 External memory grid ii AAA KA ANA hh hs 14 Help menu ECTETUR ETT 15 Device information zone in the main user interface 16 Settings dialog eh hr 17 STM32 ST LINK utility userinterface 19 Flash memory mappingdialogbok 20 Open file dialog susc less e gre mea sr Rex x e 21 Device programming dialog box programming 22 Option bytes dialog box m e 26 Read write protection mode 27 MCU Core panel dialog box llsselsseeeee en 28 Automatic mode esr 29 Serial wire viewer window SWV 31 DoclD16987 Rev 20 5 47 Getting started UM0892 1 1 1 2 Note 1 3 Note 1 4 6 47 Getting started This section describes the requirements and procedures to install the STM32 ST LINK utility software System requirements The STM32 ST LINK utility PC configuration requires as a minimum e PC with USB port and Intel Pentium processor running a 32 bit version of one of the following Microsoft operating systems Windows XP Windows 7 e 256 Mbytes of RAM e 30 Mbyt
3. 00 03 03 03 03 03 03 03 Live Update Disabled gt 00 p REM a 2 20 20 ie 20 js San 20 wide cc PUA A C E N r Note 14 47 Only 10 external loaders can be selected at the same time The external memories connected to the STM32 MCU via FSMC can be accessed automatically through the Device Memory Grid if the corresponding external loader has already been added by using the Add External Loader submenu DoclD16987 Rev 20 d UM0892 STM32 ST LINK utility user interface 2 2 7 Help menu Figure 12 Help menu Help STM32 ST LINK Utility User Manual ST LINK User Manual ST LINK V2 User Manual About STM32 ST LINK utility User Manual Opens the STM32 ST LINK utility User Manual ST LINK User Manual Opens the ST LINK User Manual ST LINK V2 User Manual Opens the ST LINK V2 User Manual Displays STM32 ST LINK utility software version and About copyright information d DoclD16987 Rev 20 15 47 STM32 ST LINK utility features UM0892 3 3 1 3 2 16 47 STM32 ST LINK utility features This section provides a detailed description of how to use STM32 ST LINK utility features Device information Settings Memory display and modification Flash memory erase Device programming Option bytes configuration MCU core functi
4. lt T UM0892 YI YA life dugmented User manual STM32 ST LINK Utility software description Introduction The STM32 ST LINK utility software facilitates fast in system programming of the STM32 microcontroller families in development environments via the tools ST LINK and ST LINK V2 This user manual describes the software functions of the STM32 ST LINK utility When working with the STM32 ST LINK utility it is recommended to download the ST LINK in circuit debugger programmer user manual UM0627 or the ST LINK V2 in circuit debugger programmer user manual UM1075 for the STM8 and STM32 which provide more information about the ST LINK tools Note The part number of STM32 ST LINK utility software is STSW LINKOO4 November 2015 DoclD16987 Rev 20 1 47 www st com Contents UM0892 Contents 1 Getting started 6 1 1 System requirements 6 1 2 Hardware requirements 6 1 3 Installing the STM32 ST LINKuutility 6 1 4 Uninstalling the STM32 ST LINKuutility 6 2 STM32 ST LINK utility userinterface 7 2 1 WINGOW s ibis e aa RR 7 2 2 ses desde aC 8 2 2 1 File MENU iua esent Ree or dat e d Re a oboe ERR acd deles e d 8 2 2 2 EGit Men T PL 9 2 2 3 View menu
5. Device flash Size 2MBytes 10 19 09 Device family STM32F42xx F43xx Debug in Low Power mode enabled Device 10 0 419 The main window is composed of three zones and three bars as illustrated in Figure f Memory display zone Device information zone Memory content zone LiveUpdate checkbox to update memory data in real time This feature is described in more detail in Section 3 3 Title bar name of the current menu Menu bar Use the menu bar to access the following STM32 ST LINK utility functions File menu Edit menu View menu Target menu Help menu These menus are described in more detail in Section 2 2 Status window The status bar displays Connection status and debug interface Device ID Core State active only when LiveUpdate feature is active and memory grid is selected The STM32 ST LINK utility user interface also provides additional forms and descriptive pop up error messages d DoclD16987 Rev 20 7 47 STM32 ST LINK utility user interface UM0892 2 2 Menu bar The Menu bar Figure 2 allows users to explore the STM32 ST LINK utility software features Figure 2 Menu bar File Edit View Target ST LINK External Loader Help 2 2 1 File menu Figure 3 File menu Edit View Target ST LINK Open file CTRL O Save file as CTRL S Close File Compare two files Exit Open file O
6. 4 1 5 Option bytes commands 37 4 1 6 External memory command 43 4 1 7 ST LINK CLIreturncodes 43 5 Revision history 44 Ly DoclD16987 Rev 20 3 47 List of tables UM0892 List of tables Table 1 nBoot1 configuration for STM32FO4K 40 Table 2 nBoot1 configuration for STM32F0 and STM32F3 40 Table 3 ST LINK CLilreturncodes 43 Table 4 Document revision history 44 4147 DoclD16987 Rev 20 Ly UM0892 List of figures List of figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 STM32 ST LINK utility user interface main window 7 Menu Lp KA AA E 8 UME 8 KA PEDI 9 View MCN sasssa Dedede been 9 dE cmm 10 ST EINK men PE a dW eve gee Pia ded a ee 12 External Loader menu
7. CmpFile NNapplication bin 0x08000000 Example2 CmpFile c application hex The user can also compare the file content with an external memory The path of the external memory loader should be specified by the EL cmd Example CmpFile c application bin 0x64000000 EL c Custom Flash Loader stldr Cksum Description Calculates the checksum value using the CRC32 algorithm of a given file or a specified memory zone Syntax Cksum File Path Cksum Address Size Example1 Cksum C File hex Example2 Cksum 0x08000000 0x200 Example3 Cksum 0x90000000 0x200 EL C NCustom Flash Loader stldr Dump Description Reads target memory and save it in a file Syntax Dump Address Memory Size File Path Log Description Enables Trace LOG file generation The log file will be generated under Y ouserprofile STMicroelectronics ST LINK utility NoPrompt Description Disables user confirmation prompts For example to program RDP Level 2 within a file Q Description Enables quiet mode No progress bar displayed DoclD16987 Rev 20 UM0892 STM32 ST LINK utility command line interface CLI TVolt Description Displays target voltage 4 1 5 Option bytes commands rOB Description Displays all option bytes Syntax OB Description Configures the option bytes This c
8. EWARM and TrueSTUDIO The development of the custom loaders can be performed using one of the three toolchains keeping the same compiler linker configurations as the examples To create a new external memory loader follow the steps below 1 Update the device information in Storagelnfo structure in the Dev_Inf c file with the correct information concerning the external memory 2 Rewrite the corresponding functions code in the Loader_Src c file 3 Change the output file name Some functions are mandatory and cannot be omitted see functions description in the Loader Src c file Linker or scatter files should not be modified The Loader Src c functions must always return 1 when the operation succeeded or 0 if it failed After building the external loader project the output file extension must be changed to stldr and the file must be copied under ExternalLoader directory DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features 3 10 Note d Printf via SWO viewer The Printf via SWO Viewer displays the printf data sent from the target through SWO It allows to display some useful information on the running firmware Before starting receiving SWO data the user has to specify the exact target system clock frequency to allow the tool to correctly configure the ST LINK and the target for the correct SWO frequency The Stimulus port combo box allows the user to choose either a given ITM Stimu
9. Option bytes dialog box Added Section 3 2 Settings and Section 4 1 4 Miscellaneous commands Updated Section 2 2 Menu bar Section 3 5 Device programming 41 Feb 2015 18 j bid POM manipulation commands and Updated figures 1 3 4 5 6 7 8 9 10 11 12 13 15 16 17 18 21 and 22 Added Figure 2 Menu bar and Figure 14 Settings dialog box Updated Section 1 2 Hardware requirements Updated Section 3 6 Option bytes configuration Read out protection and BOR level sub paragraphs Updated Figure 19 Option bytes dialog box 23 Jul 2015 19 Added Figure 20 Read write protection mode Added paragraph for STM32L4 devices Updated Section 3 8 Automatic mode functions completing the note below Figure 21 MCU Core panel dialog box Updated Section 4 1 5 Option bytes commands for STM32L4 Series 10 Nov 2015 20 Updated Section 2 2 4 Target menu Section 3 2 Settings Section 4 1 4 Miscellaneous commands d DoclD16987 Rev 20 UM0892 IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections enhancements modifications and improvements to ST products and or to this document at any time without notice Purchasers should obtain the latest relevant information on ST products before placing orders ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowl
10. 8 8 22888 8 8 388888883 3888888888 8 gt 8 818 38 n nonnnn An nn 2 5 2 o 2 5 2 5 10 19 09 ST LINK SN 51FF73064983485235172287 10 19 09 ST LINK Firmware version V2323S0 10 19 09 Connected via SWD 10 19 09 SWD Frequency 1 8 MHz 10 19 09 Connection mode Normal 10 19 09 Debug in Low Power mode enabled 10 19 09 Device ID 0x419 10 19 09 Device flash Size 2MBytes 10 19 09 Device family STM32F42xx F43xx Debug in Low Power mode enabled Device ID 0x419 When the memory data zone displays device memory contents any modification is automatically applied to the chip The user can modify the user Flash memory RAM memory and peripherals registers For the STM32F2 and STM32F4 devices the OTP area can be modified directly from the memory data zone Flash memory erase There are two types of Flash memory erase Flash mass erase Erase all the memory Flash memory sectors of the connected device This is done by clicking on the menu Target Erase Chip Flash Sector Erase Erase the selected sector s of the Flash memory To select sector s go to Target Erase Sectors which then displays the Flash Memory Mapping dialog box where the user can select the sector s to erase as shown in Figure 16 Select all button selects all the Flash memory pages Deselect all button deselects all selected page Cancel button discards the erase
11. Rev 20 UM0892 STM32 ST LINK utility command line interface CLI Note Note Note d List Description Lists the corresponding firmware version and the unique Serial Number SN of every ST LINK probe connected to the computer To have a correct SN the ST LINK firmware version should be e V1J13S0 or greater for ST LINK e V2J21S4 or greater for ST LINK V2 e V2J21M5 or greater for ST LINK V2 1 When an ST LINK v2 or ST LINK V2 1 probe is used with another application the serial number will not be displayed and the probe cannot be used in the current instance of ST LINK utility r8 Description Reads NumBytes memory Syntax r8 Address lt NumBytes gt Example r8 0x20000000 0x100 w8 Description Writes 8 bit data to the specified memory address Syntax w8 lt Address gt lt data gt Example w8 0x20000000 OxAA w8 supports writing to Flash memory OTP SRAM and R W registers w32 Description Writes 32 bit data to the specified memory address Syntax w32 lt Address gt lt data gt Example w32 0x08000000 OxAABBCCDD w32 supports writing to Flash memory OTP SRAM and R W registers Core commands Rst Description Resets the system Syntax Rst HardRst Description Hardware reset Syntax HardRst DoclD16987 Rev 20 33 47 STM32 ST LINK utility command line interface CLI UM0892 Note 34 47 HardRst command is available
12. ST LINK utility directory see Section 3 9 Developing customized loaders for external memory for more details on how to create a custom loader When the external loaders have been selected in the External Loader dialog box see Figure 9 new submenus are displayed one per each external loader selected They offer all the functions Program Sector Erase available in the corresponding external loader see Figure 10 d DoclD16987 Rev 20 UM0892 STM32 ST LINK utility user interface Figure 9 External Loader window Device Name Device Type Start Address IS61WV102416BLL STM324xSI VAL Static Ram 0x64000000 1S61WV102416BLL_STM324xG EVAL Static Ram 0x64000000 IS61WV51216BLL STM3210E EVAL Static Ram 0x68000000 M25P64 STM3210E EVAL Spi Flash 0x00000000 M29W128GL STM3210E EVAL Nor Flash 0x64000000 M29W128GL STM324x9I EVAL Nor Flash 0 60000000 M29W128GL STM32F756G EVAL Nor Flash 0 60000000 M29W 128GL_STM32L476G EVAL Nor Flash 0x64000000 MT48LC2M32B2 STM324x9I EVAL Static Ram OxC0000000 N25Q256A STM32l4xx EVAL Nor Flash 0x90000000 validate Deselect Al Figure 10 External Loader submenus Add External Loader MT48LC2M32B2 STM324x9I EVAL gt N25Q256A STM32M xx EVAL Sector Erase Close external memory grid Program Read The contents of the external memory is displayed in the external me
13. The lt Value gt should be 0 or 1 0 It allows the user to disable BOOTO hardware pin completely and use User Option bit 11 nBootO 1 The pin is bonded to GPIO pin PB8 on LQFP32 and smaller packages PF11 for QFN32 and bigger packages nBoot0 lt Value gt Only for STM32F04x and only when nBootO SW Cfg is set The Value should be 0 or 1 Select the Boot mode together with nBoot1 See table below nBoot1 lt Value gt Only for STM32F0 and STM32F3 The lt Value gt should be 0 or 1 Table 1 nBoot1 configuration for STM32F04x nBoot1 nBoot BOOTO pin nBoot0 SW Cfg Flash empty Boot mode X 0 1 no Main Flash memory X X 0 1 yes System memory 0 X 1 1 X Embedded SRAM 1 X 1 1 X System memory X 1 X 0 X Main Flash memory 0 X 0 X Embedded SRAM 1 X 0 X System memory Table 2 nBoot1 configuration for STM32F0 and STM32F3 nBoot1 BOOTO Boot mode X 0 Main Flash memory 0 1 Embedded SRAM 1 1 System memory 40 47 DoclD16987 Rev 20 UM0892 STM32 ST LINK utility command line interface CLI Note Note Note Note Note Note d nSRAM Parityz Value This bit allows the user to enable the SRAM hardware parity check The Value should be 0 or 1 nSRAM is available only on STM32F0 and STMS2F3 SDADC12_VDD lt Value gt It selects the analog monitoring comparison with Bgap 1 2V voltage on SDADC12_VDD
14. and STM32L 1 devices read protection levels are available Level 0 no read protection Level 1 memory read protection enabled Level 2 memory read protection enabled and all debug features disabled For the other devices the read protection can only be enabled or disabled BOR Level Brownout reset level This list contains the supply level threshold that activates releases the brownout reset This option is enabled only when connected to the STM32L1 STM32F2 STM32L4 and STM32F4 devices For STM32L4 devices 5 programmable VBOR thresholds can be selected BORLEVEL Reset level threshold is around 1 7 V BOR LEVEL 1 Reset level threshold is around 2 0 V BOR LEVEL 2 Reset level threshold is around 2 2 V BOR LEVEL 3 Reset level threshold is around 2 5 V BOR LEVEL 4 Reset level threshold is around 2 8 V For ultra low power devices 5 programmable VBOR thresholds can be selected BOR LEVEL 1 Reset threshold level for 1 69 to 1 8 V voltage range BORLEVEL 2 Reset threshold level for 1 94 to 2 1 V voltage range BOR LEVEL 3 Reset threshold level for 2 3 to 2 49 V voltage range BOR LEVEL 4 Reset threshold level for 2 54 to 2 74 V voltage range BOR LEVEL 5 Reset threshold level for 2 77 to 3 0 V voltage range STM32F2 and STM32F4 devices 4 programmable VBOR thresholds can be selected LEVEL 3 Supply voltage ranges from 2 70 to 3 60 V BORLEVEL 2 Supply vo
15. for the protected zone in bank A Start Address The start address defined by the PCROPA strt field PCROPA end The PCROP end field for the protected zone in bank A End Address The end address defined by the PCROPA end field 27 47 STM32 ST LINK utility features UM0892 Read Write Protection bank B if checked PCROPB_STRT PCROPB_END Start address H and End address H fields are editable so the user can enter either the PCROP STRT END field or the start end address Protect entire bank B if checked all the bank B is pcrop protected PCROPB strt The PCROP start field for the protected zone in bank B Start Address The start address defined by the PCROPB strt field PCROPB end The PCROP end field for the protected zone in bank B End Address The end address defined by the PCROPB end field For more details refer to the option bytes section in the Flash programming manual and reference manual available from www st com 3 7 MCU core functions The Core panel dialog box shown in Figure 21 displays the Cortex M3 core register values It also allows to carry out the following actions on the MCU using the buttons on the right Run Run the core Halt Halt the core System Reset Send a system reset request Core Reset Reset the core Step Execute only one step core instruction Read Core Reg Update the core registers values Figure 21 MCU Core panel dialog box R 0 0 R14 R1 R8
16. interface 2 STM32 ST LINK utility user interface 2 1 Main window Figure 1 STM32 ST LINK utility user interface main window STM32 ST LINK Utility Co o Title bar Fie Edt View Target ST LINK External Loader Menu bar gt 2 2 9 Memory display Device STM32F42xx F43xx Address 0x08000000 Size 0x100 DataWidth sbits LM Revision ID 1 Device Memory 0x08000000 Binary File Flash size 2MBvtes LiveUpdate Device Memory Address jn i SE De Be EE EE 008000000 00 o 0 0 o 00 08 35 1F 00 08 E 08 00 0508000010 09 1E 00 08 00 loo oo 45 2D 00 09 09 loo A 0508000020 00 00 00 00 00 00 00 0 0 00 4D 2 00 o8 Main window 4D 08 00 00 00 00 29 23 00 08 05 2B 0 08 Ox8000000 oB oo o8 0 0 0 DB Ol 0008000050 DB 01 00 08 01 00 08 01 00 08 DB 0 00 008000060 DB 00 08 00 00 00 DB o 00 DB 00 008000070 DB 00 08 39 02 00 08 DB o 00 08 02 00 008000080 DB 01 00 08 DB o 00 08 DB 00 08 DB 00 008000090 00 00 00 00 DB 00 DB 00 08 DB 00 08 pre SS 10 19 09 ST LINK SN 51FF73064983485235172287 10 19 09 ST LINK Firmware version V212350 innected via SWD VD Frequency 1 8 MHz innection mode Normal 10 19 09 Debug in Low Power mode enabled Status bar gt pean tonpo 10 19 09
17. on last page DoclD16987 Rev 20 45 47 Revision history UM0892 46 47 Table 4 Document revision history continued Date Revision Changes Updated Section 2 2 4 Target menu Settings description 10 Jul 2013 12 Deleted Applicable tools table and updated part number in cover page Updated Figure 9 External Loader window Figure 18 Device programming dialog box programming and Figure 22 Automatic mode 04 Nov 2013 43 Updated bullet 4 and added bullet 5 to Section 3 5 Device programming and updated bullet 3 in Section 3 8 Automatic mode functions Updated the following commands V WRP Value WRP2 lt Value gt and WRP3 lt Value gt and added WRP4 lt Value gt 16 Dec 2013 14 Updated Section 1 3 Installing the STM32 ST LINK utility description Updated Chapter 4 1 5 Option bytes commands Syntax OB added 13 Feb 2014 15 nSRAM_Parity lt Value gt nBootO_SW_Cfg lt Value gt updated nBoot1 lt Value gt updated WRP lt Value gt added WRP4 lt Value gt Added support for ST32L0 Series 16 May 2014 16 Updated Section 2 2 4 Target menu Section 3 8 Automatic mode functions Section 4 1 1 Connection and memory manipulation commands and Section 2 2 5 ST LINK menu Updated User Configuration option bytes and added Boot address option bytes in Section 3 6 Option bytes configuration W Updated Section 4 1 5 Option bytes commands Updated Figure 19
18. threshold is around 2 5 V 4 Reset level threshold is around 2 8 V For STM32L1 Series 0 BOR OFF 1 45 to 1 55 V voltage range 1 1 69 to 1 8 V voltage range 2 1 94 to 2 1 V voltage range 3 2 3 to 2 49 V voltage range 4 2 54 to 2 74 V voltage range 5 2 77 to 3 0 V voltage range For STM32F2 and STM32F4 Series 0 BOR OFF 1 8 to 2 10 V voltage range 1 2 10 to 2 40 V voltage range 2 2 40 to 2 70 V voltage range 3 2 70 to 3 60 V voltage range IWDG_SW lt Value gt The lt Value gt should be 0 or 1 0 Hardware independent watchdog 1 Software independent watchdog nRST_STOP lt Value gt The lt Value gt should be 0 or 1 0 Reset generated when CPU enters the Stop mode 1 No reset generated nRST_STDBY lt Value gt The lt Value gt should be 0 or 1 0 Reset generated when CPU enters the Standby mode 1 No reset generated PCROP_RDP lt Value gt The lt Value gt should be 0 or 1 0 PCROP area is not erased when the RDP level is decreased from Level 1 to Level 0 1 PCROP area is erased when the RDP level is decreased from Level 1 to Level 0 full mass erase 38 47 DoclD16987 Rev 20 Ly UM0892 STM32 ST LINK utility command line interface CLI PCROPA_STRT lt Value gt Sets the PCROP start zone for bank A Refer to the reference manual of the corresponding device lt Value gt PCROPA_END Sets the PCROP end zone for bank A Refer to the reference manual of the corresponding device lt Va
19. utility features d For STM32L4 devices PCROP zone is defined by two addresses as following Figure 20 Read write protection mode User data storage option bytes Data 0 Flash sectors protection Flash protection mode PCROPB stt 0x05 PCROPB end 0x12 p Option Bytes Read Dut Protection BOR Level Level 0 v Level 0 User configuration option byte 4 wDG Sw V IWDG_STDBY nBootD v IwDG STOP IwDG ULP nBOOTO 7 WwDG Sw iDG STOP V nBootl nSRAM Parity FZ IwDG STDBY BDOTI 7 SRAM2 RST V PROP nDBOOT 7 SRAM2_PE nBoot SW Cfg nBOOT SEL V nRST SHDwW BOOTO nS Config V BFB2 V nRST STOP Monitor DUALBANI V nRST STDBY nDBANK SDADC12 VDD Monitor DB1M Boot address option bytes BOOT ADDO Boot from BOOT amp DD1 H Boot from 4 Read Write Protection Bank OxFFFF 4 Read Write Protection Bank B Start Address 0x08080028 End Address 008080090 Data 1 Read Write protection w Ox0807FFF8 VI Protect entire Bank A Protect entire Bank B Apply Cancel Read Write protection bank if checked PCROPA STRT PCROPA END Start address H and End address H fields are editable so the user can enter either the PCROP STRT END field or the start end address DoclD16987 Rev 20 Protect entire Bank A if checked all the bank A is pcrop protected PCROPA strt The PCROP start field
20. 00 APSR 0 0 Halt R2 R3 0 0 IPSR 0x0 System Reset _ R3 R10 0x0 EpsR 01000000 A R4 R11 0x0 PSR 01000000 Core Reset R5 R12 0 0 PSP 0 0 Step RB R13 0 20000A 0 0520000810 Core State Halted pc 0x800026c Read Core Reg Note The PC and MSP registers can be modified from this panel 28 47 DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features 3 8 d Automatic mode functions The Automatic mode dialog box shown in Figure 22 allows programing and configuring STM32 devices in loop It allows to carry out the following actions on the STM32 devices Full chip erase Flash programming Verify while programming Verify after programming Option bytes configuration Run application Clicking on the Start button will execute the selected actions on the connected STM32 device and will wait to repeat the same actions after disconnecting the current device and connecting the new device Figure 22 Automatic mode File C hex files STM32F407 hex Actions Full chip erase Flash programming Verify Verify while programming Verify after programming Option bytes configuration Configure Run application DoclD16987 Rev 20 29 47 STM32 ST LINK utility features UM0892 Note 3 9 Note 30 47 If the user deselects Flash programming action while the STM32 Flash memory is readout protected it will be automatically unpr
21. EP Failed to perform a single instruction step 10 SetBP Failed to set clear a breakpoint 11 ME SE Unable to erase one or more Flash sectors 12 P V Flash programming verification error 13 OB Option bytes programming error DoclD16987 Rev 20 43 47 Revision history UM0892 5 44 47 Revision history Table 4 Document revision history Date 22 Jan 2010 Revision Changes Initial release 12 Feb 2010 Changed figures 1 2 3 4 5 6 and 7 Added SWD support 20 May 2010 Added support of XL density devices in Section 2 2 4 and Section 3 6 27 Aug 2010 AJOJN Added support of STM32L1 03 Feb 2011 Hex srec format support Command Line Interface support Changed name and all figures Added Section 3 8 Automatic mode functions 01 Aug 2011 Added ST LINK V2 support in Section 1 2 Hardware requirements and support of different programming modes for STM32 Series in Section 3 5 Device programming and Section 4 1 3 Flash commands Added MCU revision ID Display in Section 3 1 Device information 18 Oct 2011 Added support of STM32W and STM32F4 throughout the document Added support of Connect under reset option in Section 2 2 4 Target menu Replaced Figure 21 MCU Core panel dialog box Updated Flash with modifications in Section 3 3 Memory display and modification via GUI commands and in Section 4 1 1 Connection and memory manipulatio
22. NK utility user interface UM0892 2 2 4 Target menu Figure 6 Target menu ST LINK External Loader Help Connect Disconnect CTRL D Erase Chip CTRL E Erase 1 Erase Bank2 Erase Sectors Program Program amp Verify CTRL P Blank Check Memory Checksum Target memory compare with file Option Bytes CTRL B MCU Core Automatic Mode Settings Connects to the target device and displays the Device Type Device ID and Connect Flash memory size in the device information zone Disconnect Disconnects from the target device Erase Chip Performs a Flash memory mass erase and then displays the Flash memory content in the memory panel Erases bank 1 of the Flash memory This menu is enabled only when Erase banki connected to an KL density device Erases bank 2 of the Flash memory This menu is enabled only when Erase Bank2 connected to an KL density device Selects sector s to erase using the erase sectors dialog window see Frage SECtOrS Section 3 4 Flash memory erase for more details Loads a binary Intel Hex or Motorola S record file into the device memory Flash or RAM To do this select a binary Intel Hex or Motorola S record file Program enter the start address where to put the file in the device in the program dialog window and then click on program button see Section 3 5 Device programming Loads a binary Intel Hex or Motorola S record file into the device me
23. Power source The lt Value gt should be 0 or 1 SDADC12_VDD is available only on STM32F37x devices Data0 lt Value gt Data0 sets the Data0 option byte The Value should be in 0 0xFF Not available on STM32F0 STM32F2 STM32F3 STM32F4 and STM32L1 devices Data1 lt Value gt Data1 sets the Data1 option byte The Value should be in 0 0xFF Not available on STM32F0 STM32F2 STM32F3 STM32F4 and STM32L1 devices SPRMOD lt Value gt Selection of Protection Mode of WPRi bits The lt Value gt should be 0 or 1 0 WPRi bits used for Write Protection on sector i Default 1 WPRi bits used for PCRoP Protection read protection on sector i Sector Available only on devices supporting PCRop feature WPRMOD lt Value gt Selection of Protection Mode of WPRi bits The lt Value gt should be 0 or 1 0 WPRi bits used for Write Protection on sector i Default 1 WPRi bits used for PCRoP Protection read protection on sector i Sector Available only on LO devices supporting PCRop feature DoclD16987 Rev 20 41 47 STM32 ST LINK utility command line interface CLI UM0892 Note Note 42 47 WRP lt Value gt WRP enables disables the write protection of the MCU Flash sectors Each bit will enable disable the write protection of one sector or more depending on the connected device For STM32L1 devices WRP i 0 Flash sector s is protected For other devices WRP i 1 Flas
24. before downloading e To use this zone to display the content of a binary Intel Hex or Motorola S record file go to File Open file e To use this zone to read and display memory content of a connected device enter the memory start Address data Size and the Data Width in the Memory display zone and then press Enter e After reading data the user can also modify each value merely by double clicking on the concerned cell as illustrated by Figure 15 The user can also save the device memory content into a binary Intel Hex or Motorola S record file using the menu File Save file as e When LiveUpdate feature is used the device memory grid will be updated in real time and the data that have been modified will be colored in red d DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features Note 3 4 d Figure 15 STM32 ST LINK utility user interface 88 STM32 ST LINK Utility File Edit View Target ST LINK External Loader Help T za lt euqoomg Memory display Device STM32F42xx F43xx Device ID 0 419 Revision ID Revi Flash size 2MBvtes Address 0x08000000 w Size 0x100 Data Width 8bits Device Memory amp 0x08000000 Binary File Device Memory Address 0x08000000 0x08000010 0x08000020 0 08000030 E 8 5 00 00 00 0 08000050 DB 12 39 DB DB nn 8888888888 9888989998 288828888288
25. ces Only available on STM32L4 devices supporting Dual Bank mode Only available on STM32F42x STM32F43x 1 Mbyte devices Only available on STM32F0 and STM32F3 devices Only available on STM32F37x devices Only available on STM32F04x devices DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features d If checked the BOOTO pin is bonded to GPIO pin PB8 on LQFP32 and smaller packages PF11 for QFN32 and bigger packages Boot address option bytes for devices supporting BOOT ADDx it allows the boot from base address defined by option bytes BOOT ADDx BOOT ADDx 15 0 corresponds to address 29 11 For devices supporting both BOOT ADDO and BOOT ADD 1 it depends upon BOOTO pin f BOOTO 0 boot from base address defined by option bytes BOOT ADDO If BOOTO 1 boot from base address defined by option bytes BOOT ADD1 The user can enter either the address of the boot or the BOOT ADDx option bytes values User data storage option bytes contains two bytes for user storage These two option bytes are not available in the STM32F0 STM32F2 STM32F3 STM32F4 and STM32L devices Flash Sectors Protection depending on the connected device Flash sectors are grouped by a defined number of pages The user can modify the write protection of each Flash sector here For devices supporting PCRop feature it is possible to enable disable the Read protection of each sector The Flash protection mode allows to choose between
26. done during the programming operation b Ifthe Reset after programming box is checked an MCU reset will be issued The STM32F2 and STM32F4 Series supports different programming modes depending on the MCU supply voltage When using ST LINK the MCU supply voltage should be specified in the Target Settings Menu to be able to program the device with the correct mode When using ST LINK V2 the supply voltage is detected automatically If the device is read protected the protection will be disabled If some Flash memory pages are write protected the protection will be disabled during programming and then recovered The user can program Hex Srec files that contains multiple segments for different target memory locations Internal flash memory external flash memory Option bytes When programming the Read Out Protection to level 2 debug and boot in SRAM system Memory features are DISABLED a message box will be displayed for confirmation to avoid protecting the chip by accident DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features 3 6 Option bytes configuration The STM32 ST LINK utility can configure all the option bytes via the Option bytes dialog box shown in Figure 19 which is accessed by Target Option bytes The Option bytes dialog box contains the following sections Read Out protection Modifies the read protection state of the Flash memory For STM32F0 STM32F2 STM32F3 STM32F4 STM32L4
27. ected ST LINK probes to use based on its serial number or on the connected target which is displayed in the STM32 target information section When using ST LINK V2 or ST LINK V2 ISOL the target voltage is measured and displayed in the STM32 target information section Available connection settings e JTAG or SWD e Frequency only for SWD connection e Mode Normal Connect Under Reset Hot Plug e Enable Disable debug in low power mode e Enable Disable Trace LOG file generation Available reset modes e software system reset e hardware reset e core reset DoclD16987 Rev 20 17 47 STM32 ST LINK utility features UM0892 Note 3 3 18 47 When the connect under reset mode is selected the hardware reset mode will be automatically selected When programming the option bytes a reset is issued at the end of the operation This reset is handled separately and is not affected by this option Memory display and modification In addition to the Device information zone the main window contains two other zones e Memory display e Memory data Memory display This zone contains three edit boxes Address Memory start address from which the user wants to read Size Amount of data to read Data width Width of the displayed data 8 bit 16 bit or 32 bit Memory data This zone displays the data read from a file or the memory content of a connected device The user can modify the content of the file
28. edgement Purchasers are solely responsible for the choice selection and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product ST and the ST logo are trademarks of ST All other product or service names are the property of their respective owners Information in this document supersedes and replaces information previously supplied in any prior versions of this document 2015 STMicroelectronics All rights reserved d DoclD16987 Rev 20 47 47
29. es of hard disk space available Hardware requirements The STM32 ST LINK utility is designed to work with e STM32F0 STM32F1 STM32F2 STM32F3 STM32F4 STM32L4 STM32L 1 STM32L0 and STM32W Series ST LINK or ST LINK V2 or ST LINK V2 ISOL in circuit debugger programmer probe In this document ST LINK V2 refer to ST LINK V2 and ST LINK V2 ISOL which are functionally equivalent Installing the STM32 ST LINK utility Follow these steps and the on screen instructions to install the STM32 ST LINK utility 1 Download the compressed STM32 ST LINK utility software from the ST website 2 Extract the contents of the zip file into a temporary directory 3 Double click the extracted executable setup exe to initiate the installation and follow the on screen prompts to install the STM32 ST LINK utility in the development environment The documentation for the utility is located in the subdirectory Docs where the STM32 ST LINK utility is installed If an earlier version of STM32 ST LINK utility software is already installed follow the uninstalling instructions described in Section 1 4 before installing the new version Uninstalling the STM32 ST LINK utility Follow these steps to uninstall the STM32 ST LINK utility 1 Select Start Settings Control Panel 2 Double click on Add or Remove Programs 3 Select STM32 ST LINK utility 4 Click on the Remove button DoclD16987 Rev 20 UM0892 STM32 ST LINK utility user
30. h sector s is protected This command is sufficient to enable disable all Flash sector protection except for STM32L1 medium density plus and High density where WRP2 and WRP3 and WRP4 commands can be mandatory For STM32F4 Series each bit of WRP enables disables the write protection of one sector The Value should be in 0 0xFFFFFFFF For devices supporting PCRop feature WRP controls the read protection of the MCU Flash sectors when SPRMOD 1 WRP2 lt Value gt WRP2 is available only for STM32L1 medium density plus high density and high density plus devices to enable disable the protection of Flash sectors from page 512 to 1023 The Value should be in 0 0xFFFFFFFF For devices supporting PCRop feature WRP controls the read protection of the MCU Flash sectors when SPRMOD 1 WRP3 lt Value gt WRP3 is available only for STM32L1 high density and high density plus devices to enable disable the protection of Flash sectors from page 1024 to 1535 The Value should be in 0 0xFFFFFFFF WRP4 lt Value gt WRP4 is available only on STM32L1 high density plus devices to enable disable the protection of flash sectors from sector 1536 to sector 2047 The Value should be in 0 0xFFFFFFFF BOOT_ADD0 lt Value gt Boot Address enable when 0 The Value should be in 0 OxFFFF BOOT ADDO 15 0 corresponds to address 29 14 DoclD16987 Rev 20 UM0892 STM32 ST LINK utility com
31. he update of the ST LINK probe List When the user selects one probe the user can read the firmware version and the connected target depending on the connection settings After that the user can choose the debug interface JTAG or SWD Also the reset type can be selected The connect under reset option allows to connect to the target before executing any instruction This is useful in many cases like when the target contains a code that disables the JTAG SWD pins The HotPlug option allows to connect to the target without halt or reset This is useful to update RAM addresses or IP registers while application is running When connecting to the target via an ST LINK V2 the Supply voltage combo box displays the target voltage When connecting to an STM32F2 or STM32F4 device using an ST LINK the Supply voltage combo allows to select the supply voltage of the target to be able to correctly program the Flash memory The Enable debug in Low power mode option allows to connect to a device in low power mode If any connection settings changes the dialog tries to identify the target with the new connection settings The connect under reset option is available only with ST LINK V2 and in SWD mode For JTAG mode connect under reset is available since ST LINK V2 firmware Version V2J15Sx The RESET pin of the JTAG connector pin 15 should be connected to the device reset pin The HotPlug option is available in SWD m
32. hecked a reset is generated when entering Standby mode 1 8 V domain powered off If checked no reset is generated when entering Standby mode nRST STDBY lf not checked reset is generated when entering Stop mode all clocks are stopped If checked no reset is generated when entering Stop mode nBFB2 If not checked and if the boot pins are set to make the device boot from the user Flash at startup the device boots from Flash memory bank 2 otherwise it boots from Flash memory bank 1 This option is enabled only when connected to a device containing two Flash banks nBoot1 9 Together with the BOOTO pin selects the Boot mode nBoot1 checked unchecked and BOOTO 0 gt Boot from Main Flash memory nBoot1 checked and BOOTO 1 gt Boot from System memory nBoot1 unchecked and BOOTO 1 gt Boot from Embedded SRAM VDDA Monitor 9 Selects the analog monitoring on VDDA Power source If checked VDDA power supply supervisor is enabled otherwise it is disabled nSRAM Parity This bit allows the user to enable the SRAM hardware parity check If checked SRAM parity check is disabled otherwise it is enabled SDADC 12 VDD Monitor If checked SDADC12 VDD power supply supervisor is enabled otherwise it is disabled nBootO SW This bit allows the user to completely disable BOOTO hardware pin and use User Option bit 11 nBootO 5 m o Only available on STM32L4 devi
33. l gt Erases data eeprom at 0x08080000 SE ed2 Erases data eeprom at 0x08081800 P Description Loads binary Intel Hex or Motorola S record file into device memory without verification For hex and srec format the address is relevant Syntax P File Path Address Examples P C Vfile srec P C file bin 0x08002000 P C file hex STM32F2 and STM32F4 Series support different programming modes depending on the MCU supply voltage When using ST LINK V2 the supply voltage is detected automatically Therefore the correct programming mode is selected When using ST LINK the 32 bit programming mode is selected by default If the device is read protected the protection will be disabled If some Flash memory pages are write protected the protection will be disabled during programming and then recovered V Description Verifies that the programming operation was performed successfully Syntax V while programming after programming Example P C file srec V after programming If no argument is provided the while programming verification method will be performed DoclD16987 Rev 20 35 47 STM32 ST LINK utility command line interface CLI UM0892 4 1 4 36 47 Miscellaneous commands CmpFile Description Compares a binary Intel Hex or Motorola S record file with device memory and displays the address of the 1st different value Syntax CmpFile File Path lt Address gt Example
34. ltage ranges from 2 40 to 2 70 V BORLEVEL 1 Supply voltage ranges from 2 10 to 2 40 V BOR off Supply voltage ranges from 1 62 to 2 10 V User Configuration option bytes WDG SW If checked the watchdog is enabled by software Otherwise it is automatically enabled at power on IWDG STOP If not checked the independent watchdog counter is frozen in STOP mode If checked this counter is active in STOP mode IWDG STBY If not checked the independent watchdog counter is frozen in Standby mode If checked this counter is active in Standby mode WWDG SW checked the window watchdog is enabled by hard option bit DoclD16987 Rev 20 23 47 STM32 ST LINK utility features UM0892 24 47 SRAM2_RST This bit allows the user to enable the SRAM2 erase on system reset If checked SRAM2 is not erased when a system reset occurs If not checked SRAM2 is erased when system reset occurs SRAM_PE This bit allows the user to enable the SRAM2 hardware parity check If checked SRAM2 parity check is disabled DUALBANK If checked 512 256K Dual Bank Flash with contiguous addresses DB1M 9 Dual Bank on 1 Mbyte Flash PCROP_RDP If checked PCROP area is erased when the RDP level is decreased from Level 1 to Level 0 full mass erase nRST SHDW 9 If checked no reset is generated If not checked reset is generated when entering the Shutdown mode nRST STOP If not c
35. lue gt PCROPB_STRT Sets the PCROP start zone for bank B Refer to the reference manual of the corresponding device lt Value gt PCROPB_END Sets the PCROP end zone for bank B Refer to the reference manual of the corresponding device lt Value gt VDDA lt Value gt The lt Value gt should be 0 or 1 0 VDDA power supply supervisor disabled 1 VDDA power supply supervisor enabled DUALBANK lt Value gt The lt Value gt should be 0 or 1 0 Single bank Flash 1 Dual bank Flash BFB2 lt Value gt Dual bank boot The lt Value gt should be 0 or 1 0 Dual bank boot disable 1 Dual bank boot enable SRAM2_RST lt Value gt SRAM2 Erase when system reset The lt Value gt should be 0 or 1 0 SRAM2 erased when a system reset occurs 1 2 is not erased when a system reset occurs SRAM2_PE lt Value gt 2 parity check enable The Value should be 0 or 1 0 SRAM2 parity check enable 1 SRAM2 parity check disable DoclD16987 Rev 20 39 47 STM32 ST LINK utility command line interface CLI UM0892 nBFB2 lt Value gt The lt Value gt should be 0 or 1 0 Boot from Flash bank 2 when boot pins are set in boot from user Flash position defa ult 1 Boot from Flash bank 1 when boot pins are set in boot from user Flash position defa ult Note 2 is available only on devices containing two Flash banks nBoot0_SW_Cfg lt Value gt Only for STM32F04x
36. lus port from port 0 to 31 or to receive data from all ITM Stimulus ports simultaneously Figure 23 Serial wire viewer window SWV Gi Serial Wire Viewer e Y Sa Settings System dock Hz 168000000 Stimulus port All Start SWV Frequency 2000 KHz Stimulus port All Status Stopped data number 12583 0 gt Printf data on port 0 0 data on port 1 0 Printf data on port 2 0 data on port 3 0 gt data on port 4 0 Printf data on port 5 0 gt Printf data on port 6 0 Printf data on port 7 0 Printf data on port 8 0 Printf data on port 9 0 gt data on port 10 0 gt Printf data on port 11 0 gt Printf data on port 12 0 Printf data on port 13 0 gt Printf data on port 14 m The SWV information bar displays useful information on the current SWV transfer such as the SWO frequency deduced from the system clock frequency and the received expressed in bytes Some SWV bytes could be lost during transfer due to ST LINK hardware buffer size limitation DoclD16987 Rev 20 31 47 STM32 ST LINK utility command line interface CLI UM0892 4 4 1 Note 32 47 STM32 ST LINK utility command line interface CLI Command line usage The following sections describe how to use the STM32 ST LINK utility from the command line The ST LINK utility command line interface is located at the following addres
37. mand line interface CLI Note Note d BOOT_ADD1 lt Value gt Boot Address enable when BOOTO 1 The Value should be in 0 0xFFFF BOOT ADD1 15 0 correspond to address 29 14 DB1M lt Value gt Dual Bank on 1 Mbyte Flash memory The Value should be 0 or 1 Available on STM32F42x STM32F43x 1 Mbyte devices supporting dual bank swap All parameters listed above should be in hexadecimal format For more details refer to the Option bytes section in the Flash programming manual corresponding to the device available at www st com External memory command EL Description Selects a custom Flash memory loader for external memory operations Syntax EL 1oader File Path Example P c application hex EL c Custom Flash Loader stldr ST LINK CLI return codes In case of error while executing ST LINK commands the return code Errorlevel will be greater than O The following table summarizes the ST LINK CLI return codes Table 3 ST LINK CLI return codes Return code Command Error 1 All Command arguments error 2 All Connection problem 3 All Command not available for the connected target 4 w8 w32 Error occurred while writing data to the specified memory address 5 r8 r32 Cannot read memory from the specified memory address 6 rst HardRst Cannot reset MCU 7 Run Failed to run application 8 halt Failed to halt the core 9 ST
38. mory Program amp Verify Flash or RAM then performs a verification of the programmed data Verifies that the STM32 Flash memory is blank If the Flash memory is not Blank Check blank the first address with data is highlighted in a prompt message 10 47 DoclD16987 Rev 20 Ly UM0892 STM32 ST LINK utility user interface Note d Memory checksum Compare device memory with file Option bytes MCU Core Automatic Mode Settings Calculates the checksum value of a specified memory zone defined by the address and the size fields in the Memory display section of the main window The checksum is calculated based on CRC32 algorithm The checksum value is displayed in the log window Compares the MCU device memory content with a binary hex or srec file The difference is colored in red in the file panel Opens the option bytes dialog window See Section 3 6 Option bytes configuration for more details Opens the MCU Core dialog window See Section 3 7 MCU core functions for more details Opens the Automatic mode dialog window See Section 3 8 Automatic mode functions for more details The Settings dialog box allows to select one ST LINK probes and defines its connection settings The ST LINK probes a list which contains the serial numbers of all probes connected to the computer If during the Settings dialog box is shown and some probes are added or removed the Refresh button allows t
39. mory grid Figure 11 Selecting the Close external memory grid submenu shuts down the external memory grid window 4 DoclD16987 Rev 20 13 47 STM32 ST LINK utility user interface UM0892 Figure 11 External memory grid File Edit View Target ST LINK External Loader Help Memory display Address 0 60000000 v Size Sad Bw 0x00002000 Data Width 8 bits v Device Memory 0x08000000 File STM32F407 hex External Memory 0 60000000 Device Device ID Revision ID STM32F42xx F43xx 0 419 Rev 1 2MBvtes External Memory 0x60000000 Address 0x60000000 0x60000010 0x60000030 0x60000040 0x60000020 9D 00 A3 AB B3 BB CB 03 00 03 03 03 03 03 03 11 19 26 SWD Frequency 1 8 MHz 11 19 26 Connection mode Normal 11 19 26 Debug in Low Power mode enabled 11 19 26 Device ID 0x419 11 19 26 Device flash Size 2MBytes 11 19 26 Device family STM32F42xx F43xx 11 19 32 STM32F407 hex opened successfully Address Ranges 0 08000000 0 080001 4 0x08000 1D0 0x08027C66 0x08027C68 0 08027 52 0x08027E54 0x08028 146 008028148 0x0802 9F 00 AD B5 BD c5 CD 03 00 00 03 03 03 03 03 Al 00 B7 BF AT AF C7 CF 88888885858 85855588558 03 00 03 03 03 03 03 03 20 20 00 20 20 20 20 20 20
40. n bytes commands Fixed typos 11 Jan 2013 10 Updated Section 1 1 System requirements Updated Section 2 1 Main window including Figure 1 STM32 ST LINK utility user interface main window LiveUpdate checkbox and Edit menu Updated Figure 3 Added Section 2 2 2 Edit menu including Figure 4 Edit menu Updated Figure 5 Updated Section 2 2 4 Target menu including Figure 6 Updated Section 2 2 5 ST LINK menu including Figure 7 Updated Figure 12 Updated Section 3 3 Memory display and modification inlcuding Figure 15 Updated Section 4 1 Command line usage HotPlug Added lt gt in the syntax of OB command see Section 4 1 5 Replaces all occurrences of BFB2 by nBFB2 30 Apr 2013 11 Updated Figure 1 STM32 ST LINK utility user interface main window Figure 3 File menu Added external memory in Section 2 2 3 View menu Added printf data in Section 2 2 5 ST LINK menu Added Section 2 2 6 External Loader menu Updated Figure 12 Help menu Figure 15 STM32 ST LINK utility user interface Figure 17 Open file dialog box Figure 19 Option bytes dialog box Figure 21 MCU Core panel dialog box and Figure 22 Automatic mode Added Section 3 9 Developing customized loaders for external memory and Section 3 10 Printf via SWO viewer Added CmpFile in Section 4 1 3 Flash commands Added Section 4 1 6 External memory command Updated disclaimer
41. n commands via CLI commands Added HardRst command in CLI mode in Section 4 1 2 Core commands Added WRP2 and WRP3 for STM32L1 high density devices in Option byte command parameter descriptions 11 May 2012 Added support of STM32F0 Added Table 1 Applicable tools Replaced Figure 1 Figure 15 Figure 18 Figure 19 and Figure 22 Added note for JTAG mode in Section 2 2 4 Target menu Added nBoot1 VDDA and nSRAM Parity commands in Option byte command parameter descriptions Updated connect under reset option in Section 2 2 4 Target menu Updated c command and added Q command in Section 4 1 1 Connection and memory manipulation commands Added Section 4 1 7 ST LINK CLI return codes d DoclD16987 Rev 20 UM0892 Revision history d Table 4 Document revision history continued Date 05 Oct 2012 Revision Changes Added support of STM32F050 STM32F3 STM32L medium density plus Added Compare two files in Section 2 2 1 File menu and replaced Figure 3 Replaced Figure 6 Added Reset after programming option in Section 3 5 Device programming and replaced Figure 17 to Figure 13 Added SPRMOD command in Section 4 1 5 Option bytes commands Updated Flash sector protection in Section 3 6 Option bytes configuration and replaced Figure 19 In Section 3 7 MCU core functions replaced Figure 21 Updated WRPx commands in section Section 4 1 5 Optio
42. ode The Low power mode will be disabled when the user disconnects from the target For JTAG mode HotPlug has been available since ST LINK firmware Version V2J15Sx The ST LINK firmware Version for using in case of multi probes selection should be e V1J13S0 or greater for ST LINK e V2J21S4 or greater for ST LINK V2 e V2J21M5 or greater for ST LINK V2 1 DoclD16987 Rev 20 11 47 STM32 ST LINK utility user interface UM0892 2 2 5 2 2 6 12 47 When an ST LINK V2 or ST LINK V2 1 probe is used with another application the serial number will not be displayed and the probe cannot be used in the current instance of ST LINK utility ST LINK menu Figure 7 ST LINK menu External Loader Help Firmware update Printf via SWO viewer Displays the version of ST LINK and ST LINK V2 firmware and updates it to the last version Firmware update ST LINK V1J13S0 ST LINK V2 V2J21S4 ST Link V2 1 V2J21M5 Displays printf data sent from target via SWO see via viewer Section 3 10 Printf via SWO viewer for more details External Loader menu Figure 8 External Loader menu External Loader Help Add External Loader The STM32 ST LINK utility includes the Add External Loader submenu which allows to select the external loaders to be used by the ST LINK utility to read program or erase external memories The external loaders must be added in the ExternalLoader directory located under the
43. ommand sets the Read Protection Level to Level 0 no protection sets the IWDG SW option to 1 watchdog enabled by software sets the nRST STOP option to 0 reset generated when entering Standby mode sets the DataO option byte sets the Data1 option byte Syntax OB RDP lt Level gt BOR_LEV lt Level gt IWDG_SW lt Value gt nRST_STOP lt Value gt nRST_STDBY lt Value gt nBFB2 lt Value gt nBoot1 lt Value gt nSRAM_Parity lt Value gt Data0 lt Value gt SPRMOD lt Value gt Datal lt Value gt WRP lt Value gt WRP2 lt Value gt WRP3 lt Value gt WRP4 lt Value gt BOOT ADD0 2 Value BOOT ADD1 Value Example OB RDP 0 IWDG SW 1 nRST STOP 0 Data0 0xAA Datal 0xBC Option byte command parameter descriptions RDP lt Level gt RDP lt Level gt sets the Flash memory read protection level The lt Level gt could be one of the following levels 0 Protection disabled 1 Protection enabled 2 Protection enabled debug and boot in SRAM features are DISABLED Note Level 2 is available on STM32F0 STM32F2 STM32F3 STM32F4 and STM32L1 Series d only DoclD16987 Rev 20 37 47 STM32 ST LINK utility command line interface CLI UM0892 BOR_LEV lt Level gt BOR_LEV sets the Brownout Reset threshold level For STM32L4 Series 0 Reset level threshold is around 1 7 V 1 Reset level threshold is around 2 0 V 2 Reset level threshold is around 2 2 V 3 Reset level
44. only with ST LINK V2 The RESET pin of the JTAG connector pin 15 should be connected to the device reset pin Run Description Sets the program counter and Stack pointer as defined at user application and performs a run operation This is useful if the user application is loaded with an offset e g 0 08003000 If the address is not specified 0x08000000 is used Syntax Run lt Address gt Example run 0x08003000 Halt Description Halts the core Syntax Halt Step Description Executes Step core instruction Syntax Step SetBP Description Sets the software or hardware breakpoint at a specific address If an address is not specified 0x08000000 is used Syntax SetBP Address Example SetBP 0x08003000 CIrBP Description Clears all hardware breakpoints if any Syntax ClrBP CoreReg Description Reads the Core registers Syntax CoreReg 5 Description Detects the Core status Syntax SCore d DoclD16987 Rev 20 UM0892 STM32 ST LINK utility command line interface CLI 4 1 3 Note Note d Flash commands Description Executes a Full chip erase operation Syntax ME SE Description Erases Flash sector s Syntax SE Start Sector lt End_Sector gt Example SE 0 Erase sector 0 SE 2 12 gt Erase sectors from 2 to 12 For STM32L Series the following cmd erases data eeprom SE ed
45. ons Automatic mode functions Device information The Device information zone displays information as shown in Figure 13 Figure 13 Device information zone in the main user interface Device STM32F40xx F41xx Device ID 0x413 Revision ID Rev Z Flash size 1MBytes Family of the connected STM32 device Each device type includes many Device devices with different characteristics such as the Flash memory size the RAM size and peripherals Device ID MCU device ID code located in the external PPB memory map Revision ID The revision ID of the connected MCU device Flash size Size of the on chip Flash memory Settings The Settings panel dialog box shown in Figure 14 displays useful information on the connected ST LINK probes and STM32 target and allows to configure the connection settings d DoclD16987 Rev 20 UM0892 STM32 ST LINK utility features d Figure 14 Settings dialog box Settings ST LINK Serial Number 43FF70054385555523352587 Refresh STM32 Target Information Target Target Voltage Connection settings Port Mode JTAG SwD Firmware Version 2 2354 STM32L43x Frequency l Connect Under Reset v 1 8 MHz M Reset Mode C Enable debug in Low power mode Hardware Reset Log File Generate Trace LOG File Cancel Open Containing Folder The user can choose one of the conn
46. operation even if some pages are selected A Apply button erases all the selected pages DoclD16987 Rev 20 19 47 STM32 ST LINK utility features UM0892 Note 20 47 Figure 16 Flash memory mapping dialog box Flash Memory Mapping Page Sector 0 Sector 1 Sector 2 Sector 3 Sector 4 Sector 5 Sector 6 Sector 7 Sector 8 Sector 8 Start address 008000000 008004000 008008000 Ox0800C000 008010000 008020000 008040000 008060000 008080000 ALNANANNNN Size 16K 16K 16K 16K 128K 128K 128K 128K 128 4 Select all Unselect all Apply To erase the Flash data memory sector of the ultra low power STM32L1 devices select the data memory box at the end of the list and click Apply DoclD16987 Rev 20 d UM0892 STM32 ST LINK utility features 3 5 d Device programming The STM32 ST LINK utility can download binary Hex or srec files into Flash or RAM To do this follow these steps 1 Click on Target Program or Target Program amp Verify if the user wants to verify the written data to open the Open file dialog box as shown in Figure 17 If a binary file is already opened go to step 3 Figure 17 Open file dialog box Open ss QU Computer OSDisk C hexfiles v 4 Search hex files p Organize Ne
47. otected If the user deselects Flash programming action while some or all STM32 Flash memory are write protected they will be automatically unprotected and restored after programming operation The connection to the device should be established to be able to select the option bytes configuration using the configure button The connected devices should be derivatives of the same STM32 family and will be all connected in the same mode JTAG or SWD The automatic mode cannot be used if more than one ST LINK probe is connected to the computer A dialog will be displayed to prevent the user and asks him to keep only one ST LINK probe connected to continue using this mode If the option byte configuration is checked the configuration of the option bytes using the Configure button is mandatory before starting the automatic mode When the option bytes is configured for the first time for a specific device ID the initial values will be loaded from the connected device If the connected device has a different device ID from the device connected while configuring option bytes the option bytes have to be reconfigured using the Configure button before starting the automatic mode Developing customized loaders for external memory The users can develop their own custom loaders for a given external memory using examples available under the ExternalLoader directory These examples are available for three toolchains i e
48. pens a binary Intel Hex or Motorola S record Saves the content of the memory panel into a binary Intel Hex or Motorola S Save file as record Close File Closes the loaded file Compares two binary hex or srec files The difference is colored in red in the file Compare two files panel If a file contains a section with an address range that is unavailable in the other file this section will be colored in violet Exit Closes the STM32 ST LINK utility program d 8 47 DoclD16987 Rev 20 UM0892 STM32 ST LINK utility user interface 2 2 2 Edit menu Figure 4 Edit menu View Target ST LINK Cut Ctrl X Copy Ctrl C Paste Ctrl V Delete Del Find Data Ctrl F Fill Memory Ctrl M Cut Cuts the selected cells on file or memory grid Copy Copies selected cells on file or memory grid Paste Pastes the copied cells in the selected position in file or memory grid Delete Deletes the selected cells on file or memory grid Find Data Finds data in binary or Hex format in file or memory grid Fill Memory Fills file or memory grid with the chosen data starting from the chosen address 2 2 3 View menu Figure 5 View menu Target ST LINK Exten Binary File Device Memory External Memory Binary file Displays the content of the loaded binary file Device memory Displays the content of the device memory External memory Displays the content of the external memory d DoclD16987 Rev 20 9 47 STM32 ST LI
49. read or write protection DoclD16987 Rev 20 25 47 STM32 ST LINK utility features UM0892 26 47 Figure 19 Option bytes dialog box P Option Bytes Read Out Protection User configuration option byte Level 0 X IwDG Sw v IwDaG STOP WWDG Sw nSRAM Parity SRAM2 RST SRAM2 PE nRST SHDWw nRST STOP BOR Level Level 0 IWDG STDBY IWwDG_ULP FZ IWDG STOP FZ IwDG STDBY PCROP RDP nBoot Sw Cfg BOOTO nS Config VDDA Monitor nBootO nBOOTO nBootl BOOT1 nDBOOT nBOOT_SEL BFB2 DUALBANK nRST STDBY SDADC12 VDD Monitor Boot address option bytes BOOT ADDO BOOT_ADD1 User data storage option bytes Data 0 H Flash sectors protection Flash protection mode nDBANK DB1M Boot from H Boot from H Data 1 Write protection Page Start address Page 0 0 08000000 4 1 008000800 2 0 08001000 3 008001 800 Page 4 008002000 5 008002800 0068003000 Page 7 0 08003800 008004000 A mm amm Size Protection 2K No Protection 2K Write Protection 2K No Protection 2K No Protection 2K No Protection 2K No Protection 2K No Protection 2K No Protection 2K No Protection m DoclD16987 Rev 20 d UM0892 STM32 ST LINK
50. s Install_Directory STM32 ST LINK utility ST LINK utility S T LINK_CLI exe Connection and memory manipulation commands C Description Selects JTAG or SWD communication protocol By default JTAG protocol is used Syntax c ID lt id gt SN lt sn gt JTAG SWD UR HOTPLUG LPM ID lt id gt ID of ST LINKIO 9 to use when multiple probes are connected to the host SN lt sn gt Serial Number of the chosen ST LINK probe UR Connect to target under reset HOTPLUG Connect to target without halt or reset LPM Activate debug in Low power mode Example1 c ID 1 SWD UR LPM Example2 c SN 55FF6C064882485358622187 SWD UR LPM When ID lt id gt and SN lt sn gt are not specified the first ST LINK with ID 0 will be selected Selection of ST LINK by ID or SN should be used with e V1J13S0 or greater ST LINK firmware version e V2J2184 or greater ST LINK V2 firmware version e V2J21M5 or greater ST LINK V2 1 firmware version UR available only with ST LINK V2 and in SWD mode LPM mode will be disabled when the user disconnects from the target For JTAG mode connect under reset has been available since ST LINK firmware Version V2J15Sx The RESET pin of the JTAG connector pin 15 should be connected to the device reset pin HOTPLUG available in SWD mode For JTAG mode HotPlug Connect has been available since ST LINK firmware Version V2J15Sx DoclD16987
51. w folder gt Name Date modified Type 9 Libraries L STM32F407 hex 05 01 2015 10 26 HEX File Documents 2 Music i Pictures Subversion B Videos JW Computer OSDisk Network gt e File name STM32F407 hex v Supported Files bin hex sr 2 Select a binary Intel Hex or Motorola S record file and click on the Open button 3 Specify the address from which to start programming as shown in Figure 18 it may be a Flash or RAM address DoclD16987 Rev 20 21 47 STM32 ST LINK utility features UM0892 Note 1 Note 2 22 47 Figure 18 Device programming dialog box programming Download STM32F429 hex Start address File path C Shex files STM32F 429 hex Verification Verify while programming Verify after programming Flash memory programming Cancel V Reset after programming 4 Choose a verification method by selecting one of the two radio buttons a Verify while programming fast on chip verification method which compares the program buffer content portion of file with the Flash memory content b Verify after programming slow but reliable verification method which reads all the programmed memory zone after the program operation ends and compares it with the file content 5 At last click on the Start button to start programming a If Target Program amp Verify is selected in the first step a check is

Download Pdf Manuals

image

Related Search

Related Contents

User`s Manual - UniPower LLC  Zalman ZM80c-HP Heatpipe VGA Cooler    Manual usuario  User Manual - Mobility Elevator & Lift Co.  Kenmore 415.161108 Gas Grill User Manual  Programme loisir et culture - printemps 2014 - Ville de Saint  

Copyright © All rights reserved.
Failed to retrieve file