Forum Rule: Always post complete source code & details to reproduce any issue!
-
Senior Member
Adding a Unique identifying number to a Teensy device
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!
-
Senior Member
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/co...b_desc.c#L1628
-
Senior Member
Sweet!
I'll dig in.
Thanks, Paul!
-
Senior Member
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!
-
-
Senior Member
Thanks! That looks just right !
-
Senior Member
Here is another related thread.
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules