1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

fix(core/prodtest): fix CPUID READ command

This commit is contained in:
cepetr 2024-11-04 15:36:12 +01:00 committed by TychoVrahe
parent 461664ebfa
commit dbe7a393a8
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

@ -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));
}