PaulS
Well-known member
Triggered by a recent discussion about a Teensy 4 unique MAC address, I wondered whether the i.MX RT1060 processor on the Teensy 4.x also has a unique chip serial number like the MK20DX256 chip on a Teensy 3.1/3.2.
Yes, there is:
Here is a piece of code to read out that 64-bit Unique_ID:
Ran this code on different Teensy 4.x's.
Teensy 4.0:
6147A86E 3912C1D7
65F82969 390949D2
64FC9020 441D81D7
Teensy 4.1:
65F8296A 353599D2
Paul
Yes, there is:
Here is a piece of code to read out that 64-bit Unique_ID:
C++:
// from i.MX RT1060 Processor Reference Manual, Rev 3
// see "Table 22-9 Fusemap Descriptions", page 1301, Fuse Address 0x420 - 0x410: UNIQUE_ID[63:0]
//
// see also Chapter "23.6.1.1 OCOTP memory map", page 1319,
// OTP Bank0 Word1 (Configuration and Manufacturing Info) (CFG0)
// OTP Bank0 Word2 (Configuration and Manufacturing Info) (CFG1)
#define CFG0 (*(const uint32_t *)0x401F4410)
#define CFG1 (*(const uint32_t *)0x401F4420)
void setup() {
Serial.begin(115200);
while (!Serial) {};
pinMode(13, OUTPUT);
digitalWrite(13, HIGH); // just to show that board is active
delay(1000);
Serial.print("Reading Unique_ID from hardware: ");
char Unique_ID[18];
sprintf(Unique_ID, "%08lX %08lX", CFG0, CFG1);
Serial.println(Unique_ID);
Serial.println("About to reset in 3 secs...");
delay(3000);
SCB_AIRCR = 0x05FA0004; // software reset
}
void loop() {
}
Ran this code on different Teensy 4.x's.
Teensy 4.0:
6147A86E 3912C1D7
65F82969 390949D2
64FC9020 441D81D7
Teensy 4.1:
65F8296A 353599D2
Paul