xref: /btstack/port/windows-winusb-intel/README.md (revision 98918ebd93a53d7aa0542734869acf064936895c)
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
6*98918ebdSMatthias 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).
7*98918ebdSMatthias Ringwald
8*98918ebdSMatthias Ringwald
9f61339eaSMatthias Ringwald## Access to Bluetooth USB Dongle with Zadig
10f61339eaSMatthias Ringwald
11f61339eaSMatthias RingwaldTo allow libusb or 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
19f61339eaSMatthias Ringwald-  Select WinUSB (libusb) in the right pull pull down list
20f61339eaSMatthias Ringwald-  Select “Replace Driver”
21f61339eaSMatthias Ringwald
22*98918ebdSMatthias Ringwald## Visual Studio 2022
23f61339eaSMatthias Ringwald
24*98918ebdSMatthias RingwaldVisual Studio can directly open the provided `port/windows-windows-h4-zephyr/CMakeLists.txt` and allows to compile and run all examples.
25f61339eaSMatthias Ringwald
26*98918ebdSMatthias Ringwald## mingw64
27*98918ebdSMatthias Ringwald
28*98918ebdSMatthias RingwaldIt can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
29*98918ebdSMatthias 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.'
30f61339eaSMatthias Ringwald
31f61339eaSMatthias RingwaldIn the MSYS2 shell, you can install git, python, and, winpty with pacman:
32f61339eaSMatthias Ringwald
33f61339eaSMatthias Ringwald    $ pacman -S git
34f61339eaSMatthias Ringwald    $ pacman -S python
35f61339eaSMatthias Ringwald    $ pacman -S winpty
36f61339eaSMatthias Ringwald
37f61339eaSMatthias Ringwald## Compilation
38f61339eaSMatthias Ringwald
39*98918ebdSMatthias RingwaldWith mingw64-w64 installed, just go to the port/windows-winusb-intel directory and run make
40f61339eaSMatthias Ringwald
41f61339eaSMatthias Ringwald    $ cd btstack/port/windows-winusb
42f61339eaSMatthias Ringwald    $ make
43f61339eaSMatthias Ringwald
440af1bfd9SMatthias RingwaldNote: When compiling with msys2-32 bit and/or the 32-bit toolchain, compilation fails
450af1bfd9SMatthias Ringwaldas `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolchain for now.
460af1bfd9SMatthias Ringwald
47f61339eaSMatthias Ringwald## Console Output
48f61339eaSMatthias Ringwald
49f61339eaSMatthias 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:
50f61339eaSMatthias Ringwald
51*98918ebdSMatthias Ringwald    $ winpty ./gatt_counter.exe
52f61339eaSMatthias Ringwald
53*98918ebdSMatthias RingwaldThe packet log will be written to hci_dump.pklg
54