1.. _dump-cmd:
2
3Dump
4====
5
6The ``espefuse.py dump`` command allows:
7
8- display raw values of eFuse registers, grouped by block. Output corresponds directly to eFuse register values in the `register space <https://github.com/espressif/esp-idf/blob/master/components/soc/{IDF_TARGET_NAME}/include/soc/efuse_reg.h>`__.
9- save dump into files.
10
11Optional arguments:
12
13- ``--format`` - Selects the dump format:
14    - ``default`` - Usual console eFuse dump;
15    - ``joint`` - All eFuse blocks are stored in one file;
16    - ``split`` - Each eFuse block is placed in its own file. The tool will create multiple files based on the given the ``--file_name`` argument. Example: "--file_name /path/blk.bin", blk0.bin, blk1.bin ... blkN.bin. Use the ``burn_block_data`` cmd to write it back to another chip.
17- ``--file_name`` - The path to the file in which to save the dump, if not specified, output to the console.
18
19Raw Values Of Efuse Registers
20-----------------------------
21
22The number of blocks depends on the chips and can vary from 4 to 11. A block can have different names, which can be used with ``burn_key`` or ``burn_block_data``.
23
24The order of registers in the dump:
25
26.. code-block:: none
27
28                                                        REG_0    REG_1    REG_2    REG_3    REG_4    REG_5
29    BLOCK0          (                ) [0 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000
30
31.. only:: esp32
32
33    .. code-block:: none
34
35        > espefuse.py  dump
36
37        Detecting chip type... Unsupported detection protocol, switching and trying again...
38        Connecting....
39        Detecting chip type... ESP32
40        BLOCK0          (                ) [0 ] read_regs: 00000000 7e5a6e58 00e294b9 0000a200 00000333 00100000 00000004
41        BLOCK1          (flash_encryption) [1 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
42        BLOCK2          (secure_boot_v1 s) [2 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
43        BLOCK3          (                ) [3 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
44
45        EFUSE_REG_DEC_STATUS        0x00000000
46
47.. only:: esp32c2
48
49    .. code-block:: none
50
51        > espefuse.py dump
52
53        Connecting.........
54        Detecting chip type... ESP32-C2
55        BLOCK0          (BLOCK0          ) [0 ] read_regs: 00000000 00000000
56        BLOCK1          (BLOCK1          ) [1 ] read_regs: 11efcdab 00000000 00000000
57        BLOCK2          (BLOCK2          ) [2 ] read_regs: 558000a4 000094b5 00000000 00000000 00000000 00000000 00000000 00000000
58        BLOCK_KEY0      (BLOCK3          ) [3 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
59
60        BLOCK0          (BLOCK0          ) [0 ] err__regs: 00000000 00000000
61        EFUSE_RD_RS_ERR_REG         0x00000000
62
63.. only:: not esp32 and not esp32c2
64
65    .. code-block:: none
66
67        > espefuse.py dump
68
69        Connecting....
70        Detecting chip type... ESP32-C3
71        BLOCK0          (                ) [0 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000
72        MAC_SPI_8M_0    (BLOCK1          ) [1 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000
73        BLOCK_SYS_DATA  (BLOCK2          ) [2 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
74        BLOCK_USR_DATA  (BLOCK3          ) [3 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
75        BLOCK_KEY0      (BLOCK4          ) [4 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
76        BLOCK_KEY1      (BLOCK5          ) [5 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
77        BLOCK_KEY2      (BLOCK6          ) [6 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
78        BLOCK_KEY3      (BLOCK7          ) [7 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
79        BLOCK_KEY4      (BLOCK8          ) [8 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
80        BLOCK_KEY5      (BLOCK9          ) [9 ] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
81        BLOCK_SYS_DATA2 (BLOCK10         ) [10] read_regs: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
82
83        BLOCK0          (                ) [0 ] err__regs: 00000000 00000000 00000000 00000000 00000000 00000000
84        EFUSE_RD_RS_ERR0_REG        0x00000000
85        EFUSE_RD_RS_ERR1_REG        0x00000000
86
87In the last lines, which are separated from the main dump, you can see the encoding scheme status for each block. If there are all zeros, then there are no coding scheme errors.
88
89Save Dump To Files
90------------------
91
92This command saves dump for each block into a separate file. You need to provide the common path name ``/chip1/blk.bin``, it will create files in the given directory (the directory must exist): /chip1/blk0.bin, /chip1/blk1.bin - /chip1/blkN.bin. Use ``burn_block_data`` command to write them back to another chip. Note that some blocks may be read-protected, in which case the data in the block will be zero.
93
94.. code-block:: none
95
96    > espefuse.py dump --format split --file_name backup/chip1/blk.bin
97
98    === Run "dump" command ===
99    backup/chip1/blk0.bin
100    backup/chip1/blk1.bin
101    backup/chip1/blk2.bin
102    backup/chip1/blk3.bin
103    backup/chip1/blk4.bin
104    backup/chip1/blk5.bin
105    backup/chip1/blk6.bin
106    backup/chip1/blk7.bin
107    backup/chip1/blk8.bin
108    backup/chip1/blk9.bin
109    backup/chip1/blk10.bin
110
111These dump files can be written to another chip:
112
113.. code-block:: none
114
115    > espefuse.py burn_block_data BLOCK0 backup/chip1/blk0.bin \
116    BLOCK1 backup/chip1/blk1.bin \
117    BLOCK2 backup/chip1/blk2.bin
118
119To save all eFuse blocks in one file, use the following command:
120
121.. code-block:: none
122
123    > espefuse.py dump --format joint --file_name backup/chip1/efuses.bin
124
125    === Run "dump" command ===
126    backup/chip1/efuses.bin
127