We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8fbbf commit 4de2a1eCopy full SHA for 4de2a1e
ports/mimxrt10xx/common-hal/microcontroller/Processor.c
@@ -58,8 +58,17 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
58
OCOTP_Init(OCOTP, CLOCK_GetFreq(kCLOCK_IpgClk));
59
60
// Reads shadow registers 0x01 - 0x04 (Configuration and Manufacturing Info)
61
+ // into 8 bit wide destination, avoiding punning.
62
for (int i = 0; i < 4; ++i)
- ((uint32_t*) raw_id)[i] = OCOTP_ReadFuseShadowRegister(OCOTP, i + 1);
63
+ {
64
+ uint32_t wr = OCOTP_ReadFuseShadowRegister(OCOTP, i + 1);
65
+
66
+ for (int j = 0; j < 4; j++)
67
68
+ raw_id[i*4+j] = wr&0xff;
69
+ wr>>=8;
70
+ }
71
72
73
OCOTP_Deinit(OCOTP);
74
}
0 commit comments