ttfw_idf: Extend bootloader_flash API

This commit is contained in:
KonstantinKondrashov 2023-03-31 21:19:50 +08:00 committed by BOT
parent a2ffc9374c
commit 20740ce0da

View File

@ -391,13 +391,14 @@ class IDFDUT(DUT.SerialDUT):
for (_, f) in encrypt_offs_files:
f.close()
def bootloader_flash(self):
def bootloader_flash(self, binary_path=None):
"""
download bootloader.
:return: None
"""
bootloader_path = os.path.join(self.app.binary_path, 'bootloader', 'bootloader.bin')
binary_path = self.app.binary_path if binary_path is None else binary_path
bootloader_path = os.path.join(binary_path, 'bootloader', 'bootloader.bin')
offs = int(self.app.get_sdkconfig()['CONFIG_BOOTLOADER_OFFSET_IN_FLASH'], 0)
flash_files = [(offs, bootloader_path)]
self.write_flash(flash_files)