mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-15 19:08:07 +00:00
fix(core/prodtest): fix CPUID READ command
This commit is contained in:
parent
461664ebfa
commit
dbe7a393a8
1
core/embed/prodtest/.changelog.d/4310.fixed
Normal file
1
core/embed/prodtest/.changelog.d/4310.fixed
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fixed a device crash in the CPUID READ command.
|
@ -807,11 +807,15 @@ static void test_otp_write_device_variant(const char *args) {
|
|||||||
static void test_reboot(void) { reboot_device(); }
|
static void test_reboot(void) { reboot_device(); }
|
||||||
|
|
||||||
void cpuid_read(void) {
|
void cpuid_read(void) {
|
||||||
|
mpu_mode_t mpu_mode = mpu_reconfig(MPU_MODE_OTP);
|
||||||
|
|
||||||
uint32_t cpuid[3];
|
uint32_t cpuid[3];
|
||||||
cpuid[0] = LL_GetUID_Word0();
|
cpuid[0] = LL_GetUID_Word0();
|
||||||
cpuid[1] = LL_GetUID_Word1();
|
cpuid[1] = LL_GetUID_Word1();
|
||||||
cpuid[2] = LL_GetUID_Word2();
|
cpuid[2] = LL_GetUID_Word2();
|
||||||
|
|
||||||
|
mpu_restore(mpu_mode);
|
||||||
|
|
||||||
vcp_print("OK ");
|
vcp_print("OK ");
|
||||||
vcp_println_hex((uint8_t *)cpuid, sizeof(cpuid));
|
vcp_println_hex((uint8_t *)cpuid, sizeof(cpuid));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user