Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Zephyr should provide a unique id interface #9711

Closed
therealprof opened this issue Aug 29, 2018 · 5 comments
Closed

RFC: Zephyr should provide a unique id interface #9711

therealprof opened this issue Aug 29, 2018 · 5 comments
Labels
Feature A planned feature with a milestone

Comments

@therealprof
Copy link
Contributor

Many (most?) MCUs provide some unique serial or ID factory programmed into the chip which could (and often should) be used to derive constant serial numbers, device identifiers, hostnames, MAC addresses etc. from.

At the moment applications and the kernel chose various details internally (e.g. hostname == board name, MAC address hardcoded or random, serial number hardcoded or application specifically read from non-volatile storage) which is neither portable nor comfortable nor does it allow the same application to run on different devices and represent themselves as such out-of-the-box and hence should be addressed.

There should be a driver interface which allows writing drivers which can obtain the device specific serialisation information and present it to the kernel. Examples for such drivers would be:

  • MCU specific unique ID registers
  • Dedicated serial number and security chips via I/O
  • Vendor generated serialisation information in PROM or Flash
  • Randomly generated
  • Hardcoded via config
  • Bootloader passthrough

There should also be an API in the kernel which allows to retrieve that information in various useful formats, e.g.:

  • binary bytes
  • hexadecimal string representation
  • UUID
  • 32/64/128 bit values via integral types

And of course other interfaces and sample application should be adapted to use the unique id interface instead of guessing/hardcoding values or introducing their own way of configuration.

@nashif nashif added the Feature Request A request for a new feature label Aug 29, 2018
@otavio
Copy link
Contributor

otavio commented Aug 30, 2018

We are doing it too, for updatehub support. Having a common way to do it does make a lot of sense.

@therealprof
Copy link
Contributor Author

CC #12372

@aurel32
Copy link
Collaborator

aurel32 commented Mar 6, 2019

Now that the hwinfo support has been merged, I guess this can be closed, correct?

@therealprof
Copy link
Contributor Author

@aurel32 Well, it certainly would help if there was a bit more API around that to make it generally usable. I wouldn't say this is fully achieved as long as every application is identifying the device by it's model number.

@carlescufi carlescufi added Feature A planned feature with a milestone and removed Feature Request A request for a new feature labels Mar 17, 2020
@carlescufi
Copy link
Member

This is done, see hwinfo API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A planned feature with a milestone
Projects
None yet
Development

No branches or pull requests

5 participants