Просмотр исходного кода

tiny-test-fw: support testing apps with flash encryption

If CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT is set, pass
--encrypted flag to esptool.py.
Ivan Grokhotkov 6 лет назад
Родитель
Сommit
a37694741c
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      tools/tiny-test-fw/IDF/IDFApp.py
  2. 1 1
      tools/tiny-test-fw/IDF/IDFDUT.py

+ 5 - 0
tools/tiny-test-fw/IDF/IDFApp.py

@@ -135,6 +135,11 @@ class IDFApp(App.BaseApp):
                         # offs, filename
                         flash_files.append((args[idx], args[idx + 1]))
 
+        # The build metadata file does not currently have details, which files should be encrypted and which not.
+        # Assume that all files should be encrypted if flash encryption is enabled in development mode.
+        sdkconfig_dict = self.get_sdkconfig()
+        flash_settings["encrypt"] = "CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT" in sdkconfig_dict
+
         # make file offsets into integers, make paths absolute
         flash_files = [(int(offs, 0), os.path.join(self.binary_path, path.strip())) for (offs, path) in flash_files]
 

+ 1 - 1
tools/tiny-test-fw/IDF/IDFDUT.py

@@ -217,7 +217,7 @@ class IDFDUT(DUT.SerialDUT):
                 'no_stub': False,
                 'compress': True,
                 'verify': False,
-                'encrypt': False,
+                'encrypt': self.app.flash_settings.get("encrypt", False),
                 'erase_all': False,
             })