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 95b53c16eSMatthias 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*b5674ee2SMatthias 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 64-bit start menu item to compile 64-bit binaries. 123cda7aedSMatthias Ringwald 13*b5674ee2SMatthias RingwaldIn the MSYS2 shell, you can install everything with pacman: 143cda7aedSMatthias Ringwald 153cda7aedSMatthias Ringwald $ pacman -S git 16*b5674ee2SMatthias Ringwald $ pacman -S make 17*b5674ee2SMatthias Ringwald $ pacman -S mingw-w64-x86_64-toolchain 183cda7aedSMatthias Ringwald $ pacman -S python 195b53c16eSMatthias Ringwald $ pacman -S winpty 203cda7aedSMatthias Ringwald 213cda7aedSMatthias Ringwald## Compilation 223cda7aedSMatthias Ringwald 235b53c16eSMatthias RingwaldWith mingw64-w64 installed, just go to the port/windows-winusb directory and run make 243cda7aedSMatthias Ringwald 253cda7aedSMatthias Ringwald $ cd btstack/port/windows-winusb 263cda7aedSMatthias Ringwald $ make 273cda7aedSMatthias Ringwald 283cda7aedSMatthias Ringwald## Console Output 293cda7aedSMatthias Ringwald 30c7558746SMatthias 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: 31c7558746SMatthias Ringwald 323cda7aedSMatthias Ringwald $ winpty ./spp_and_le_counter.exe 333cda7aedSMatthias Ringwald 34