Serial Number of Teensy 3.1

Status
Not open for further replies.
@Pauls of course with the unique ID in Freescale's chip, one can derive the lower bits of an Ethernet MAC address, an make the upper bits be a registered IEEE OUI such as PJRC et al have. Or, use IEEE's "self-administed" coding for the high bits, and be generic but still unique from any other NICs in the LAN. Self-administered MACs are for use only on a LAN, not into a WAN.
 
Do you have any idea why the reported USB serialnumber has an additional zero padded?

The extra zero is a workaround for a Macintosh OS-X bug, where the last digit of the serial number is lost when creating the /dev/cu.usbmodem#### device name, which then has the interface number appended. If you use a Teensy in USB serial mode on a Mac, you'll see the device name always has the serial number, with the last zero replaced by a 1. Without the extra zero, OS-X loses one digit.

I and others have reported this bug to Apple. Someone on their mail list figured out the exact place in the Darwin source code where the error happens, because a buffer is too short by 1 byte. This conversation happened years ago. Every indication is Apple will never fix this.

As a workaround, I added the extra zero, so Mac users get proper non-conflicting device names when they have Teensys that differ in serial numbers only on their last digit.
 
Thanks Paul - wasn't sure why the pad was needed - but - it matched what I saw in Win USB and TyQt

Question: is there an example of reading 'registers' like the on chip ID - I got to the pointed spot in the manual - but like @PaulS not sure on reading: Address: 4004_7000h base + 1054h offset = 4004_8054h (pg265...F1RM.pdf)
 
@PaulS
Thanks, found your comment in usb-desc.c as well.

@Defragster
Here is a piece of code that reads and displays the 128-bit Unique ID:
Code:
void setup() {
  char ID[32];
  sprintf(ID, "%08lX %08lX %08lX %08lX", SIM_UIDH, SIM_UIDMH, SIM_UIDML, SIM_UIDL);

  Serial.begin(115200);
  while (!Serial);
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH); // just to show that serial port is opened
  delay (1000);
  Serial.print("Reading 128-bit UniqueID from chip: ");
  Serial.println(ID);
}

void loop() {
}
And this is the output on the serial monitor: "Reading 128-bit UniqueID from chip: A4210000 70E10003 00254018 31374E45"
What's the ID of your Teensy?

Regards,
Paul
 
...
Unfortunately, I'm not that familiar with coding C++ to access these registers.
The 4 32-bit UID registers are defined in the firmware in kinetis.h, so you should be able to reference/print them from your sketch
Code:
#define SIM_UIDH        (*(const uint32_t *)0x40048054)    // Unique Identification Register High
#define SIM_UIDMH       (*(const uint32_t *)0x40048058)    // Unique Identification Register Mid-High
#define SIM_UIDML       (*(const uint32_t *)0x4004805C)    // Unique Identification Register Mid Low
#define SIM_UIDL        (*(const uint32_t *)0x40048060)    // Unique Identification Register Low

The LC has only 3 32-bit UID registers (no UIDH)
 
Last edited:
Our posts must have been crossed :)
Yes, I also found the definitions in kinetis.h and used them in my code.

Paul
 
And this is the output on the serial monitor: "Reading 128-bit UniqueID from chip: A4210000 70E10003 00254018 31374E45"
What's the ID of your Teensy?

here are my IDs
3.1 Reading 128-bit UniqueID from chip: FFFFFFFF FFFF000A 00364009 24754E45
3.0 Reading 128-bit UniqueID from chip: FFFFFFFF FFFF0013 000C2003 14134D44
LC Reading 96-bit UniqueID from chip: 00000051 00701007 28234E45
beta LC 00000024 000E1007 28234E45

my favorite macro for displaying symbol/value
#define PRREG(x) Serial.print(#x" 0x"); Serial.println(x,HEX)
 
Last edited:
That's interesting. The fineprint on the chip on my (2 months old) Teensy 3.1 reads "1436" on the lowest line, so I guess it's produced in week 36, 2014.
Since you joined this forum more than 2 years before me, I take it that your Teensy's and chips are manufactured way earlier than mine.
And that leads to thinking that the default ID on the chip-die is all FF's and then laser-fused before packaging. Someone has an idea about this?

Regards,
Paul
 
batch dates on my chips: 3.0 is 1226, 3.1 is 1234
(i never could find a date on my LC chips, code 1N15J ?
 
I've been told those codes like "1N15J" identify which piece of Freescale silicon is actually inside.

On Teensy 3.1, the oldest boards (from January 2014) have "1N36B". I believe the first digit is the revision of the silicon.
 
On my Teensy 3.1, the chip states "3N36B".
That would be rev 3 of the silicon, which is consistent with the value I read from the System Device Identification Register (SIM_SDID), bits 15-12 [REVID].
 
Hi guys,
I've just received my first Teensy v3.6.... is there a simple way to retrieve a single byte to be used as unique ID?

Thanks!
 
How about 16 bytes. NXP put a unique signature into every chip. You can read it with registers SIM_UIDH, SIM_UIDMH, SIM_UIDML and SIM_UIDL.

Every 32 bit Teensy also has a serial number written by PJRC. Search for info about reading the ethernet mac address.
 
Status
Not open for further replies.
Back
Top