feat(doc): Adds note for parttool that if SB or FE are on
Use "--esptool-erase-args=force" to ignore the esptool error
This commit is contained in:
@@ -328,6 +328,24 @@ The command-line interface of `parttool.py` has the following structure:
|
||||
# Print the size of default boot partition
|
||||
parttool.py --port "/dev/ttyUSB1" get_partition_info --partition-boot-default --info size
|
||||
|
||||
.. note::
|
||||
If the device has already enabled ``Flash Encryption`` or ``Secure Boot``, attempting to use commands that modify the flash content, such as ``erase_partition`` or ``write_partition``, will result in an error. This error is generated by the erase command of ``esptool.py``, which is called first before writing. This error is done as a safety measure to prevent bricking your device.
|
||||
|
||||
::
|
||||
A fatal error occurred: Active security features detected, erasing flash is disabled as a safety measure. Use --force to override, please use with caution, otherwise it may brick your device!
|
||||
|
||||
To work around this, you need use the ``--force`` flag with ``esptool.py``. Specifically, the ``parttool.py`` provides the ``--esptool-erase-args`` argument that help to pass this flag to ``esptool.py``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Erase partition with name 'storage'
|
||||
# If Flash Encryption or Secure Boot are enabled then add "--esptool-erase-args=force"
|
||||
parttool.py --port "/dev/ttyUSB1" --esptool-erase-args=force erase_partition --partition-name=storage
|
||||
|
||||
# Write to partition 'factory' the contents of a file named 'factory.bin'
|
||||
# If Flash Encryption or Secure Boot are enabled then add "--esptool-erase-args=force"
|
||||
parttool.py --port "/dev/ttyUSB1" --esptool-erase-args=force write_partition --partition-name=factory --input "factory.bin"
|
||||
|
||||
More information can be obtained by specifying `--help` as argument:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
Reference in New Issue
Block a user