Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP

Those who play with microcontrollers must have heard of IAP, ICP, and ISP. Today, I will help everyone “consolidate” the relevant knowledge.

ICP (In Circuit Programming)

ISP (In System Programming)

IAP (In Application Programming)

1. ICP (In Circuit Programming)

Those who have used Nuvoton microcontrollers must know that Nuvoton provides a set of programming tools, namely the NuMicro_ICP_Programming_Tool, similar to the J-Flash tool configured for ST chips.

Using the corresponding manufacturer’s software and emulator, programs can be programmed, with the mainstream being JTAG (Joint Test Action Group) and SWD (Serial Wire Debug) interfaces. ICP programming is conducted via the SWD interface.

The following image shows the difference between the JTAG interface and the SWD interface:

Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP

To execute the ICP function, only three pins are needed: RESET, ICPDA, and ICPCK. RESET is used to enter or exit ICP mode, ICPDA is the data input/output pin, and ICPCK is the programming clock input pin. Users need to reserve VDD, GND, and these three pins on the system board.
Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP
Nuvoton officially provides a detailed description that ICP refers to “In Circuit Programming”. The software running on the PC, “NuMicro ICP Programming Tool”, updates the internal APROM, LDROM, DataFlash, and target user configuration word (Config) of the chip through the SWD port.
Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP
2. ISP (In System Programming)
ISP refers to “In System Programming”, where the target chip uses the LDROM boot code through USB/UART/SPI/I²C/RS-485/CAN peripheral interfaces to update the internal APROM, DataFlash, and user configuration word (Config).
Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP
3. IAP (In Application Programming)
IAP is a method of online erasing and programming achieved through software. The IAP technology structurally maps the Flash memory into two storage areas, allowing the user program running on one storage area to reprogram the other storage area, after which the program can switch from one storage area to another.
Below, we will detail these three programming methods using the programming tools and specific cases used during the programming process:
(1) ICP uses the SWD interface for programming. Common programming tools include J-Link, ST-Link, and Nu-Link; corresponding programming software includes J-Flash, NuMicro_ICP_Programming_Tool, and ST-Link Utility.
Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP
(2) ISP is programmed using a bootloader through interfaces like USB/UART, which first requires a BootLoad program. The most common programming method is the STC-ISP programming tool used when learning 8051 microcontrollers.
Detailed Explanation of Three Programming Methods: ICP, IAP, and ISP
(3) IAP achieves online erasing and programming through software without using any tools, simply updating the data in Flash through software.
For example, we can remotely update the program via a 4G module. The Flash is divided into two areas: the first area is for the Bootload program, and the second area stores the application program (APP). The 4G module communicates with the target board, and the communication includes whether an update is needed. If the main board receives the update signal, it writes a flag to Flash, such as ‘P’. Then, the program jumps to the Bootload program to execute, first checking for the update flag ‘P’ in Flash. If found, it updates the application program according to the specified protocol, clears the update flag in Flash, and jumps to execute the application program. If no update flag ‘P’ is found, it jumps directly to execute the application program.
4. Conclusion
ICP: Uses the SWD interface for programming, such as with the J-Link programmer and J-Flash software.
ISP: Uses a bootloader (Bootload) along with peripheral UART/USB interfaces for programming.
IAP: Achieves online erasing and programming through software itself, without using any tools. The program is typically divided into two parts: the bootloader and the application program.
Finally, I have a question for everyone: when using IAP programming, can the bootloader and application program be combined into a single code area application program, and still allow for software updates? How would that work? Please think about it; the answer is feasible.
Source: typedef
Note:

Due to recent changes in the WeChat public platform’s push rules, many readers have reported not seeing updated articles in time. According to the latest rules, it is recommended to click on “Recommended Reading, Share, Collect”, etc., to become a regular reader.

Recommended Reading:

  • Did Musk Build Rockets with Tsinghua’s Top Students?

  • Why Do Domestic Chips Also Use English for ‘Datasheet’?

  • The Boss Couldn’t Bear to Scrap the Server Motherboard, Forcing Me to Provide an X-ray Report

Leave a Comment