Difference between revisions of "Windows"

From flashrom
Jump to: navigation, search
m
Line 1: Line 1:
Before you set up a MinGW/MSYS build environment, note that you can find snapshot downloads at  http://ra.openbios.org/~idwer/flashrom/mingw/
+
= Using flashrom on Windows =
 +
 
 +
== Requirements ==
 +
In order to use flashrom on Windows you must build it from source as explained below or just download a snapshot from [http://ra.openbios.org/~idwer/flashrom/mingw/ here].
 +
If your programmer is COM or LPT-based, there is nothing more to do, because Windows has all drivers needed. Consult the man page about options you need.
 +
 
 +
It isn't so easy for USB-based devices, because they needed special libusb-win32 driver, that must be generated and installed to make them available to flashrom executable.
 +
Because the nature of generation process, the generated driver has no digital signature and can't be installed on 64-bit Windows versions without some preparations.
 +
 
 +
== Obtaining libusb-win32 ==
 +
The required installation file can be found on [http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/ libusb-win32 project site].
 +
Please use the same version that was used for flashrom compilation. The version can be determined from snapshot file path.
 +
 
 +
Download the file named ''libusb-win32-bin-x.y.z.t.zip'' and unpack ''/libusb-win32-bin-x.y.z.t/bin'' directory from it.
 +
 
 +
== Making libusb-based driver for your device ==
 +
* Attach you USB device and click on ''Cancel'' or ''Close'' on Driver Installation Wizard window.
 +
 
 +
* Run inf-wizard.exe from unpacked ''bin'' directory. Click on ''Next''.
 +
 
 +
[[Image:Inf-Wizard-List.png]]
 +
 
 +
* Select your device from the list, click on ''Next''.
 +
 
 +
[[Image:Inf-Wizard-Settings.png]]
 +
 
 +
* Do not alter Vendor ID, Product ID and MI. You can alter Manufacturer and Device names, if you want. Click on ''Next''.
 +
 
 +
* Select the destination of newly created driver and click on Save to save it.
 +
 
 +
[[Image:Inf-Wizard-Done.png]]
 +
 
 +
* If you are using 32bit Windows version or 64bit Windows version with unsigned driver installation option enabled, click on ''Install Now...'' to install the driver.
 +
 
 +
* If you have error message instead of successful driver installation, disable the enforced driver signing and install the driver after that.
 +
 
 +
* Detach your device and attach it once again to finish the installation.
  
----
+
== Using flashrom ==
 +
After successful driver installation you can use flashrom without Administrator privileges.
 +
Consult the man page about options you need.
  
 +
= Building flashrom on Windows using MinGW/MSYS. =
  
This is a tutorial on how to build flashrom on Windows using MinGW/MSYS.
+
Before you set up a MinGW/MSYS build environment, note that you can find snapshot downloads at  http://ra.openbios.org/~idwer/flashrom/mingw/
  
 
== Requirements ==
 
== Requirements ==

Revision as of 18:05, 29 November 2012

Using flashrom on Windows

Requirements

In order to use flashrom on Windows you must build it from source as explained below or just download a snapshot from here. If your programmer is COM or LPT-based, there is nothing more to do, because Windows has all drivers needed. Consult the man page about options you need.

It isn't so easy for USB-based devices, because they needed special libusb-win32 driver, that must be generated and installed to make them available to flashrom executable. Because the nature of generation process, the generated driver has no digital signature and can't be installed on 64-bit Windows versions without some preparations.

Obtaining libusb-win32

The required installation file can be found on libusb-win32 project site. Please use the same version that was used for flashrom compilation. The version can be determined from snapshot file path.

Download the file named libusb-win32-bin-x.y.z.t.zip and unpack /libusb-win32-bin-x.y.z.t/bin directory from it.

Making libusb-based driver for your device

  • Attach you USB device and click on Cancel or Close on Driver Installation Wizard window.
  • Run inf-wizard.exe from unpacked bin directory. Click on Next.

Inf-Wizard-List.png

  • Select your device from the list, click on Next.

Inf-Wizard-Settings.png

  • Do not alter Vendor ID, Product ID and MI. You can alter Manufacturer and Device names, if you want. Click on Next.
  • Select the destination of newly created driver and click on Save to save it.

Inf-Wizard-Done.png

  • If you are using 32bit Windows version or 64bit Windows version with unsigned driver installation option enabled, click on Install Now... to install the driver.
  • If you have error message instead of successful driver installation, disable the enforced driver signing and install the driver after that.
  • Detach your device and attach it once again to finish the installation.

Using flashrom

After successful driver installation you can use flashrom without Administrator privileges. Consult the man page about options you need.

Building flashrom on Windows using MinGW/MSYS.

Before you set up a MinGW/MSYS build environment, note that you can find snapshot downloads at http://ra.openbios.org/~idwer/flashrom/mingw/

Requirements

MinGW/MSYS

In order to build flashrom and various of its dependencies, we need a UNIX-like environment on Windows, which is provided by MinGW/MSYS.

  • Download the latest version (20110530 currently) of the automated MinGW installer named mingw-get-inst (double-click the installer *.exe, which will download and install all components).
    • Make sure you enable "MinGW Compiler Suite", "C++ compiler", "MSYS Basic System", and "MinGW Developer Toolkit" in the installer.
    • For simplicity it's recommended to leave the default install location of c:\MinGW unchanged.

Now open a MinGW shell via Start/Programs/MinGW/MinGW Shell and do the following:

$ mingw-get update
$ mingw-get install msys-wget msys-unzip

libusb-win32

libftdi

  • Install libftdi. The easiest method is probably to use the libftdi-0.18_mingw32.zip binaries from here.
    • Extract the ZIP file into a temporary directory.
    • Copy dll/libftdi.dll to /usr/local/bin.
    • Copy lib/libftdi.a and lib/libftdi.dll.a to /usr/local/lib.
    • Copy include/ftdi.h to /usr/local/include.

Building flashrom

Checkout the flashrom source code from svn (e.g. using TortoiseSVN), then:

$ cd flashrom
$ make