xref: /aosp_15_r20/external/flashrom/doc/user_docs/in_system.rst (revision 0d6140be3aa665ecc836e8907834fcd3e3b018fc)
1=====================
2In-System Programming
3=====================
4
5**In-System Programming** (ISP) sometimes also called **in situ programming** is used to describe
6the procedure of writing a flash chip while it is (already/still) attached to the circuit
7it is to be used with. Of course any normal "BIOS flash" procedure is a kind of ISP
8but when we refer to ISP we usually mean something different: programming a flash chip by external means
9while it is mounted on a motherboard.
10
11This is usually done with SPI chips only. Some mainboards have a special header for this
12(often named "ISP", "ISP1", or "SPI") and there should be no problem with accessing the chip
13then as long as the wires are not too long.
14
15If there is no special header then using a special SO(IC) clip is an easy and reliable way
16to attach an external programmer. They are produced by different vendors (e.g. Pomona, 3M)
17and are available from many distributors (e.g. Distrelec) for 20-50$/€.
18
19Problems
20========
21
22* Check the other potential problems (:doc:`misc_notes`) with other types of programming setups first.
23* The SPI bus is not isolated enough. Often parts of the chipset are powered on partially
24  (by the voltage supplied via the Vcc pin of the flash chip). In that case
25  disconnect Vcc from the programmer and power it with its normal PSU and:
26
27  * Try powering up the board normally and holding it in reset (e.g. use a jumper instead of the reset push button).
28  * Some chipsets (e.g. Intel ICHs/PCHs) have edge triggered resets. In this case holding them in reset will not work.
29    This is especially a problem with Intel chipsets because they contain an EC (named ME by Intel, see :doc:`management_engine`),
30    which uses the flash (r/w!). In this case you can trigger the reset line in short intervals.
31    For example by connecting it to the chip select (CS) line of the SPI bus or a dedicated clock signal from the programmer.
32    This should not be too fast though! Reset lines usually require pulses with a minimum duration.
33  * On some boards, you can try disconnecting the ATX12V header (yellow/black wires only) from the motherboard,
34    or even remove the CPU or RAM - if the programmer supports SPI sniffing, you may be able to verify that the there is no SPI traffic.
35
36Images
37========
38
39Pomona 8-pin SOIC clip with attached jumper wires.
40
41.. image:: Pomona_5250_soic8.jpg
42
43A cheap, but very fragile alternative: DIP socket as clip
44
45.. image:: 1200px-DIP_socket_as_SOIC_clip.jpg
46