diff --git a/docs/en/api-guides/tools/qemu.rst b/docs/en/api-guides/tools/qemu.rst index d5b2649919..3160bab91b 100644 --- a/docs/en/api-guides/tools/qemu.rst +++ b/docs/en/api-guides/tools/qemu.rst @@ -153,5 +153,5 @@ By default, the values of eFuses are read from and written to the ``qemu_efuse.b Emulating Secure Boot ~~~~~~~~~~~~~~~~~~~~~ -QEMU supports emulation of secure boot v2 scheme. Please keep :ref:`CONFIG_SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT` enabled to include signed bootloader image into the qemu image artifact. +QEMU supports emulation of secure boot v2 scheme. Please keep :ref:`CONFIG_SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT` enabled to include signed bootloader image into the QEMU image artifact. diff --git a/docs/zh_CN/api-guides/tools/qemu.rst b/docs/zh_CN/api-guides/tools/qemu.rst index 14f962dbcf..87ba8729a2 100644 --- a/docs/zh_CN/api-guides/tools/qemu.rst +++ b/docs/zh_CN/api-guides/tools/qemu.rst @@ -1,6 +1,8 @@ QEMU 模拟器 =========== +{IDF_TARGET_CRYPT_CNT:default="SPI_BOOT_CRYPT_CNT",esp32="FLASH_CRYPT_CNT"} + :link_to_translation:`en:[English]` 乐鑫维护了一个 QEMU 模拟器的 `分支 `_,支持 {IDF_TARGET_NAME}。这个分支实现了对 {IDF_TARGET_NAME} 的 CPU、内存和多个外设的模拟。更多有关 {IDF_TARGET_NAME} 的 QEMU 的信息,请参阅 `QEMU README 文档 `_。 @@ -119,13 +121,37 @@ QEMU 支持 eFuse 的仿真,可用来测试安全启动和 flash 加密等与 使用 :doc:`idf.py` eFuse 相关命令来编程 eFuse。当这些命令与 ``qemu`` 命令一起运行时,eFuse 会在 QEMU 中编程,并且 ``qemu_efuse.bin`` 文件会更新。例如, +.. only:: not SOC_FLASH_ENCRYPTION_XTS_AES + + .. code-block:: console + + idf.py qemu efuse-burn {IDF_TARGET_CRYPT_CNT} 1 + idf.py qemu efuse-burn-key flash_encryption my_flash_encryption_key.bin + +.. only:: SOC_FLASH_ENCRYPTION_XTS_AES + + .. code-block:: console + + idf.py qemu efuse-burn {IDF_TARGET_CRYPT_CNT} 1 + idf.py qemu efuse-burn-key BLOCK my_flash_encryption_key.bin KEYPURPOSE + + 有关 ``BLOCK`` 和 ``KEYPURPOSE`` 的详细信息,请参阅 :doc:`../../security/flash-encryption` 指南。 + +如需导出 eFuse 概要,使用以下命令: + .. code-block:: console - idf.py qemu efuse-burn FLASH_CRYPT_CNT 1 + idf.py qemu efuse-summary 默认情况下,eFuse 的值从编译文件夹里的 ``qemu_efuse.bin`` 文件中读取和写入。也可以使用 ``--efuse-file`` 选项指定不同的文件。例如, .. code-block:: console - idf.py qemu --efuse-file my_efuse.bin efuse-burn FLASH_CRYPT_CNT 1 + idf.py qemu --efuse-file my_efuse.bin efuse-burn {IDF_TARGET_CRYPT_CNT} 1 idf.py qemu --efuse-file my_efuse.bin monitor + +模拟安全启动 +~~~~~~~~~~~~~ + +QEMU 支持模拟安全启动 v2 机制。请保持 :ref:`CONFIG_SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT` 处于启用状态,将签名的引导加载程序镜像嵌入到 QEMU 的镜像文件中。 + diff --git a/docs/zh_CN/security/security-features-enablement-workflows.rst b/docs/zh_CN/security/security-features-enablement-workflows.rst index d7f9a8a3dd..56a743b4d3 100644 --- a/docs/zh_CN/security/security-features-enablement-workflows.rst +++ b/docs/zh_CN/security/security-features-enablement-workflows.rst @@ -18,6 +18,11 @@ 这份指南介绍了一系列工作流程,从而在外部主机的协助下启用设备的安全功能。这些工作流程分为多个阶段,每个阶段都会在主机上生成签名/加密密钥,从而在发生电力或其他故障时,提高恢复几率。此外,在主机的协助下,这些流程将加快整体配置过程(例如,在主机上加密固件要比在设备上加密更快)。 +.. only:: TARGET_SUPPORT_QEMU + + .. important:: + + 可以在 :doc:`../api-guides/tools/qemu` 中虚拟测试 {IDF_TARGET_NAME} 目标芯片的安全功能。安全工作流程建立后,便可在真实硬件上继续操作。 目标 ---- diff --git a/docs/zh_CN/security/security.rst b/docs/zh_CN/security/security.rst index 455c79723f..104c38b7fb 100644 --- a/docs/zh_CN/security/security.rst +++ b/docs/zh_CN/security/security.rst @@ -13,6 +13,12 @@ 在本指南中,最常用的命令形式为 ``idf.py secure-``,这是对应 ``espsecure.py `` 的封装。基于 ``idf.py`` 的命令能提供更好的用户体验,但与基于 ``espsecure.py`` 的命令相比,可能会损失一部分高级功能。 +.. only:: TARGET_SUPPORT_QEMU + + .. important:: + + 可以在 :doc:`../api-guides/tools/qemu` 中虚拟测试 {IDF_TARGET_NAME} 目标芯片的安全功能。安全工作流程建立后,便可在真实硬件上继续操作。 + 目标 ----