Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    Unique ID for device detection.

    Spresense
    5
    7
    11168
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • heysadboy
      heysadboy last edited by

      I was wondering if I can get a unique ID for the device to register them in the cloud etc.
      Although there is a unique ID for microcontroller and EEPROM but I am thinking if there is any for the device itself.

      1 Reply Last reply Reply Quote
      • TE-KarlKomierowski
        TE-KarlKomierowski DeveloperWorld last edited by

        Hi @heysadboy

        I will have to investigate and comeback to you.
        But would it be a problem for you creating a file in the filesystem with a number that you generate?

        BR

        1 Reply Last reply Reply Quote
        • heysadboy
          heysadboy last edited by

          That is a nice idea. However, I am looking for something set up at the factory. I am not a security expert but my idea is to identify the device uniquely for initial authentication etc.

          I found that I can have a microcontroller ID to identify the device. I was thinking to put something on the flash memory of the device but it might be tempered...

          If there is any document where I can read more about the security of sony spresense please guide me I will be very grateful to you.

          1 Reply Last reply Reply Quote
          • K
            Koizumi last edited by

            Hi @heysadboy

            Chip has Unique ID. And your application can get it by calling board_uniqueid().
            To call that, you need to include "board.h" on your c source file.

            Please try it.

            BR

            1 Reply Last reply Reply Quote
            • M
              m Lewis last edited by

              Please make the board Unique ID available from the Arduino support library, or provide a working example showing how to use it from Arduino.
              Thank you

              K 1 Reply Last reply Reply Quote
              • K
                KamilTomaszewski DeveloperWorld @m Lewis last edited by

                @m-Lewis

                Below is the code that shows how to get board unique ID using Arduino:

                #include <sys/boardctl.h>
                
                void setup() {
                  uint8_t raw_id[CONFIG_BOARDCTL_UNIQUEID_SIZE];
                  Serial.begin(115200);
                
                  boardctl(BOARDIOC_UNIQUEID, (uintptr_t) raw_id);
                  for (int i = 0; i < CONFIG_BOARDCTL_UNIQUEID_SIZE; i++) {
                    Serial.print(raw_id[i], HEX);
                  }
                }
                
                void loop() {
                }
                
                1 Reply Last reply Reply Quote
                • M
                  m Lewis last edited by

                  Kamil,
                  Yes, using boardctl() does work and provides the UniqueID from Arduino. Thank you! 👍 I guess <sys/boardctl.h> is included in one of my other includes since I didn't need it.
                  M.Lewis

                  1 Reply Last reply Reply Quote
                  • First post
                    Last post
                  Developer World
                  Copyright © 2021 Sony Group Corporation. All rights reserved.
                  • Contact us
                  • Legal