An IAP program of stm32, which can be used for testing

Source: Internet
Author: User

Note that keil5.11a is used.


An IAP program written in accordance with the Development Guide. Successfully run an app on the mini board. Because Rb is a 100 k flash, the Rom is split into 27 k 1 K. 27 k is used to store IAP. 1 K is used to store some information, which is not currently in use. K is used by the app.
The general process of the IAP program is as follows: after power-on, within 5 seconds (the actual test found that the error is greater than 5 seconds, no matter the error temporarily), round-robin of whether the serial port sends: updata; (update is free. Make sure that there are 6 letters in the middle ). If the timeout value is not received: update; then the program jumps to the app. If there is no app, or the app fails, the red light is always on. If you receive: update;, enter the program. In this case, the serial port is switched to the interrupt mode to receive data.

The burning form is like this. The binary file must be split for 1 K and 1 K. Opened a serial port cache, the size is 1 K + 8. The sending format is like this,

Data_len_l data_len_h data (no more than 1 k) index_l index_h CRC

The six digits index_l index_h CRC (4B) are useless for the moment. Fill 00, and data_len is the length of the data to be written, and the maximum length is no more than 1 K.

Currently, IAP is only 7 kb after compilation, and more functions can be added. It is expected to be added to stm32 CRC. The binfile of the app needs to be split by itself. You can use winhex and then use xcom V2.0 to send the file. I want to write a host computer to transmit the bin, so that you don't have to split the bin by yourself.



For more information about how to use the app, see the Development Guide.

 

No blog can upload attachments, source code can be open source electronic network download http://www.openedv.com/posts/list/38799.htm

An IAP program of stm32, which can be used for testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.