Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

<install_directory>/apps/usb/device/vendor_basic/firmware/src/system_config/pic18f46j50_pim/io_mapping.h
For more information about each demo board, please refer to the Demo Board Information section.
Demo Operation
1.6.13.1 Windows
Running the demo on a Windows machine.
Description
This demo uses the selected hardware platform as a Libusb class USB device. Libusb-Win32 is a USB Library for the
Windows operating systems. The library allows user space applications to access any USB device on Windows in a generic
way without writing any line of kernel driver code. This driver allows users to have access to interrupt, bulk, and control
transfers directly.
The SimpleLibUSBDemo.exe program and the associated firmware demonstrate how to use the Libusb device drivers for
basic general purpose USB data transfer. To make the PC source code as easy to understand as possible, the demo has
deliberately been made simple, and only sends/receives small amounts of data.
Before you can run the SimpleLibUSBDemo.exe executable, you will need to have the Microsoft® .NET Framework Version
3.5 Redistributable Package (later versions probably okay, but not tested) installed on your computer. Programs which were
built in the Visual Studio® .NET languages require the .NET redistributable package in order to run. The redistributable
package can be freely downloaded from Microsoft’s website. Users of Windows Vista® operating systems will not need to
install the .NET framework, as it comes pre-installed as part of the operating system.
The source code for SimpleLibUSBDemo.exe file was created in Microsoft Visual C++® 2008 Express Edition. The source
code can be found in the “<Install Directory>\ USB Device - Libusb - Generic Driver Demo\ Libusb Simple Demo - Windows
Application\Libusb Simple Demo - PC Application - MS VC++ 2008 Express” directory. Microsoft currently distributes Visual
C++ 2008 Express Edition for free, and can be downloaded from Microsoft’s website.
To launch the application, simply double click on the executable “SimpleLIbusbDemo.exe” in the “<Install Directory>\USB
Device - Libusb - Generic Driver Demo\Windows Application” directory. A window like that shown below should appear:
If instead of this window, an error message pops up while trying to launch the application, it is likely the Microsoft .NET
Framework Version 3.5 Redistributable Package has not yet been installed. Please install it and try again.
In order to begin sending/receiving packets to the device, you must first find and “connect” to the device. As configured by
default, the application is looking for USB devices with VID = 0x04D8 and PID = 0x0204. The device descriptor in the
firmware project meant to be used with this demo uses the same VID/PID. To run the demo program the USB device with
the correct precompiled .hex file. If you are connecting the device for the first time, Windows pops up a window asking you to
install the driver for the device. When asked for the driver point it to the inf file provided along with the demo. Windows takes
while to install the driver for the USB device that is just plugged in. Open the Device manager and ensure that the USB
device is listed under the ‘Libusb Demo Devices’. Once the driver is installed hit the “Connect” button, the other pushbuttons
should become enabled. If hitting the connect button has no effect, it is likely the USB device is either not connected, or has
not been programmed with the correct firmware.
If a different VID/PID combination from the default is desired, then the descriptors in the firmware must be changed as well
as the inf file. The easiest way to change the inf file is to use the utility provided with the LibUSB download for windows on
the LibUSB website. This utility can create a new inf file based on a connected device. So make sure to change the VID/PID
combination first in the firmware, connect the device, and then run the inf file creator utility. After completing the utility, a new
1.6 Demos MLA - USB Library Help Device - Vendor Driver Basic Demo
281

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh