1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-10 23:40:58 +00:00

fix(core/prodtest): fix CPUID READ command

(cherry picked from commit dbe7a393a8)
This commit is contained in:
cepetr 2024-11-04 15:36:12 +01:00 committed by Martin Milata
parent 1dfaae6080
commit 33348e61e6
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Fixed a device crash in the CPUID READ command.

View File

@ -804,11 +804,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));
}