Comments (4)
LUFA reads them out low nibble first, each nibble forming one hexadecimal digit of the serial number. The PC will them display that in MSB format, so a physical byte 0xDC will show on the PC as "DC". As the serial number is unique but opaque I though it didn't really matter how it was serialized out for the host as long as the algorithm was stable.
The device serial is effectively an internal ID code (wafer number, lot number, etc.) that is put in each device during manufacturing. I do not know the exact decoding - I didn't ask at Atmel so as not to taint my OSS efforts.
from lufa.
Hi @abcminiuser ,
Thank you so much for your reply.
What I got is a physical byte 0x57 , read from boot_signature_byte_get(), is being sent as 75 by LUFA to the PC and displayed as 75 by device manager (or any USB info software) as seen from the screen capture.
If you breakpoint at the following code from Device_AVR8.h
uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
you can see that the SerialByte is not the same as the one PC received from LUFA because the HIGH nibble and LOW nibble are in different order.
I suppose as long as the serial number is UNIQUE, it should be ok. Having said that, if we implement the current method used by LUFA to display the DEVICE ID, which is a few address above the UNIQUE SERIAL NUMBER, the physical bytes of ATMEGA16U2's DEVICE ID is
0x1E 0x94 0x89
Using LUFA's method to read LOW nibble first, the result will be
E1 49 98
which is an invalid DEVICE ID.
Cheers
JP
from lufa.
What I got is a physical byte 0x57 , read from boot_signature_byte_get(), is being sent as 75 by LUFA to the PC and displayed as 75 by device manager (or any USB info software) as seen from the screen capture.
That's correct - LUFA is backwards. I guess I didn't notice when I implemented it, and it's too late to change it now (it would change the serial number for all devices in the wild). That said, since it's an opaque byte stream as I mentioned, there's no harm done as long as all the bits are transmitted (since it will be a unique N-bit number either way).
If you want to implement this in your user code, you aren't bound to the same algorithm as the internal USB_Device_GetSerialString()
function. You can swap the nibbles as you construct the USB string descriptor in RAM so that the most significant nibble is sent as the leading digit, rather than the other way around as used by the internal LUFA serial string construction function.
from lufa.
Thanks @abcminiuser , appreciated your explanation, this clears up my question.
Keep up the good work.
from lufa.
Related Issues (20)
- Possible issue with including board specific headers HOT 3
- MassStorageBootloader: Linux (Manjaro) is not working
- Hi, what about add demo for 3 in 1 device: mouse+keyboard+mass storage ? HOT 1
- blocking mode for bulk transfers possible? HOT 1
- teensy-ee targets fail to build for BulkVendor, VirtualSerial, and others HOT 5
- USB 3.0 Support HOT 1
- Implementación LUFA a MPLAB X HOT 2
- Need help for midi
- LUFA extension Atmel Studio 7 - update for version 210130 HOT 2
- multiple buffer overflow vulnerabilities in lufa HOT 3
- Some confusions please help: LUFA code vs. atmel spec sheets HOT 3
- Configuration variables cannot be set/overridden by target specific variable values HOT 1
- Mass storage device m16u2, issues with larger size file HOT 2
- LUFA USB CDC - connection with serial application fails after disconnect and reconnect HOT 2
- HID Parser Not Returning All Collections
- Mass storage, eject/unmount detection? HOT 1
- Unknown reference to "UpdateCurrentCompatibilityMode" HOT 2
- AVRISP-MKII Clone avrdude: stk500v2_command(): error in CMD_XPROG: Timeout
- How would I go about using a USB Host sheild with LUFA?
- compile error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lufa.