-
Notifications
You must be signed in to change notification settings - Fork 86
Serialnumber regex fix #43
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
Conversation
Atmel uses the prefix "ATML" in the serial number string.
|
@mvolstad Please remove test part from your PR, it is breaking Ci. |
This reverts commit d37dc00.
|
@PrzemekWirkus Thanks, I have reverted the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is illegal here. We are searching for target id which is specified as hex ascii string. For example:
usb-MBED_microcontroller_02400226489a1e6c000000000000000000000000b543e3d4-0:0 -> ../../sdb
has a valid 02400226489a1e6c000000000000000000000000b543e3d4 Target ID.
In your case ATML2127031800007973 is illegal (^ATML characters are illegal) target id. In any case, does your device have a mbed.htm file on MSD of interface chip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: four first characters define manufacturer_ids.
If you wish to detect correctly your devices, e.g. XPRO_SAM you have to make sure that your target id in USB ID starts with a proper substring, you XPRO case e.g. 0900 will be mapped to XPRO_SAMR21.
So any target id like '''0900deadcodedeadcodedeadcode``` will work!
|
Yes, we do have an mbed.htm file. This is an example of the redirect URL: http://mbed.org/device/?code=0900030841544d4c32313237303331383030303037393733d10b The problem is that the part after the version is expected to be the ASCII encoding of the USB serial number ("41544d4c32313237303331383030303037393733" = "ATML2127031800007973"). You're right that the USB mass storage class specifies the serial number to be hexadecimal. However, we haven't seen any practical limitations any other places than in mbed-ls. We would prefer to keep the serial number scheme we already have had in place before implementing MSC support. This pull request introduces a reasonable leniency. |
|
@mvolstad I did not forget about you :P I just had no time to look closer to it. |
|
I see this change as minor leniency in detecting mbed devices since detection still largely based on vendor Id and |
Proposed fix for: Serial number regex not allowing non-hex characters #41