1# flake8: noqa
2# fmt: off
3espefuse(esp, efuses, args, 'burn_efuse DIS_FORCE_DOWNLOAD 1 DIS_DOWNLOAD_MODE 1')
4if efuses["DIS_FORCE_DOWNLOAD"].get() != 0:
5    raise esptool.FatalError("Burn should be at the end")
6
7espefuse(esp, efuses, args, 'burn_bit BLOCK_USR_DATA 64 66 69 72 78 82 83 90')
8if efuses["BLOCK_USR_DATA"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00":
9    raise esptool.FatalError("Burn should be at the end")
10
11espefuse(esp, efuses, args, 'read_protect_efuse BLOCK_SYS_DATA2')
12espefuse(esp, efuses, args, 'write_protect_efuse BLOCK_SYS_DATA2')
13if not efuses["BLOCK_SYS_DATA2"].is_readable() or not efuses["BLOCK_SYS_DATA2"].is_writeable():
14    raise esptool.FatalError("Burn should be at the end")
15
16espefuse(esp, efuses, args, 'burn_block_data BLOCK_KEY5 ../../images/efuse/256bit')
17if efuses["BLOCK_KEY5"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00":
18    raise esptool.FatalError("Burn should be at the end")
19
20espefuse(esp, efuses, args, 'burn_key BLOCK_KEY0 ../../images/efuse/256bit XTS_AES_128_KEY --no-read-protect')
21if efuses["BLOCK_KEY0"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00":
22    raise esptool.FatalError("Burn should be at the end")
23if not efuses["BLOCK_KEY0"].is_readable() or not efuses["BLOCK_KEY0"].is_writeable():
24    raise esptool.FatalError("Burn should be at the end")
25
26espefuse(esp, efuses, args, 'burn_key_digest BLOCK_KEY1 ../../secure_images/rsa_secure_boot_signing_key.pem SECURE_BOOT_DIGEST0')
27if efuses["BLOCK_KEY1"].get_meaning() != "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00":
28    raise esptool.FatalError("Burn should be at the end")
29if not efuses["BLOCK_KEY1"].is_readable() or not efuses["BLOCK_KEY1"].is_writeable():
30    raise esptool.FatalError("Burn should be at the end")
31