diff --git a/embed/prodtest/main.c b/embed/prodtest/main.c index 12459996bd..448e64b880 100644 --- a/embed/prodtest/main.c +++ b/embed/prodtest/main.c @@ -352,7 +352,7 @@ static void test_otp_write(const char *args) memzero(data, sizeof(data)); strncpy(data, args, sizeof(data) - 1); ensure(flash_otp_write(FLASH_OTP_BLOCK_BATCH, 0, (const uint8_t *) data, sizeof(data)), NULL); - ensure(flash_otp_lock(0), NULL); + ensure(flash_otp_lock(FLASH_OTP_BLOCK_BATCH), NULL); vcp_printf("OK"); } diff --git a/embed/trezorhal/common.c b/embed/trezorhal/common.c index 07c4776bec..c3afd92619 100644 --- a/embed/trezorhal/common.c +++ b/embed/trezorhal/common.c @@ -151,6 +151,7 @@ void collect_hw_entropy(void) uint8_t entropy[FLASH_OTP_BLOCK_SIZE]; random_buffer(entropy, FLASH_OTP_BLOCK_SIZE); ensure(flash_otp_write(FLASH_OTP_BLOCK_RANDOMNESS, 0, entropy, FLASH_OTP_BLOCK_SIZE), NULL); + ensure(flash_otp_lock(FLASH_OTP_BLOCK_RANDOMNESS), NULL); } // collect entropy from OTP randomness block ensure(flash_otp_read(FLASH_OTP_BLOCK_RANDOMNESS, 0, HW_ENTROPY_DATA + 12, FLASH_OTP_BLOCK_SIZE), NULL);