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

Consider baking in asset numbers #24

Open
trickeydan opened this issue Jun 13, 2019 · 3 comments
Open

Consider baking in asset numbers #24

trickeydan opened this issue Jun 13, 2019 · 3 comments

Comments

@trickeydan
Copy link
Contributor

All of our other boards (except RPi, but I'm working on that too) currently have a command which can return the asset number as the serial of the board. I suggest adding this functionality to this firmware also. This will allow students to index the board by the number that is marked on it.

To prevent having different firmwares on the various boards, I suggest programming this number into the built in EEPROM on the AtMega328. This attribute should be for most intents write-once, read-only.

Things we need to work out:

  • The mechanism to set the number into the EEPROM.
  • What command to use to retrieve the number
@kierdavis
Copy link
Member

Some approaches I can think of for writing the serial number to EEPROM:

  • Add a first-class command to the firmware to do this. This is straightforward, but prone to accidental or malicious overwrites.
  • Install a temporary alternative firmware that writes a hardcoded serial number to EEPROM. The serial number could be hardcoded into a firmware "template" by a simple script. This might be tricky to use with standard Arduino tooling.
  • Install a temporary alternative firmware that receives a new serial number over serial and writes it to EEPROM. This is probably the safest option.

write-once

Previous experience suggests this is something we might want to write more than once (albeit rarely). To be more specific, each of our power and motor boards is shortly going to receive the third asset tag it's had in its lifetime (first the alphabetical labels used during manufacture, then the current SB-00-00-00-00 asset tags and soon the new SRO-AAA-AAA asset tags).

@trickeydan
Copy link
Contributor Author

Previous experience suggests this is something we might want to write more than once (albeit rarely). To be more specific, each of our power and motor boards is shortly going to receive the third asset tag it's had in its lifetime (first the alphabetical labels used during manufacture, then the current SB-00-00-00-00 asset tags and soon the new SRO-AAA-AAA asset tags).

I should have clarified that it shouldn't be trivial to write.

A fun solution: We could add a command that accepts a signed serial number and only writes if the signature is valid. https://github.com/kmackay/micro-ecc has a nice small ECDSA implementation we could use.

@kierdavis
Copy link
Member

That would certainly be fun to implement, but probably overkill :)

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

No branches or pull requests

2 participants