Adding a Unique identifying number to a Teensy device

Status
Not open for further replies.

Davidelvig

Well-known member
I'll be shipping a Teensy 3.2-based device soon, and would like each device to have a unique number, to be included in error and usage logs.
What's the best practice for that, or is there a unique number or string backed into Teensy through the boot loader somehow? I'm using the Teensy boot loader on a custom board. Something in the MK20DX?
I could configure one in flash, I suppose.

Thanks!
 
For numbers already built in, you can use the 24 bit serial number PJRC writes into the "program once" memory, or you can use the 128 unique number NXP puts into the chip.

For NXP's unique number, look at pages 265-267 in the MK20DX256 reference manual.

https://www.pjrc.com/teensy/datasheets.html

Reading the program once memory for PJRC's unique serial number takes a little more work. This code in the USB descriptor initialization is the place to start.

https://github.com/PaulStoffregen/c...dd2611000dc3214c25c9/teensy3/usb_desc.c#L1628
 
Thanks, Paul!
I had a quick look. The PJRC Unique Serial Number looks out of my wheelhouse.
As for the 16-byte NXP number... that looks useful and almost accessible.
Have you a quick reference to reading an NXP register through C++ code?
(I imagine there's scattered through the libraries)

Thanks!
 
Status
Not open for further replies.
Back
Top