Obtain unique machine ID of Tx1


Recently I am working on some encryption work on Tx1, which require an unique machine ID of tx1 to generate the authorize license. Currently, I can only get the MAC address of the tx1, which can be easily modified. I want to get an unique hardware ID which cannot be modified, any one have some idea about this? As far as I know, on PC, usually we can use the BIOS identifier, disk driver id or motherboard ID combined to generate the machine ID…

You may get it from fuse.
Check this kernel function:

unsigned long long tegra_chip_uid(void) {...} 
in $TOP/kernel/drivers/misc/tegra-fuse/tegra210_fuse_offsets.h

thanks Honey_Patouceul for point out the kernel function.
you could refer to this topic for more details: https://devtalk.nvidia.com/default/topic/996988/

Hi Honey_Patouceul,

Thank your for your opinion. I have download the kernel source code, but I don’t know how to use it. When I include the header in my code, there are some errors that cannot find some other kernel headers. Do I need to compile the full kernel to use this function? Besides, I only need this single one function in my project, is it possible to compile this function to a lib and use it in my code?


There are detailed instructions for building kernel in document Tegra Linux Driver Package Development Guide 27.1 Release that you may download from NVIDIA developer site. See section Advanced Setup and Customization/Building the NVIDIA Kernel.
This R27.1 is for TX2, for TX1 I don’t know if the equivalent document for R24 has same information.
You may have to translate some TX2 specific into TX1.
[EDIT: for TX1: http://developer.nvidia.com/embedded/dlc/l4t-documentation-24-2-1. See this thread: https://devtalk.nvidia.com/default/topic/1008437/jetson-tx1/how-to-compile-and-install-nvidia-kernel-on-tx1/post/5146630/#5146630]

Once you’ll be able to run your own kernel, the easiest way might be to add a sysfs node that you would just read from userland as a file and the read would provide the string. The node is just like a file, you could access it from shell with cat.

You may find many examples of adding a sysfs node in kernel from the web.
On read (by a user application), the kernel would call kernel function tegra_chip_uid(), and convert result from kernel space to userland into read buffer.

[EDIT: It is also convenient in recent L4T versions to use sysfs.]