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

fix(stacker): use actual serial number in usb serial number descriptor #497

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

ahiuchingau
Copy link
Contributor

@ahiuchingau ahiuchingau commented Dec 19, 2024

This PR updates the USB serial number string descriptor to correctly report the device's serial number stored in flash. This would allow us to easily identify a connected stacker without having to open up a serial connection.

We probably should consider fixing this descriptor for all of the stm32 modules at some point.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

We shouldn't #define an address like this if at all possible to avoid. We should either

  • Traceably have the same address define be used in both writing and reading the serial, so it's impossible to get out of sync
  • (preferred) define this as an extern; create a section in the linker script; set the value of the extern to the section address so it's harder to accidentally write something else on top of this

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

If this is a quick change for the demo let's just do it this way and change it later

@ahiuchingau ahiuchingau merged commit ebea32f into edge Dec 20, 2024
6 of 7 checks passed
@ahiuchingau ahiuchingau deleted the usbd_desc-serial-number branch December 20, 2024 19:35
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.

2 participants