What is IAP? How to implement IAP?

Publisher:水手谷水手Latest update time:2015-04-14 Source: eechinaKeywords:IAP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
IAP is the acronym for In Application Programming. It is the process of burning a part of the User Flash area during the operation of the user's own program. The purpose is to conveniently update the firmware program in the product through the reserved communication port after the product is released.
 
Usually when users need to implement the IAP function, that is, the user program updates itself during operation, two project codes need to be written when designing the firmware program. The first project code does not perform normal functional operations, but only receives programs or data through a communication channel (such as USB, USART) to perform updates to the second part of the code; the second project code is the real functional code. Both parts of the project code are burned into the User Flash at the same time. When the chip is powered on, the first project code starts to run first, and it performs the following operations:
 
1) Check whether the second part of the code needs to be updated
2) If no update is required, go to 4)
3) Perform update operations
4) Jump to the second part of the code execution
 
The first part of the code must be burned in through other means, such as JTAG or ISP; the second part of the code can be burned in using the IAP function of the first part of the code, or it can be burned in together with the first part of the code. If the program needs to be updated later, it can be updated through the first part of the IAP code.
 
For STM32, because its interrupt vector table is located in the lowest address area of ​​the program memory, in order to enable the first part of the code to respond to the interrupt correctly, the first part of the code is usually arranged in the beginning area of ​​the Flash, and the second part of the code follows it.
 
When the second part of the code starts to execute, it first needs to map the CPU's interrupt vector table to its own vector table, and then perform other operations.
 
If the IAP program is damaged, the product must be returned to the factory to re-program, which is very troublesome and very time-consuming and costly. In response to such a demand, STM32 automatically sets the first 4 pages of the user Flash area as write protection while implementing read protection on the Flash area, which can effectively ensure that the IAP program (the first part of the code) area will not be accidentally damaged.
 
There is an example of using USART to implement IAP on ST's website. You can refer to this example and the corresponding manual.
 
Application Note AN2557 - STM32F10xxx in-application programming using the USART
Routine: AN2557 - STM32F10xxx in-application programming using the USART
Keywords:IAP Reference address:What is IAP? How to implement IAP?

Previous article:Typedef usage and #define
Next article:Clock Gating

Recommended ReadingLatest update time:2024-11-16 16:03

Solution for remote updating of distribution transformer monitoring terminal program based on IAP function of LPC2378
This paper uses Philips' 32-bit microprocessor LPC2378 to develop a distribution transformer monitoring terminal, and uses the chip's built-in IAP function to achieve remote updating of the terminal program. In order to reduce communication traffic and terminal storage space, this paper also applies the LZW compress
[Microcontroller]
Solution for remote updating of distribution transformer monitoring terminal program based on IAP function of LPC2378
The difference between ISP and IAP
ISP: in system programming IAP: in application programming But what are the differences in their operation methods, results and applications? Keep reading and you will understand. What is an ISP: Use a writer to burn the code in. However, the chip can be on the target board without being taken out. The interface
[Microcontroller]
The concepts and differences of MCU ISP, IAP and ICP programming methods
Anyone who plays with microcontrollers should have heard of the terms ISP, IAP and ICP. But I still don't quite understand the difference between them. Today I will explain them in detail. ISP:In System Programing IAP:In applicating Programing ICP:In Circuit Programing Differences: 1. ISP is to tear down a house and b
[Microcontroller]
How to write the bootloader and app for IAP upgrade of stm8
Because I wrote an IAP upgrade program for stm32 before, I summarized the three main difficulties of IAP upgrade: 1. How to set the interrupt vector, that is, the redirection of the interrupt vector 2. How to configure the starting address of the program 3. How to jump from IAP to APP program 4. Things to note when us
[Microcontroller]
How to write the bootloader and app for IAP upgrade of stm8
STM8L052R8T6 serial port IAP online upgrade summary (IAR compilation environment)
1. About BootLoader program settings Some areas of FLASH are shown below: As shown in the figure, by default, 0X8000-0X8080 is the interrupt vector table. If we plan to allocate 4KB of space to the BootLoader program, that is, store the BootLoader program from 0X8000-0X9000. Then the corresponding interrupt vector
[Microcontroller]
STM8L052R8T6 serial port IAP online upgrade summary (IAR compilation environment)
LPC1100 processor implements IAP function through SD card
With the development of processors, IAP upgrade is becoming more and more popular. There are many ways to upgrade IAP, such as: upgrade via serial port, GPRS remote upgrade, SD card upgrade, etc. Here is a detailed introduction on how to use SD card to upgrade the application.   The following is an introduction to t
[Microcontroller]
LPC1100 processor implements IAP function through SD card
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号