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

feature/dfu_device_id #949

Merged
merged 4 commits into from
Jun 8, 2016
Merged

feature/dfu_device_id #949

merged 4 commits into from
Jun 8, 2016

Conversation

m-mcgowan
Copy link
Contributor

@m-mcgowan m-mcgowan commented Apr 10, 2016

Makes the device ID available via dfu, via the DCT, offset 3618, length 12.

The device ID is copied to persistent storage if the first byte is not 0xFF.

Works on the P1/Photon/Electron.
Core TBD.

The DCT contained a field "device_id" which stored a 6 digit random code. This was renamed "device_code", so we can use "device_id" for the 12 byte stm32 id.


Doneness:

  • Contributor has signed CLA
  • Problem and Solution clearly stated
  • Code peer reviewed
  • N/A API tests compiled
  • N/A Run unit/integration/application tests on device
  • Add documentation: (Need a new DFU section for the DFU memory map for the DCT region.)
  • Add to CHANGELOG.md after merging (add links to docs and issues)

@m-mcgowan m-mcgowan added this to the 0.6.x milestone Apr 10, 2016
@m-mcgowan
Copy link
Contributor Author

m-mcgowan commented Apr 26, 2016

Tests:

  • - dfu-util -d 2b04:d006 -a 1 -s 3618:12 -U device_id && xxd -g 12 device_id matches the device ID printed by particle serial identify.
    • - Photon
    • - Electron

Results:

DfuSe interface name: "DCT Flash   "
Upload  [=========================] 100%           12 bytes
Upload done.
0000000: 350031000exxxx3035353132           5.1..Q405512

Scream:electron mat1$ particle serial identify

Your device id is 350031000exxxx3035353132
Your IMEI is .....
Your ICCID is .....
Your system firmware version is 0.5.0

@@ -75,8 +75,8 @@ typedef struct __attribute__((packed)) application_dct {
uint8_t alt_device_private_key[192]; // alternative device private key
uint8_t alt_server_public_key[192];
uint8_t alt_server_address[DCT_SERVER_ADDRESS_SIZE]; // server address info

uint8_t reserved2[640];
uint8_t device_id[12]; // the STM32 device ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more accurate to say "the Particle device ID"? It's not an STM code, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are actually the same. We use standard STM32 Unique device ID register (96 bits).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added "Device electronic signature" in a comment in the appropriate HAL function since that's the STM name for the unique device ID.

@monkbroc
Copy link
Member

Reviewed. Good to merge.

@monkbroc monkbroc removed their assignment Apr 27, 2016
@m-mcgowan m-mcgowan force-pushed the feature/dfu_device_id branch from 55f8460 to eed95ca Compare June 8, 2016 01:07
@m-mcgowan m-mcgowan merged commit b4a8420 into develop Jun 8, 2016
@m-mcgowan m-mcgowan deleted the feature/dfu_device_id branch June 8, 2016 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants