[FwUpdateCfu] Fix broken PID/VID filtering in FwUpdateCfu::GetVersion method#64
Open
forderud wants to merge 1 commit into
Open
[FwUpdateCfu] Fix broken PID/VID filtering in FwUpdateCfu::GetVersion method#64forderud wants to merge 1 commit into
forderud wants to merge 1 commit into
Conversation
… method Fixes microsoft#63. I'm struggling to get FwUpdateCfu.exe version protocolCfgExample.cfg to work against the CfuVirtualHid driver in this repo. The main problem appear to be faulty VID/PID filtering in the FwUpdateCfu::GetVersion method where the method looks for either a VID_xxxx&PID_yyyy or VID_xxxx substring in the DevicePath. The observed DevicePath for CfuVirtualHid on my test machine is \\?\HID#HID_DEVICE_SYSTEM_VHF#2&b84b253&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, which doesn't contain the VID or PID. The VID/PID filtering mechanism therefore appear to be flawed to me. I think the VID/PID filtering should instead be performed against a HIDD_ATTRIBUTES struct obtained through HidD_GetAttributes after opening the device.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Sep 26, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match the virtual HID device (CfuVirtualHid): * Change PID to match virtual HID device. * Change USAGEPAGE to match virtual HID device. * Change USAGECOLLECTION to match virtual HID device. * Changed VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE in device.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Sep 26, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match virtual HID device (CfuVirtualHid) defines: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Oct 1, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match virtual HID device (CfuVirtualHid) defines: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Oct 2, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match virtual HID device (CfuVirtualHid) defines: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Oct 2, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match virtual HID device (CfuVirtualHid) defines: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Oct 3, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device (CfuVirtualHid) found in this repo. This PR seeks to fix this, so that the config file works out-of-the-box if used together with the PID/VID filtering fix in microsoft#64. Changes to match CfuVirtualHid defines: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
forderud
added a commit
to forderud/CFU
that referenced
this pull request
Oct 3, 2024
The FwUpdateCfu config file is currently unable to detect & query version for the virtual HID device found in this repo (CfuVirtualHid). This PR seeks to fix this, so that the tool can at least query FW version. The PR require the PID/VID filtering fix in microsoft#64 to be merged first. Impact to functionality: * "FwUpdateCfu.exe version protocolCfgExample.cfg" is now able to successfully query FW version. * "FwUpdateCfu.exe update protocolCfgExample.cfg CfuVirtualHidDevice_MCU.offer.bin CfuVirtualHidDevice_MCU.payload.bin" still fails (not a regression in this PR). This will need to be addressed later. Changes to match defines in the CfuVirtualHid driver: * Change PID to match PRODUCT_ID. * Change USAGEPAGE to match CFU_DEVICE_USAGE_PAGE. * Change USAGECOLLECTION to match CFU_DEVICE_USAGE. * Change VERSION_FEATURE_USAGE to match VERSIONS_FEATURE_USAGE.
This was referenced Oct 3, 2024
Author
|
@samtertzakian @SurfaceDMFUser1 Not sure who to contact, so I'm reaching out to you as most active contributors to the repo. Would it be possible for one of you or other project maintainer to take a look at this and the other PR's I've submitted? The reason for submitting PR's is that I want to asses CFU as FW upgrade mechanism for a custom HW project. I then first need the sample projects up&running, so that I have a working starting point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #63. I'm struggling to get
FwUpdateCfu.exe version protocolCfgExample.cfgto work against theCfuVirtualHiddriver in this repo.The main problem appear to be faulty VID/PID filtering in the
FwUpdateCfu::GetVersionmethod where the method looks for either aVID_xxxx&PID_yyyyorVID_xxxxsubstring in theDevicePath. The observedDevicePathforCfuVirtualHidon my test machine is\\?\HID#HID_DEVICE_SYSTEM_VHF#2&b84b253&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, which doesn't contain the VID or PID.The VID/PID filtering mechanism therefore appear to be flawed to me. I think the VID/PID filtering should instead be performed against a
HIDD_ATTRIBUTESstruct obtained throughHidD_GetAttributesafter opening the device.