I recently got a piece of APM32F103VC MINI development board and found that it has a very rich peripheral resources, the main frequency can reach 96Mhz after a period of study. Recently, the IAP (In Application Programming) function has been used in the project, so we evaluate the IAP implementation of APM32F103.
In-Application Programming (IAP) is a programming mode applied to Flash program memory. It can read/write to another program Flash space by calling a specific IAP program under the normal operation of the application, and can even control the read/write operation of a segment, a page or even a byte, which brings greater flexibility to the field upgrade of data storage and firmware.
After learning how to program the target Flash, we have basically completed the knowledge reserve of IAP and can complete the IAP function at any time. For example, Flash programming will pour water into a pond, but now there is a problem, where does the water we pour into the pond come from? Namely, our program data from there to us.
Then we will discuss the source of our program and some ways of processing in this chapter.
1 Source of “water”Our firmware can be stored in the cloud or on our PC. This mainly depends on our application scenarios. If our products are mainly in the hands of customers, in order to consider the convenience of customers, it is a way to save the firmware in the cloud and then push it to our products for upgrade at a suitable time. If taking into account the stability of the product, then we can ask the customer must be in a specific scenario firmware upgrade, such as the need to access the upgraded host device (such as PC) in order to perform firmware upgrade.
2 “Paths” carrying “water”Since we determine the source of our program, we generally choose to use that way to transmit our firmware data. It 's like transporting water to our pond, by air or by sea. Such as remote upgrade can choose Ethernet, WIFI, Bluetooth, etc. If using wired transmission, we can choose USART, I2C, SPI, USB, etc.
The choice of upgrade mode is also limited by our main control MCU. For example, APM32F103VCT6 has no WIFI, Bluetooth and other functions, so we can choose USART, I2C, SPI, USB, etc.If we choose APM32F407/107, we can also choose to use Ethernet.
Just like transporting water to our pond, we can still choose to use car transportation or truck transportation after we choose to use land transportation. Different modes of transport will have different requirements, this is our choice of transporting firmware “protocol”.
For example, if we choose to use USART for firmware upgrades, we can also choose to use the Xmodem protocol, Ymodem, or our own protocol.
This protocol is to ensure that our firmware data transmission are accurate. How to say ? Such as with a check code, loopback repeated transmission and other functions.
4 SummarySaid so much, summary is that we in the process of IAP upgrade, the use of communication interfaces and communication protocols we need to pay attention to. Generally speaking, the communication interface limits our application scenarios, and communication protocol is a guarantee that that we have accurate firmware data in the process of IAP upgrade.
Comments
Please log in or sign up to comment.