Install the certificates so that the driver is signed correctly and can run on your device. From an elevated command prompt execute the commands listed below:
cd c:\Program Files (x86)\Windows Kits\10\Tools\bin\i386
set WPDKContentRoot=c:\Program Files (x86)\Windows Kits\10
Apply fix to enable F5 deployment from VS. In the elevated command prompt, execute the following commands .
cd %TEMP% ( will change directory to c:\users\<usernsme>\Appdata\Local\Temp)
md “WdkTempFiles” Manually create a “WdkTempFiles” directory
This is a workaround for a bug in the tooling and requires to be done only once in the PC.
Step 2 : Provision device with Visual Studio
Open Visual Studio and select Driver > Test > Configure Devices > Add New Device
If the Driver Menu option is not shown, check if SDK is installed.
In the Device Configuration dialog,
Enter a user friendly Display Name for your target device
Select Device Type = Mobile
In the list displayed, sort by IP address, and find the address for the IoT device and select. If there are two entries, select the one with the non-zero GUID. Make sure the row is selected – it should highlight blue
At the bottom of the dialog are two radio buttons. Select the one which says Provision device and choose debugger settings. Select Next
On the Confgure debugger settings, set the appropriate settings. Note the following:
The MinnowBoardMax can use the network for debugging.
Use connection type Network
Select some port – default can be used
Select some key – default can be used
Select the host IP of the machine running visual studio. Do not use the autonet (169.xxx) address.
The Raspberry Pi uses serial for kernel debugging.
Connect the appropriate serial debugging cable to the PI and the host machine
Select Serial for the connection type
Fill out the rest of the parameters as appropriate for the Raspberry Pi.
The WDK, through VS, will now provision the IoT device. TAEF and WDTF will be installed on the device, and the device will be set up for kernel debugging per the settings provided above.
When complete, the device may reboot. The progress screen on the Device Configuration will provide status, and shows complete when the IoT device has completed the installation. Press Finish.
The device is now provisioned and the Device test configuration status shows Configured for driver testing
Step 3 : Configure Visual Studio driver project
Launch Visual Studio in the administrator mode and open the visual studio driver project.
Make sure the Target Platform Version matches the SDK installed on your development machine. Select Project Properties from the Solution Explorer window. Under General Configuration Properties assure that the Target Platform Version matches the SDK installed on your development computer. You can check the version of the SDK from the Control Panel > Programs > Programs and Features.
Under Project > Add New Item > Visual C++ > Windows Driver, select Package Manifest and Press Add.
Package.pkg.xml file will be added to the project. In this file, specify the Owner, Platform, Component and SubComponent tags.
Set package version number at Project Properties > PackageGen > Version. Note that everytime you need to perform a Install/Reinstall of the driver, this version number has to be incremented.
Under Project Properties > Driver Signing > Test Certificate, select test certificate (Phone OEM Test Certificate)
Go to Driver Install and select Deployment
From the Target Device Name dropdown, select the target created above in the provisioning process. Notice the two options for Install / Reinstall and Fast Reinstall. Choose an option and Click Ok.
Install / Reinstall is used for the initial installation of a driver to the target. This installs the driver package using the Windows update stack and can take several minutes. This must be used every time the INF file is changed.
Every time this option is used to install a driver after the initial installation, the package version number must be incremented
Fast Reinstall can be used once a driver has been installed, and there are no subsequent changes to the drivers INF file which affect the registry. This method bypasses the install process, shuts down all devnodes associated with the driver, copies the driver over, and restarts the devnode. This takes a few (<20) seconds.
This method is not guaranteed to succeed – If for some reason a devnode cannot be shutdown to release the driver, the operation will fail. This can be due to faulty hardware, or an initial faulty implementation of the driver. The Install/Reinstall option must be used in this case.
Your Visual Studio project is now ready to build and deploy a driver to your target device. If you are using the sample gpiokmdfdemo driver you need to generate ACPI table and copy to your target device, then follow the steps in building the driver in Visual Studio.
Step 4 : Build and deploy driver
This can be done in two ways, using the F5 key and using the Deploy option. In both ways, the driver will be built and deployed (i.e. installs it on device) and the F5 attaches the Visual Studio kernel debugger to the installed and loaded driver.
Some users prefer to use the Deploy functionality and attach a different kernel debugger, such as WinDBG or KD. This can provide more flexibility than using the VS debugger.
Right-click on the project in the solution explorer
The deployment process should proceed. The IoT device will be rebooted after deployment, and should show the “Gears” screen while installation is taking place.
Build output is in the Output Window
Deployment status is also in the output window
When Installation completes, the device will reboot again, and the VS Output screen will indicate success or failure.
From the build window, make sure that the configurations are correct – the current build arch is the same as the target device arch. This is where having the arch in the target name is valuable. The target will be displayed in the view box on the menu bar in VS on the top-middle-right.
Press F5. The target will be built, deployed, and attached to the VS Kernel Debugger.