iap文档很详细的说明

所需积分/C币:50 2014-05-17 14:00:13 215KB PDF
22
收藏 收藏
举报

iap文档很详细的说明
AN2557 List of tables List of tables Table 1. STM32F10XXX IAP implementation 12 Table 2. Revision history DOc ID 13588 Rev 8 3/16 List of figures AN2557 List of figures Figure 1. Flowchart of the iaP driver Figure 2. COM port properties Figure 3. lAP Driver menu when the STM32F10x Flash memory is not protected Figure 4. lAP driver menu when the sTM32F10x Flash memory is write-protected 10 Figure 5. Flash memory usage 14 4/16 DOc ID 13588 Rev 8 AN2557 lAP overview lAP overview Low-density devices are STM32F101XX, STM32F102XX, and STM32F103XX microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes Medium-density devices are STM32F101XX, STM32F102XX, and STM32F103XX microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes High-density devices are STM32F101xx and STM32F103XX microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes High-density devices are implemented in the STMicroelectronics STM3210E-EVAL evaluation board Connectivity line devices are sTM32F105xX and sTM32F107xx microcontrollers Connectivity line devices are implemented in the stMicroelectronics sTM32100C-EVAL evaluation board oW-density value line devices are STM32F100X 4 and STM32F100X6 microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes Medium-density value line devices are STM32F100X8 and STM32F100XB microcontrollers where the flash memory density ranges between 64 and 128 Kbytes Medium-density value line devices are implemented in the stMicroelectronics STM32100B EVAL evaluation board XL-density devices are STM32F10 xx and sTM32F 103xx microcontrollers where the Flash memory density ranges between 768 Kbytes and 1 Mbyte High-density value line devices are STM32F100X C, STM32F100XD and STM32F100XE microcontrollers where the flash memory density ranges between 256 and 512 Kbytes High-density value line devices are implemented in the stMicroelectronics STM32100E- EVAL evaluation board Principle You should program the iaP driver to the Flash memory base address via the JTAG/SWD interface using the development toolchain of your choice or the factory-embedded boot loader in the System memory area The ap driver uses the usart to: Download a binary file from the Hyper Terminal to the STM32F10x's internal Flash memory. Upload the STM32F1OX's internal flash memory content(starting from the defined user application address) into a binary file Execute the user program 12 IAP driver description The lAP driver contains the following set of source files main.c, where the usart initialization is set a main menu is then executed from the common. c file common.c:contains display functions and the main menu routine. The main menu gives the options of loading a new binary file, uploading a new binary file, executing the DOc ID 13588 ReV 8 5/16 AP。 vervet AN2557 binary file already loaded and disabling the write protection of the pages where the user loads his binary file(if they are write-protected) ymodem. c and download. c: they are used to receive the data from the hyperTerminal application(using the yMODEM protocol a), and then to load them into the STM32F10X's internal RAM. In the event of a failure when receiving the data, the Failed to receive the file error message is displayed. If the data is received successfully, it is programmed into the internal Flash memory from the appropriate address. A comparison between internal RAM contents and internal Flash memory contents is performed to check the data integrity. If there is any data discrepancy, the Verification failed "error message is displayed other error messages are also displayed when the image file size is greater than the allowed memory space and when the user aborts the task upload. C: it is used to transmit the STM32F10XXX internal Flash memory content started from the user application address using the ymodem protocol STM32F10x Standard Peripherals Library To select the STMicroelectronics evaluation board STM32100B-EVAL(Medium density value line devices), STM3210C-EVAL (Connectivity line devices), STM3210E-EVAL(High density devices), sTM32100E-EVAL (High-density value line devices )or STM3210B-EVAL (Medium-density devices) used to run the lAP, uncomment the corresponding line in stm 32_eval. h file(under Utilities\STM32_EVAL) //#define USE STM3 2100B EVAL //#define USE STM3 210B EVAL //#define USE STM3 210E Eval //#define USE STM3 210C EVal //#define USE SIM32100E EVAL The user can choose to either go to the user application or execute the lAP for reprogramming purposes by pressing a push-button connected to a pin o Not pressing the push-button at reset switches to the user application Pressing the push-button at reset displays the lAP main menu Refer to Table 1. STM32F10XXX laP implementation for more details about the STM32100B-EVAL. STM3210B-EVAL STM3210E-EVAL STM3210C-EVAL and STM32100E-EVAL board push-button used to enter the lAP mode The lAP flowchart is represented in Figure 1 a. The Ymodem protocol sends data in 1024-byte blocks. An error check is performed in data blocks transmitted to the STM32F1 0XXX's internal RAM to compare the transmitted and received data Blocks unsuccessfully received are acknowledged with an NAK(Negative Acknowledgement). For more details about the Ymodem protocol, refer to existing documentation 16 DOc D 13588 Rev 8 AN2557 lAP overview Figure 1. Flowchart of the lAP driver Sta Push-button No is pr itialize the stm32F10XXX USART Display the lAP main menu Download or upload or switch or rite-protection? Download Upload Switch to Receive a binary file program Success Yes Program the Flash Transmit image Disable the Switch to of the device internal Flash write protection user program All data programmed Yes No System reset Success generation application Display the name Display the error message d size of "Error has occured rece ived file Display the error " Verification failed Display the erro message " Failed to receive the file" DOc ID 13588 ReV 8 7/16 Running the lAP driver AN2557 Running the lAP driver The lAP driver is programmed in Flash memory From page 0 to page 11 on LOw-density devices, Medium-density devices, LOw-density value line devices, and Medium-density value line devices From pageo to page 5 on High-density, Connectivity line, XL density devices and High density value line device The user application occupies the remaining memory space 2.1 Hyper Terminal configuration To use the lAP, the user must have a Pc running Hyper Terminal or other Terminal program that supports ymodem protocol as shown in Figure 2. In this document the Hyper Terminal is used. The following figure shows the Hyper Terminal configuration Figure 2. COM port properties COM1 Properties Eits per second: 115200 Data bits:8 Parity None F lettore De后au 口K C △pp Note The baud rate value of 115200 bps is used as an example Care must be taken when selecting the system clock frequency To guarantee successful communication via the USART, the system clock frequency in the end application must be such that a baud rate equal to 115200 bps can be generated 16 DOc D 13588 Rev 8 AN2557 Running the lAP driver 22 Executing the lAP driver As an example in this application note, pressing the pin connected to the push-button allows the iap driver to run By pressing the push-button at reset, the user can run the laP driver to reprogram the STM32F10X's internal Flash memory. It is not mandatory to use the push-button; the user can apply a signal to this pin with respect to its active level. Refer to Table 1: STM32F10XXX lAP implementation DOc ID 13588 ReV 8 9/16 laP driver menu AN2557 3 aP driver menu Running the lAP displays the following menu in the HyperTerminal window Figure 3. lAP Driver menu when the STM32F10x Flash memory is not protected Int Hle =dt vies Call Transfer help 〓〓〓〓〓〓〓〓〓〓 二〓〓〓〓〓=〓〓〓 ==〓〓〓 iC)COPYRTGHT ?910 STMicroelertronic. In-npplication Progranming application (Version xY./j Ey Mco Application Team 三三三三二三三二二二三二二二二二 Main me Download Image to the stmi2Fl0x Internal flash Upload image From the STM32F10x Internal flash -------2 Le the new p 3 〓〓〓==〓〓==〓〓==〓 〓〓〓 Download image to the internal Flash memory To download a binary file via Hyper Terminal to the STM32F1Ox's internal Flash memory, do as follows 1. Press 1 on the keyboard to select the Download Image To the STM32F10x Internal Flash menu 2. Select Send File in the transfer menu 3. In the Filename field, type the name and the path of the binary file you want to download 4. From the protocol list, select the ymodem protocol 5. Click on the Send button As a result, the laP driver loads the binary file into the sTM32F10x's internal Flash memory from the defined base address and displays the binary file name and size in the Hyper Terminal window 10/16 DOc D 13588 Rev 8

...展开详情
试读 16P iap文档很详细的说明
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
iap文档很详细的说明 50积分/C币 立即下载
1/16
iap文档很详细的说明第1页
iap文档很详细的说明第2页
iap文档很详细的说明第3页
iap文档很详细的说明第4页

试读结束, 可继续读1页

50积分/C币 立即下载