DK5340 Config USB Driver VID, PID and Revision

Hello,

I'm using the Sample usb/CDC_ACM on the DK5340 with VSC.
I can set VID=XXXX and PID=YYYY, works fine.

But how can I set the REVISION=ZZZZ ?
So that Windows sees the revision in the driver properties
e.g. USB\VID_XXXX&PID_YYYY&REV_ZZZZ

Thanks and Regards, Stéphane

  • Hi,

    Looking at usb_descriptor.c I can find that in USBD_DEVICE_DESCR_DEFINE macro that vid, pid and bcddevice (rev) is set as:

            .idVendor = sys_cpu_to_le16((uint16_t)CONFIG_USB_DEVICE_VID),
            .idProduct = sys_cpu_to_le16((uint16_t)CONFIG_USB_DEVICE_PID),
            .bcdDevice = sys_cpu_to_le16(USB_BCD_DRN),

    From usb_ch9.c it looks like USB_BCD_DRN is set at compile time as 

    /** USB Device release number (bcdDevice Descriptor field) */
    #define USB_BCD_DRN     (USB_DEC_TO_BCD(KERNEL_VERSION_MAJOR) << 8 | \
                     USB_DEC_TO_BCD(KERNEL_VERSION_MINOR))

    So I don't really see any other way than to either modify the USBD_DEVICE_DESCR_DEFINE macro with a different .bcdDevice value, alternatively you can likely update .bcdDevice this after calling the USBD_DEVICE_DESCR_DEFINE macro.

    Kenneth

Related