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:
parent
1dfaae6080
commit
33348e61e6
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.
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user