Optimized Production flashing w/ encryption & secure boot?
Posted: Mon Jan 30, 2017 6:03 am
For a production environment where secure boot and flash encryption are required, the recommendation seems to be to flash a plaintext firmware either via preprogrammed flash chips or over uart and let the chip generate its own unique key and encrypt the flash in place on first boot. Obviously one wants to minimize programming and test time in production, so is this the most optimized way? What is the duration of this operation for a typical firmware image?
So the question becomes is it possible to flash a pre-encrypted firmware over uart or to have the stub loader encrypt on write or to write pre-encrypted directly to the flash chip using external spi interface and then manually set the FLASH_CRYPT_CNT to 1 so the flash is not reencrypted?
The goal being to save any precious seconds the device has to spend on the programming/testing jigs.
The other option is to generate a high entropy random key off-device and program it into the efuse memory, but again the recommendation is to flash a plaintext firmware first.Encrypting in-place can take some time (up to a minute for large partitions.)
So the question becomes is it possible to flash a pre-encrypted firmware over uart or to have the stub loader encrypt on write or to write pre-encrypted directly to the flash chip using external spi interface and then manually set the FLASH_CRYPT_CNT to 1 so the flash is not reencrypted?
The goal being to save any precious seconds the device has to spend on the programming/testing jigs.