Ports and Interfaces > USB
Is bcdDevice v1.23 or v1.2.3?
(1/1)
jb:
If bcdDevice is 0x0103
macOS System Report displays it as "Version: 1.03"
NirSoft USBDeview displays it as "1.03"
But I thought it was conceptually "1.0.3".
USB 3.2 spec says
--- Quote ---The bcdUSB field contains a BCD version number. The value of the bcdUSB field is 0xJJMN for version JJ.M.N (JJ – major version number, M – minor version number, N – sub-minor version number), e.g., version 2.1.3 is represented with value 0213H and version 3.0 is represented with a value of 0300H.
--- End quote ---
and Beyond Logic says
--- Quote ---The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number.
--- End quote ---
--- Quote ---The bcdDevice has the same format than the bcdUSB and is used to provide a device version number.
--- End quote ---
Jan Axelson:
The spec is the final authority. 1.0.3 is correct.
jb:
Well the spec doesn't explicitly say "bcdDevice uses the same format as bcdUSB" that I can find. It just says "binary-coded decimal". Beyond Logic says they're the same format, but isn't official.
Also found XMOS document that says
--- Quote ---BCD_DEVICE Description Device firmware version number in Binary Coded Decimal format: 0xJJMN where JJ: major, M: minor, N: sub-minor version number. ... Default: XMOS USB Audio Release version (e.g. 0x0651 for 6.5.1).
--- End quote ---
bpaddock:
The LUFA project uses this:
https://github.com/abcminiuser/lufa/blob/master/LUFA/Drivers/USB/Core/StdDescriptors.h
/** Macro to encode a given major/minor/revision version number into Binary Coded Decimal format for descriptor
* fields requiring BCD encoding, such as the USB version number in the standard device descriptor.
*
* \note This value is automatically converted into Little Endian, suitable for direct use inside device
* descriptors on all architectures without endianness conversion macros.
*
* \param[in] Major Major version number to encode.
* \param[in] Minor Minor version number to encode.
* \param[in] Revision Revision version number to encode.
*/
#define VERSION_BCD(Major, Minor, Revision) \
CPU_TO_LE16( ((Major & 0xFF) << 8) | \
((Minor & 0x0F) << 4) | \
(Revision & 0x0F) )
Jan Axelson:
Lacking any evidence to the contrary in the specs, I believe it is safe to assume that both "bcd" fields use the same format.
Navigation
[0] Message Index
Go to full version