encrypt_flash.sh 471 B

1234567891011121314
  1. #This is the step for ESP32-S2/S3/C3
  2. #!/bin/bash
  3. set -e
  4. if [ -z "$ESPPORT" ]; then
  5. echo "ESPPORT must be set"
  6. exit 1
  7. fi
  8. dd if=/dev/zero of=key.bin bs=1 count=32
  9. # Change the first byte as espsecure uses modules that won't
  10. # allow symmetric keys
  11. echo -ne \\xFF | dd conv=notrunc bs=1 count=1 of=key.bin
  12. espefuse.py --do-not-confirm -p $ESPPORT burn_efuse SPI_BOOT_CRYPT_CNT 0x1
  13. espefuse.py --do-not-confirm -p $ESPPORT burn_key BLOCK_KEY2 key.bin XTS_AES_128_KEY