-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VSC-1213] Enhance flash encryption (#1247)
* Enhance flash ecnryption * fix: display number and boolean values in Explorer * Add validation for jtag disabled from hardware * Fix lint * Revert unwanted changes caused by rebase * Fix file path * move encryption functions to new file * Add no reset flag if realease mode is enabled * Add translation; Fix after rebase * Fixes after rebase * Fix based on PR comments * Fix: Documentation * Add progress bar for reading efuse * Fix lint
- Loading branch information
1 parent
5e2f0b9
commit 122f84e
Showing
16 changed files
with
638 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _flash_encryption: | ||
|
||
Flash Encryption | ||
======================== | ||
|
||
Flash Encryption secures the device's flash memory contents. Once enabled, the firmware is uploaded in plaintext but becomes encrypted on the first boot, thus preventing unauthorized flash readouts. For more details, refer to the `ESP-IDF Flash Encryption documentation <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/security/flash-encryption.html>`_. | ||
|
||
Let's open an ESP-IDF project. For this tutorial, we will use the ``security/flash_encryption`` example. | ||
|
||
1. Navigate to **View** > **Command Palette** and search for the **ESP-IDF: Show Example Projects** command, then choose ``Use Current ESP-IDF (/path/to/esp-idf)``. If you don't see this option, please review the setup in the :ref:`Install ESP-IDF and Tools <installation>`. | ||
|
||
2. A window will open with a list of projects. Search for ``flash_encryption``. You will see a **Create project using example flash_encryption** button at the top and a description of the project below. Click the button, and the project will open in a new window. | ||
|
||
.. image:: ../../../media/tutorials/flash_encryption/flash-encryption.png | ||
:alt: Flash Encryption example | ||
|
||
3. Configure the project by setting up the following: | ||
|
||
- Select the Port to Use | ||
- Set the Espressif Device Target | ||
- Set the Flashing Method to UART | ||
|
||
.. note:: | ||
In case this step is not clear, take a look at the :ref:`Build the project <build the project>`. | ||
|
||
4. Use the Command Palette with ``ESP-IDF: SDK Configuration editor (Menuconfig)`` to open the SDK Config Menu. Search for **flash encryption** and enable the following option: | ||
|
||
.. image:: ../../../media/tutorials/flash_encryption/flash-encryption2.png | ||
:alt: Flash Encryption configuration | ||
|
||
.. important:: | ||
Enabling flash encryption limits the options for further updates of the ESP32. Before using this feature, read the document and make sure to understand the implications. `ESP-IDF Flash Encryption documentation <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/security/flash-encryption.html>`_ | ||
|
||
5. Build the project. | ||
|
||
6. Flash the project. | ||
|
||
.. note:: | ||
The first flash will upload the firmware without using the ``--encrypt`` flag. After flashing is complete, you will need to reset your device by pressing the reset button on the board. (The button may be labeled as "RESET", "RST", or "EN") | ||
|
||
7. Flash the firmware once again, this time if all the steps were followed correctly, the ``--encrypt`` flag will be automatically added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.