Home

STM32F101xx, STM32F102xx and STM32F103xx Flash

image

Contents

1. 0 0 cee 6 Figure 3 Connection settings 8 Figure 4 Flash status page sese sls REGERE UR RR bad Pe ewe ahead URL RA eee 9 Figure 5 Device information 10 Figure 6 Operation 12 Figure 7 13 Figure 8 Operation progress page 14 ky 3 19 Getting started UM0462 1 2 4 19 Getting started Package contents The following items are supplied in the Flash loader demonstrator package Software contents 1 STBLLIB dll a dynamic link library implementing the system memory bootloader protocol and the COM communication APIs 2 Files dl a dynamic link library implementing the needed file manipulation APIs to load and store binary hexadecimal and motorola S19 files 3 STMicroelectronics Flash loader exe a wizard application that provides the high level operations that can be performed by the user 4 STMFlashLoader exe a command line version of the STMicroelectronics Flash loader exe that provides the same features over several options 5 The Map directory is located in the installation directory It contains the mapping description files of the supported devices
2. UM0462 J User manual STM32F101xx STM32F102xx and STM32F108xx Flash loader demonstrator Introduction The purpose of this document is to describe the STMicroelectronics STM32F101xx STM32F102xx and STM32F103xx Flash loader demonstrator application that was developed to illustrate the System memory bootloader capabilities This document details the prerequested hardware and software environments as well as the use cases of the demonstrator software October 2008 Rev 4 1 19 www st com Contents UM0462 Contents 1 Getting started est nt ani cnn Dh i a made ar an Qe aa 4 1 1 Package contents 4 1 1 1 Software contents 4 1 1 2 Hardware contents 4 1 2 System requirements 4 1 3 Flash loader demonstrator installation 6 1 3 1 Software installation 0 0 0 0 eee eee eee 6 1 3 2 Hardware installation 6 2 User interface description 7 3 Command line usage 15 4 REVISION history 18 2o ky UM0462 List of figures List of figures Figure 1 System Properties dialog 5 Figure 2 Device Manager window
3. gt Flash loader demonstrator v1 2 STMicroelectronics r Read protection option byte 5 Read out protection enabled User option byte USER M FF V STDBY V nAST_STOP wDG Sw 7 Bytes for user data storage hi h FF Flash memory write protection option bytes Name Start address Size 0 048000000 0x40 1K S Pace 8000400 0x40 1K WRPO h FA Page2 Ox 8000800 0x400 1K Page 0 8000 00 05400 1K h FF OA Paoe4 048001000 0x400 1K WAP2 h FF Pages 0 8001400 0x400 1K wRP3 h COA Page 048001800 0x400 1K OS Page 8001 00 0x400 1K A 09002000 o 400 K 9 Page3 Ox8002400 Ox400 1K Load from device Apply to device Save to file Finish b Case of any other operation The operation page is shown It gives the size of the data to be downloaded or uploaded the percent completed and the duration of the operation as illustrated in Figure 8 If the operation is successful the progress bar is green colored If an error occurs the bar turns red and the error is displayed To stop the operation click the Cancel button If the Jump to the user program check box was checked in the previous step Step 4 and the us
4. 6 Src directory is located in the installation directory It contains the header and Lib files of the two DLLs and the complete source of the command line version 7 The directory is located in the installation directory it contains the UM0462 and UM0516 Windows for STMicroelectronics microcontroller bootloaders user manuals Hardware contents The Flash loader demonstrator is designed to work with all STMicroelectronics devices that support the system memory boot mode protocols For more details please visit the STMicroelectronics website http www st com and refer to the application note AN2606 STM32F101xx and STM32F103xx system memory boot mode System requirements In order to use the Flash loader demonstrator with the Windows operating system a recent version of Windows such as Windows 98 Millennium 2000 XP or Vista must be installed on the PC The version of the Windows OS installed on your computer may be determined by right clicking on the My Computer icon on the desktop then clicking on the Properties item in the displayed pop up menu The OS type is displayed in the System Properties dialog box under the System label as shown in Figure 1 UM0462 Getting started Figure 1 System Properties dialog box System Properties System Restore Automatic Updates Remote General Computer Name Hardware Advanced System Microsoft Windows Profes
5. a binary file the download address is the start address of the first page and the field is still editable to accept changes If the loaded file is a hexadecimal or an S19 motorola file the download address is the start address of the first record in the file and the field is read only Check the Verify check box to launch the verification process when the Download operation is finished Check Jump to the user program to launch the downloaded program Check Optimize to filter FFs packets 256 bytes Check Apply option bytes then browse the option byte file created by the Edit option bytes operation The values in the selected file will be applied to the device after download 3 Upload A Click the related browse button to select which binary hexadecimal S19 motorola file will store the uploaded data 4 Disable Enable Flash protection Select the choices from the two drop down menus to make up the desired command Enable Read protection Disable Read protection Enable Write protection Disable Write protection All protection commands will be applied to all the Flash memory pages except for the Enable Write Protection which can be customized This is done by clicking the button to select the pages to be write protected 5 Edit option bytes f you need to set the option bytes check the option then click Next to move to the option byte edition page Step 5 Figur
6. TARY 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 2008 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 Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 19 19 4
7. cription UM0462 8 19 Figure 3 Connection settings page Flash loader demonstrator v1 2 STMicroelectronics Select the communication port and set settings then click next to open connection UART Port Name v Parity Even X Baud Rate 57600 v Stop Bits 1 Data Bits 8 Y Timeout s 5 X Back Finish UM0462 User interface description Note Step 2 In the second step the connection has been established and communication has started It consists in displaying the Flash memory status This status can be read protected in which case the Next button is disabled until the read protection is removed by clicking on the Remove protection button Clicking on the Remove protection button will not only read unprotect the Flash memory it will also erase all its pages Figure 4 Flash status page Flash loader demonstrator v1 2 STMicroelectronics s Target is readable Please click Next to proceed Flash Size 9 19 User interface description UM0462 10 19 Step 3 In this step the Wizard displays the available device information such as the target ID the firmware version the supported device the memory map and the memory protection status Select the target name in the target combobox as shown in Figure 5 then click on Next to co
8. d video and game controllers Se Storage volumes System devices Universal Serial Bus controllers It is interesting to know the capabilities of the COM port To find out right click on the Communication Port COMXx item then click on Properties to display the Properties window Select the Port Settings tab then click on the arrow next to the Bits per second combo box to know the baud rates supported by the port Flash loader demonstrator installation Software installation If an older version is installed on you computer remove it by using the Add or Remove Programs service in the Control Panel Run the Flash Loader Demonstrator V1 2 Setup exe file the InstallShield Wizard will guide you through the installation of the Flash loader demonstrator application on your computer Once the software has been successfully installed click on the Finish button Hardware installation Connect the device to a spare COM port on your PC UM0462 User interface description 2 Note User interface description The Flash loader demonstrator is designed as a wizard application It is structured into six steps the Connection settings page Flash status page Device information page Operation choice page Option byte edition page Operation progress page oak Step 1 Run the Flash loader demonstrator application from the Programs menu connection to the device has not been
9. downloaded and the download address use the d option in the form d a address hex fn file_name full path name bin hex or s19 file the file type is recognized by its extension The address is mandatory in the case of binary files and ignored in the case of hex and s19 files To verify the downloaded data add the v argument To optimize and remove FF packets use the o argument O Gets or sets option bytes Use get to read option bytes from the device and store values to a file get fn file name full path name Use set to write option bytes to the device The option bytes can be read from a file or given as values set fn file name full path name set vals OPB hex value OPB in User RDP DataO Data1 WRP1 WRP2 WRP3 The o option can accept multiple arguments as shown below 0 get get file name set set file name o get get file name set vals User 01 RDP 5A DataO DE Data1 EA Warning When setting option bytes if RDP is not equal to A5h the read protection is activated and all subsequent operations will fail UM0462 Command line usage Activates or deactivates the protection It is used as shown below p erp Activate read protection p drp Deactivate read protection p ewp number_of_pages_group pages_group_codes activates the write protection on the given page group codes p dwp disables the write protection Warning The e
10. e 7 Warning Erase and Download operations can be performed only if the write protection is disabled 1119 User interface description UM0462 12 19 Figure 6 Operation choice page Flash loader demonstrator v1 2 STMicroelectronics Erase Selection Download to device Download from file CASTM32F1 Ox_Demo bin Erase necessary pages Erase pages faster hi 8000000 Jump to the user program Optimize Remove some FFs Verify after download Apply option bytes m Upload from device Upload to file CASTM32F1 Ox_Demo up bin E Enable Disable Flash protection READ PROTECTION M Edit option bytes Next Finish Step 5 The last Wizard page depends on the operation selected in Step 4 a Case of an Edit option bytes operation The Option byte edition page is displayed It contains the current option byte values loaded from the device RDP USER DataO Data1 WRPO WRP1 WRP2 For more details please refer to the Option byte loader section in the STM32F10xxx Flash programming manual PM0042 available from www st com This step gives the possibility of applying the edited option byte values loading them from the device and saving them to a file UM0462 User interface description Figure 7 Option byte edition page
11. ents to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILI
12. er program was successfully downloaded communication with the system memory boot loader is lost Consequently the Back button is redirected to the Connection settings page Step 1 to avoid the launch of a new operation If the Jump to the user program check box was not checked in Step 4 the Back button is still active and you can return to Step 4 and select a new operation 13 19 User interface description UM0462 14 19 Figure 8 Operation progress page Flash loader demonstrator v1 2 STMicroelectronics Target STM32F1 OxxBxx Map file STM32F10xxBxx STmap Operation DOWNLOAD File name C STM32F10x_Demo bin File size 34 77 KB 35608 bytes Status 16 34 KB 15732 bytes of 34 77 KB 35508 bytes Time 00 00 04 download Finish UM0462 Command line usage 3 Command line usage The command line version STMFlashLoader exe provides the same functionality as the GUI It supports several options in order to run a sequence of operations The following paragraphs describe the available command line options STMFlashLoader exe option Arguments option Arguments Shows help C Defines the COM port The c option allows you to select the COM port that the command uses to communicate with the target MCU By default the command uses COM1 To select different COM port and connection settings use the c op
13. made yet then make sure that the device is connected to your PC and reset it to restart the system memory bootloader code This step consists in selecting the connection settings Select the desired UART settings port name baud rate and timeout as shown in Figure 3 For an optimum configuration set Baud Rate to 57600 bits per second and the Timeout s to 5 seconds Ensure that the boot configuration pins are set correctly then click Next to continue If a connection has been established the wizard moves to the next step otherwise a message box is displayed that indicates the error that occurred Possible errors messages Cannot open the COM port this message is shown if the selected COM port is not found or if it is already being used by another process e Unrecognized device this message is shown if the received value is different from 79h Resetting the device may solve the problem e No response from the target this message is shown when there is no response from the target It indicates that the System memory boot loader is not functional Verify the boot configuration and check that the used microcontroller contains the boot loader code The Timeout argument is the period of time after which a read request from the serial port is aborted if no data is received The recommended value is 5 seconds but it depends on the used environment like the hardware performance 7 19 User interface des
14. ntinue Figure 5 Device information page Flash loader demonstrator v1 2 STMicroelectronics Please select the target in the targets list box Target STM32F1 OxxB xx PID h 06410041 Version 20 Flash mapping Start address End address Size Ox 8000000 80003FF 0x400 1K Ox 8000400 B0007FF 0x400 1K Ox 8000800 Ox 8000BFF 0x400 1K Ox 8000 00 B000FFF 0x400 1K Ox 8001000 Ox 80013FF 0x400 1K Ox 8001400 Ox 80017FF 0x400 1K Ox 8001800 Ox S001BFF 0x400 1K Ox 8001 00 Ox8001FFF 0x400 1K Ox 8002000 80023FF 0x400 1K 0x 8002400 0 80027FF 0x400 1K 0 8002800 Ox 8002BFF 0x400 1K 8002 00 S002FFF 0x400 1K f onnonnn onn29cc MAN mv Legend Protected UnProtected wW 2000005000000 2005505500556 3 Finish 4 UM0462 User interface description Step 4 At this step select the requested operation Erase Download Upload or Disable Enable Flash protection or Edit option bytes and set the related parameters 1 Erase a Choose All to erase the whole memory b Choose Selection to customize the Erase operation Click the button to display the memory mapping dialog window Then check the pages to be erased and click OK 2 Download the related browse button to open a binary hexadecimal or S19 Motorola file If the loaded file is
15. rp argument activates the read protection All subsequent operations will fail To avoid this kind of problem use p erp as the last argument r Performs a jump to the specified address It is used as follows r a address hex Note Note that all command line options found are executed IN ORDER Thus with a careful arrangement of the command line options you can perform a complicated sequence of operations ky 17 19 Revision history UM0462 4 18 19 Revision history Table 1 Document revision history Date Revision Changes 25 Oct 2007 1 Initial release 05 Jun 2008 Flash loader demonstrator version upgraded to V1 1 Small text changes Section 1 1 1 Software contents updated Section 1 2 System requirements modified Welcome step removed Flash status page and Option byte edition page added Section 3 Command line usage added Step 2 on page 9 added Step 5 on page 12 modified 17 Jun 2008 Software revision updated in Section 1 3 1 Software installation on page 6 31 Oct 2008 Flash loader demonstrator version upgraded to V1 2 It can also be used with STM32F102xx devices Figure to Figure 8 updated accordingly UM0462 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 improvem
16. sional Version 2002 Service Pack 2 Registered to STMicroelectronics STMicroelectronics 75487 540 4245104 23500 Manufactured and supported by Excelence Center HP dc 500 Corporate Master Intel R Pentium R 4 CPU 3 20GHz 2 33 GHz 504 MB of RAM Physical Address Extension Support Information For the communication you need to verify that you have an available COM port RS232 as one COM port is required for system connection To check that you have an available communication port right click on the My Computer icon on the desktop and select Properties from the pop up menu The System Properties dialog box appears Click on the Hardware tab and then on the Device manager button to display the system hardware configuration Available COM ports are grouped under the Ports COM amp LPT node in the hardware tree as shown in Figure 2 ky 5 19 Getting started UM0462 1 3 1 3 1 1 3 2 6 19 Figure 2 Device Manager window Device Manager File Action Help E amp mp m 4 Computer amp Disk drives E Display adapters DVD CD ROM drives Floppy disk controllers ig Human Interface Devices Sy IDE ATA ATAPI controllers Se Keyboards Mice and other pointing devices 90 Monitors E Network adapters Y Ports COM amp LPT E Communications Port COM1 ECP Printer Port LPT1 888 Processors 9 Soun
17. tion in the form c pn port number e g 1 2 default 1 br baud reate e g 115200 57600 default 57600 db data bits value in 5 6 7 8 default 8 pr parity value in NONE ODD EVEN default EVEN c sb stop bits value in 1 1 5 2 default 1 totime out ms e g 1000 2000 3000 default 5000 The c option supports multiple arguments This means that you can set more than one argument in the same command c pn 1 br 115200 to 7000 i device name Defines the MCU target to be used For example STM32F10xxBxx STM32F10xx8xx STM32F10xx6xx The device name is the name of the map file located in the Map directory e Erase command According to the given arguments the command can be used to erase a specific page of memory or to erase the entire Flash memory This operation can take a second or more to complete depending on the memory size involved e all erase all pages e sec number of pages group pages group codes e sec 3 0 1 2 erases groups of pages coded 0 1 and 2 15 19 Command line usage UM0462 16 19 u Uploads the Flash memory contents to the specified file bin hex or s19 file the file type is recognized by its extension to specify a file use the u option in the form u fn file_name full path name d Downloads the contents of the specified file into the MCU Flash memory at the specified address To specify the file to be

Download Pdf Manuals

image

Related Search

Related Contents

5 - American Standard    Whirlpool RH2336XJ User's Manual  Precauciones de seguridad: Observe en todo momento  CUMBRE MATE MIX  1º ano - Colégio Aplicação  

Copyright © All rights reserved.
Failed to retrieve file