Closed henrygab closed 1 year ago
as i remembered it implemented
I think after looking in the datasheet, that ID code register looks like this
As an aside, I think the "Chip ID Register" defines the type of chip for purposes of JTAG / Debugging, and is not a unique per-device identifier. The name sure sounded promising, however!
Usually people only have one proxmark3 connected. Having multiple is a more rare problem.
since it would need to be a function that works for all possible proxmark3 hardware platforms, option 1 is out. When it comes to option 2, changing every time you flash the device might generate lots of new enumerations and if you hard code a value in the firmware file it the same problem as now. option 3 is just a mix not really solves anything. option 4 might be of interest but that would ruin my little Easter egg.
Its easy to solve for a rdv4 but not for all other platforms. What we would love to have is a unique id from either the fpga or the arm chip, and use that when enumerating the serial number.
I could not find a serial number accessible programmatically from the XILINX Spartan-II datasheet, and it doesn't appear to have an OTP area, either. Therefore, I don't think the FPGA will be a source of a unique number.
If we accept that the solution will only change behavior for Proxmark3 devices that have flash enabled, we can use the flash chip's unique ID.
It's a compile-time options, which simplifies the logic of creating the string descriptors. And the worst-case scenario is that the flash chip doesn't have a unique number, in which case it's no less unique than what's currently done.
Would you consider a PR which enables unique serial numbers only when compiled with WITH_FLASH
defined?
The flashchip has unique ID, we can start with adding this functionality for devices with flash memory..
The call to flash unique id fct will need to be preceeded with flash init call to set it up...
If I remember this correct, there where a thing... there the serial number had to be of a certain length
It must not be a tuple of 8... which 48 is...
May I suggest we add an extra _
underscore?
May I suggest we add an extra
_
underscore?
Absolutely! I'll write up a PR. I am already successfully using this myself; chip reports as Winbond / 0x13.
OK, the PR is ready for additional hardware testing. I was confident enough to load it onto my PM3 Easy devices, without having a JTAG adapter on hand for that 0.05" header. I do not have an RDV4 at the moment, and have no access to the iCopyX. So, if you have those around, and willing to test on those hardware, it'd be much appreciated.
I'm going to verify, but I think this may also bring stability for COM port assignment, which will be awesome.
it will be a stepup for the people who uses two or more devices :)
Alrighty then,
I have now tested with 4 devices connected to the same usb hub on Win11. Three RDV4 w unique serial and one generic device which has serial "iceman".
Findings,
hw status
on them nicely. All on all, I would say its a good addition.
Lets see if I can find my macbook and test
Awesome! I had hoped/expected each of these things, and saw most of them during my own testing. I am especially happy with the reduced enumeration time (it caused other issues).
User Impact
The invalid USB descriptors force Windows to workaround the device error. This workaround results in ~5 seconds enumeration delay. That enumeration delay caused other, extremely difficult-to-triage failures.
As a concrete example, this bug prevented me from attaching two Proxmark3 devices to WSL2 via USBIPD. Root caused via the following thread: https://github.com/dorssel/usbipd-win/issues/452#issuecomment-1365481288.
Because it's so difficult to triage, I recommend fixes at the end
Describe the bug The firmware uses a hard-coded serial number. This causes problems when connecting more than one Proxmark3 device to a single computer. It should not expose a serial number in the USB descriptors, unless the serial number is unique for that VID/PID.
To Reproduce Steps to reproduce the behavior:
Expected behavior Enumeration and exposure of COM port occurs quickly.
Actual behavior USB devices should NOT have identical VID + PID + ManufacturerString + ProductString + Serial Number. This breaks the implied uniqueness of having an exposed serial number.
Windows appears to have a workaround, where it totally prevents reading the serial number of 2nd (and later) devices that are plugged in ... but the workaround happens to add ~5 second delay to enumeration.
Other operating systems may not fail as gracefully, or exhibit unusual or unexpected side-effects. It's just a bad idea....
Desktop (please complete the following information):
Additional context
It is better to exclude the serial number, forcing the operating system to dynamically assign the device a unique ID, than to pretend that the device has (and exposes) its own unique ID.
As it is, Windows will dynamically assign the device ID to the 2nd (and later) devices. The first device attached will show its serial number. But, that depends on the order the devices appear to the OS, and thus is not reliable.
Suggested Fix
Choose one of the following: