xref: /btstack/port/windows-winusb-intel/README.md (revision 05030944b6707e1b76ff2592ce80da8cde7d43d6)
134fd36daSMatthias Ringwald# BTstack Port for Windows Systems with Intel Wireless 8260/8265 Controllers
2f61339eaSMatthias Ringwald
3f61339eaSMatthias RingwaldSame as port/windows-winusb, but customized for Intel Wireless 8260 and 8265 Controllers.
4f61339eaSMatthias RingwaldThese controller require firmware upload and configuration to work. Firmware and config is downloaded from the Linux firmware repository.
5f61339eaSMatthias Ringwald
698918ebdSMatthias RingwaldThe port provides both a regular Makefile as well as a CMake build file. It uses native Win32 APIs for file access and does not require the Cygwin or mingw64 build/runtine. All examples can also be build with Visual Studio 2022 (e.g. Community Edition).
798918ebdSMatthias Ringwald
898918ebdSMatthias Ringwald
9f61339eaSMatthias Ringwald## Access to Bluetooth USB Dongle with Zadig
10f61339eaSMatthias Ringwald
11d1b9b38fSMatthias RingwaldTo allow WinUSB to access an USB Bluetooth dongle, you need to install a special device driver to make it accessible to user space processes.
12f61339eaSMatthias Ringwald
13f61339eaSMatthias RingwaldIt works like this:
14f61339eaSMatthias Ringwald
15f61339eaSMatthias Ringwald-  Download [Zadig](http://zadig.akeo.ie)
16f61339eaSMatthias Ringwald-  Start Zadig
17f61339eaSMatthias Ringwald-  Select Options -> “List all devices”
18f61339eaSMatthias Ringwald-  Select USB Bluetooth dongle in the big pull down list
19d1b9b38fSMatthias Ringwald-  Select WinUSB in the right pull down list
20f61339eaSMatthias Ringwald-  Select “Replace Driver”
21f61339eaSMatthias Ringwald
22d1b9b38fSMatthias Ringwald![Zadig showing CYW20704A2](zadig-cyw20704.png)
23d1b9b38fSMatthias Ringwald
24d1b9b38fSMatthias RingwaldAfter the new driver was installed, your device is shown in the Device Manager with Device Provider 'libwdi'
25d1b9b38fSMatthias Ringwald
26d1b9b38fSMatthias Ringwald![Device Manager showing CYW20704A2](device-manager-cyw20704.png)
27d1b9b38fSMatthias Ringwald
2898918ebdSMatthias Ringwald## Visual Studio 2022
29f61339eaSMatthias Ringwald
30*05030944SMatthias RingwaldVisual Studio can directly open the provided `port/windows-winusb-intel/CMakeLists.txt` and allows to compile and run all examples.
31f61339eaSMatthias Ringwald
3298918ebdSMatthias Ringwald## mingw64
3398918ebdSMatthias Ringwald
3498918ebdSMatthias RingwaldIt can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
3598918ebdSMatthias Ringwaldmingw64-w64 is based on [MinGW](https://en.wikipedia.org/wiki/MinGW), which '...provides a complete Open Source programming tool set which is suitable for the development of native MS-Windows applications, and which do not depend on any 3rd-party C-Runtime DLLs.'
36f61339eaSMatthias Ringwald
379085f7a5SMatthias RingwaldIn the MSYS2 shell, you can install everything with pacman:
38f61339eaSMatthias Ringwald
39f61339eaSMatthias Ringwald    $ pacman -S git
409085f7a5SMatthias Ringwald    $ pacman -S cmake
419085f7a5SMatthias Ringwald    $ pacman -S make
429085f7a5SMatthias Ringwald    $ pacman -S mingw-w64-x86_64-toolchain
439085f7a5SMatthias Ringwald    $ pacman -S mingw-w64-x86_64-portaudio
44f61339eaSMatthias Ringwald    $ pacman -S python
45f61339eaSMatthias Ringwald    $ pacman -S winpty
46f61339eaSMatthias Ringwald
479085f7a5SMatthias Ringwald### Compilation with CMake
48f61339eaSMatthias Ringwald
499085f7a5SMatthias RingwaldWith mingw64-w64 installed, just go to the port/windows-h4 directory and use CMake as usual
50f61339eaSMatthias Ringwald
519085f7a5SMatthias Ringwald    $ cd port/windows-h4
529085f7a5SMatthias Ringwald    $ mkdir build
539085f7a5SMatthias Ringwald    $ cd build
549085f7a5SMatthias Ringwald    $ cmake ..
55f61339eaSMatthias Ringwald    $ make
56f61339eaSMatthias Ringwald
570af1bfd9SMatthias RingwaldNote: When compiling with msys2-32 bit and/or the 32-bit toolchain, compilation fails
580af1bfd9SMatthias Ringwaldas `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolchain for now.
590af1bfd9SMatthias Ringwald
60f61339eaSMatthias Ringwald## Console Output
61f61339eaSMatthias Ringwald
62f61339eaSMatthias RingwaldWhen running the examples in the MSYS2 shell, the console input (via btstack_stdin_support) doesn't work. It works in the older MSYS and also the regular CMD.exe environment. Another option is to install WinPTY and then start the example via WinPTY like this:
63f61339eaSMatthias Ringwald
6498918ebdSMatthias Ringwald    $ winpty ./gatt_counter.exe
65f61339eaSMatthias Ringwald
6698918ebdSMatthias RingwaldThe packet log will be written to hci_dump.pklg
67