From dbe7a393a8732aa11f837b7c83035b45bbbd0601 Mon Sep 17 00:00:00 2001 From: cepetr Date: Mon, 4 Nov 2024 15:36:12 +0100 Subject: [PATCH] fix(core/prodtest): fix CPUID READ command --- core/embed/prodtest/.changelog.d/4310.fixed | 1 + core/embed/prodtest/main.c | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 core/embed/prodtest/.changelog.d/4310.fixed diff --git a/core/embed/prodtest/.changelog.d/4310.fixed b/core/embed/prodtest/.changelog.d/4310.fixed new file mode 100644 index 0000000000..8e5090e583 --- /dev/null +++ b/core/embed/prodtest/.changelog.d/4310.fixed @@ -0,0 +1 @@ +Fixed a device crash in the CPUID READ command. diff --git a/core/embed/prodtest/main.c b/core/embed/prodtest/main.c index 5ced433426..8a68a3ed19 100644 --- a/core/embed/prodtest/main.c +++ b/core/embed/prodtest/main.c @@ -807,11 +807,15 @@ static void test_otp_write_device_variant(const char *args) { static void test_reboot(void) { reboot_device(); } void cpuid_read(void) { + mpu_mode_t mpu_mode = mpu_reconfig(MPU_MODE_OTP); + uint32_t cpuid[3]; cpuid[0] = LL_GetUID_Word0(); cpuid[1] = LL_GetUID_Word1(); cpuid[2] = LL_GetUID_Word2(); + mpu_restore(mpu_mode); + vcp_print("OK "); vcp_println_hex((uint8_t *)cpuid, sizeof(cpuid)); }