1c7558746SMatthias Ringwald# BTstack Port for Windows Systems with Bluetooth Controller connected via Serial Port 2c7558746SMatthias Ringwald 3c7558746SMatthias RingwaldThe Windows-H4 port uses the native run loop and allows to use Bluetooth Controllers connected via Serial Port. 4c7558746SMatthias Ringwald 5c7558746SMatthias RingwaldMake sure to manually reset the Bluetooth Controller before starting any of the examples. 6c7558746SMatthias Ringwald 73cda7aedSMatthias Ringwald## Toolchain 83cda7aedSMatthias Ringwald 9*5b53c16eSMatthias RingwaldThe port requires a Unix-like toolchain. We successfully used [mingw-w64](https://mingw-w64.org/doku.php) to compile and run the examples. mingw64-w64 is based on [MinGW](mingw.org), 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.' 103cda7aedSMatthias Ringwald 11*5b53c16eSMatthias RingwaldWe've used the Msys2 package available from the [downloads page](https://mingw-w64.org/doku.php/download) on Windows 10, 64-bit and use the MSYS2 MinGW 32-bit start menu item to compile 32-bit binaries that run on both 32/64-bit systems. 123cda7aedSMatthias Ringwald 13*5b53c16eSMatthias RingwaldIn the MSYS2 shell, you can install git, python, and, winpty with pacman: 143cda7aedSMatthias Ringwald 153cda7aedSMatthias Ringwald $ pacman -S git 163cda7aedSMatthias Ringwald $ pacman -S python 17*5b53c16eSMatthias Ringwald $ pacman -S winpty 183cda7aedSMatthias Ringwald 193cda7aedSMatthias Ringwald## Compilation 203cda7aedSMatthias Ringwald 21*5b53c16eSMatthias RingwaldWith mingw64-w64 installed, just go to the port/windows-winusb directory and run make 223cda7aedSMatthias Ringwald 233cda7aedSMatthias Ringwald $ cd btstack/port/windows-winusb 243cda7aedSMatthias Ringwald $ make 253cda7aedSMatthias Ringwald 263cda7aedSMatthias Ringwald## Console Output 273cda7aedSMatthias Ringwald 28c7558746SMatthias 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: 29c7558746SMatthias Ringwald 303cda7aedSMatthias Ringwald $ winpty ./spp_and_le_counter.exe 313cda7aedSMatthias Ringwald 32