You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above command first extracts the public key from the HSM, generates a signature for an image using the HSM, and then creates a signature block and appends it to the image to generate a signed image.
27
27
28
28
If the public key is not stored in the external HSM, you can specify the ``--pub-key`` argument to supply the public key. ::
In case you are using ESP-IDF, then an unsigned application can be generated by disabling ``CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES`` configuration option in the project settings.
@@ -37,11 +37,11 @@ Verifying the Signed Image
37
37
38
38
Once the signed image is generated, we can verify it using the following command: ::
Copy file name to clipboardExpand all lines: docs/en/migration-guide.rst
+68-18Lines changed: 68 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
.. _migration:
2
2
3
-
esptool.py ``v5`` Migration Guide
4
-
=================================
3
+
``v5`` Migration Guide
4
+
======================
5
5
6
-
This document describes the breaking changes made to esptool.py in the major release ``v5``. It provides guidance on adapting existing workflows and scripts to ensure compatibility when updating from ``v4.*``.
6
+
This document describes the breaking changes made to esptool.py, espsecure.py and espefuse.py in the major release ``v5``. It provides guidance on adapting existing workflows and scripts to ensure compatibility when updating from ``v4.*``.
7
7
8
+
esptool.py ``v5`` Migration Guide
9
+
*********************************
8
10
9
11
``image-info`` Output Format Change
10
-
***********************************
12
+
###################################
11
13
12
14
The output format of the :ref:`image-info <image-info>` command has been **updated in v5**. The original format (``--version 1``) is **deprecated** and replaced by the updated format (``--version 2``). The ``--version`` argument has been **removed entirely**, and the new format is now the default and only option.
13
15
@@ -23,7 +25,7 @@ The output format of the :ref:`image-info <image-info>` command has been **updat
23
25
2. Remove any ``--version`` arguments from ``image-info`` commands.
24
26
25
27
Output Logging
26
-
**************
28
+
##############
27
29
28
30
The esptool ``v5`` release introduces a centralized logging mechanism to improve output management and allow redirection.
29
31
@@ -42,7 +44,7 @@ The esptool ``v5`` release introduces a centralized logging mechanism to improve
42
44
See the :ref:`logging <logging>` section for more details on available logger methods and custom logger implementation.
43
45
44
46
``write-flash`` ``--verify`` Argument
45
-
*************************************
47
+
#####################################
46
48
47
49
The ``--verify`` option for the :ref:`write-flash <write-flash>` command has been **deprecated in v5**. Flash verification is performed automatically after every successful write operation when technically feasible.
48
50
@@ -58,7 +60,7 @@ The ``--verify`` option for the :ref:`write-flash <write-flash>` command has bee
58
60
2. Update scripts/CI pipelines to remove ``--verify`` flags.
59
61
60
62
Error Output Handling
61
-
*********************
63
+
#####################
62
64
63
65
In ``v5``, error handling and output behavior have been improved to provide better user experience and script compatibility.
64
66
@@ -75,7 +77,7 @@ In ``v5``, error handling and output behavior have been improved to provide bett
75
77
2. Ensure scripts handle non-zero exit codes correctly in the case of operations interrupted by the user.
76
78
77
79
Beta Target Support Removal
78
-
***************************
80
+
###########################
79
81
80
82
Support for the following beta targets has been **removed in v5**:
81
83
@@ -93,7 +95,7 @@ Support for the following beta targets has been **removed in v5**:
93
95
Use esptool ``v4`` for legacy workflows targeting these beta chips.
94
96
95
97
``verify-flash`` ``--diff`` Argument
96
-
*************************************
98
+
####################################
97
99
98
100
The format of the ``--diff`` option of the :ref:`verify-flash <verify-flash>` command has **changed in v5**. Previously, ``--diff=yes/no`` had to be specified to enable or disable the diff output. In the new version, the ``--diff`` option is a simple boolean switch without the need of a ``yes`` or ``no`` value.
99
101
@@ -102,7 +104,7 @@ The format of the ``--diff`` option of the :ref:`verify-flash <verify-flash>` co
102
104
1. Rewrite the ``--diff=yes`` argument to a simple ``--diff`` in any existing ``verify-flash`` commands in scripts/CI pipelines. Delete ``--diff=no`` completely if detailed diff output is not required.
103
105
104
106
Using esptool as a Python Module
105
-
********************************
107
+
################################
106
108
107
109
All command functions (e.g., ``verify-flash``, ``write-flash``) have been refactored to remove their dependency on the ``args`` object from the argparse module. Instead, all arguments are now passed explicitly as individual parameters. This change, combined with enhancements to the public API, provides a cleaner, more modular interface for programmatic use of esptool in custom scripts and applications (see :ref:`scripting <scripting>`).
108
110
@@ -121,7 +123,7 @@ For detailed examples and API reference, see the :ref:`scripting <scripting>` se
121
123
122
124
123
125
Flash Operations from Non-flash Related Commands
124
-
************************************************
126
+
################################################
125
127
126
128
When esptool is used as a CLI tool, the following commands no longer automatically attach the flash by default, since flash access is not required for their core functionality:
127
129
@@ -145,7 +147,7 @@ The ``--spi-connection`` CLI argument has been **removed** from non-flash relate
145
147
146
148
147
149
Shell Completion
148
-
****************
150
+
################
149
151
150
152
The esptool ``v5`` has switched to using `Click <https://click.palletsprojects.com/>`_ for command line argument parsing, which changes how shell completion works.
151
153
@@ -155,7 +157,7 @@ The esptool ``v5`` has switched to using `Click <https://click.palletsprojects.c
155
157
2. Follow the new shell completion setup instructions in the :ref:`shell-completion` section of the :ref:`installation <installation>` guide.
156
158
157
159
``merge-bin`` ``--fill-flash-size`` Argument
158
-
********************************************
160
+
############################################
159
161
160
162
The ``--fill-flash-size`` option of the :ref:`merge-bin <merge-bin>` command has been renamed to ``--pad-to-size``. This change provides a more intuitive and descriptive name for the argument and is consistent with the naming scheme in other esptool image manipulation commands.
161
163
@@ -164,7 +166,7 @@ The ``--fill-flash-size`` option of the :ref:`merge-bin <merge-bin>` command has
164
166
1. Rename the ``--fill-flash-size`` to ``--pad-to-size`` in any existing ``merge-bin`` commands in scripts/CI pipelines.
The ``--ignore-flash-encryption-efuse-setting`` option of the :ref:`write-flash <write-flash>` command has been renamed to ``--ignore-flash-enc-efuse``. This change shortens the argument name to improve readability and consistency with other esptool options.
170
172
@@ -173,7 +175,7 @@ The ``--ignore-flash-encryption-efuse-setting`` option of the :ref:`write-flash
173
175
1. Rename the ``--ignore-flash-encryption-efuse-setting`` to ``--ignore-flash-enc-efuse`` in any existing ``write-flash`` commands in scripts/CI pipelines.
174
176
175
177
``make_image`` Command Removal
176
-
******************************
178
+
##############################
177
179
178
180
The ``make_image`` command for the ESP8266 has been **removed in v5**. This command has been deprecated in favor of using **objcopy** (or other tools) to generate ELF images and then using ``elf2image`` to create the final ``.bin`` file.
179
181
@@ -182,7 +184,7 @@ The ``make_image`` command for the ESP8266 has been **removed in v5**. This comm
182
184
1. Replace any ``make_image`` workflows with the recommended way of assembling firmware images using **objcopy** and ``elf2image``.
183
185
184
186
Using Binary from GitHub Releases on Linux
185
-
******************************************
187
+
##########################################
186
188
187
189
The ``esptool.py`` binary from GitHub Releases on Linux is now using Ubuntu 22.04 as the base image. That means the image is using ``glibc`` 2.35, which is not fully compatible with the ``glibc`` 2.28 from Ubuntu 20.04 (the base image for ``v4.*``).
188
190
@@ -191,7 +193,7 @@ The ``esptool.py`` binary from GitHub Releases on Linux is now using Ubuntu 22.0
191
193
1. Update your operating system to a newer version which bundles ``glibc`` 2.35 or later
192
194
193
195
Command and Option Renaming
194
-
***************************
196
+
###########################
195
197
196
198
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``write_flash`` -> ``write-flash``).
197
199
@@ -204,10 +206,58 @@ This change affects most of the commands and the following options: ``--flash_si
204
206
1. Replace all underscores in command and option names with ``-`` in your scripts and CI pipelines.
205
207
206
208
Log Format Changes
207
-
******************
209
+
##################
208
210
209
211
A significant amount of changes have been made to the log styling and formatting in ``v5``. Some of the messages, warnings, and errors are now formatted differently or reworded to provide more context and improve readability. Exhaustive list of changed messages won't be provided.
210
212
211
213
**Migration Steps:**
212
214
213
215
1. Make sure to adjust any of your scripts, asserts, CI workflows, or others to accommodate the new/changed format of messages. If you are parsing the log output (not recommended), consider importing esptool as a module and using the public API (see :ref:`here <scripting>`) to get the information you need.
216
+
217
+
218
+
espsecure.py ``v5`` Migration Guide
219
+
***********************************
220
+
221
+
Command and Option Renaming
222
+
###########################
223
+
224
+
All the commands and options have been renamed to use ``-`` instead of ``_`` as a separator (e.g., ``sign_data`` -> ``sign-data``).
225
+
226
+
Old command and option names are **deprecated**, meaning they will work for now with a warning, but will be removed in the next major release.
227
+
228
+
This change affects most of the commands and the following options: ``--aes_xts``, ``--flash_crypt_conf``, ``--append_signatures``.
229
+
230
+
**Migration Steps:**
231
+
232
+
1. Replace all underscores in command and option names with ``-`` in your scripts and CI pipelines.
233
+
234
+
Public API Changes
235
+
##################
236
+
237
+
The public API of ``espsecure.py`` has been updated to provide a more consistent and user-friendly interface for programmatic use in custom scripts and applications.
238
+
239
+
**Key Changes:**
240
+
241
+
- All functions now accept individual parameters instead of relying on the ``args`` object from the argparse module. Affected functions are:
242
+
- ``digest_secure_bootloader``
243
+
- ``generate_signing_key``
244
+
- ``digest_secure_bootloader``
245
+
- ``generate_signing_key``
246
+
- ``sign_data`` including ``sign_secure_boot_v1`` and ``sign_secure_boot_v2``
247
+
- ``verify_signature`` including ``verify_signature_v1`` and ``verify_signature_v2``
248
+
- ``extract_public_key``
249
+
- ``signature_info_v2``
250
+
- ``digest_sbv2_public_key`` and ``digest_rsa_public_key``
251
+
- ``digest_private_key``
252
+
- ``generate_flash_encryption_key``
253
+
- ``decrypt_flash_data``
254
+
- ``encrypt_flash_data``
255
+
- The ``main`` function parameter ``custom_commandline`` has been renamed to ``argv`` to unify the naming convention with esptool.
256
+
257
+
**Migration Steps:**
258
+
259
+
1. Update function calls to pass individual parameters instead of the ``args`` object. For example:
0 commit comments