diff --git a/core/embed/bootloader/emulator.c b/core/embed/bootloader/emulator.c index 68c8f5ab0f..065c465de9 100644 --- a/core/embed/bootloader/emulator.c +++ b/core/embed/bootloader/emulator.c @@ -7,6 +7,9 @@ #include "flash.h" #include "model.h" #include "rust_ui.h" +#ifdef USE_OPTIGA +#include "secret.h" +#endif #include "emulator.h" @@ -40,9 +43,17 @@ __attribute__((noreturn)) int main(int argc, char **argv) { (void)ret; } - if (argc == 2 && argv[1][0] == 's') { - // Run the firmware - stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG; + if (argc == 2) { + if (argv[1][0] == 's') { + // Run the firmware + stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG; + } +#ifdef USE_OPTIGA + else if (argv[1][0] == 'l') { + // write bootloader-lock secret + secret_write_header(); + } +#endif } else if (argc == 4) { display_init(); display_backlight(180);