port: mention Visual Studio in windows ports

This commit is contained in:
Matthias Ringwald 2022-06-13 22:39:53 +02:00
parent e111ffb107
commit 98918ebd93
6 changed files with 69 additions and 31 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
### Added
- port: CMake build files in all windows-* ports allow to use Visual Studio 2022
### Fixed

View File

@ -10,11 +10,18 @@ For production use, the HCI firmware could be flashed into the OTP and the firmw
Tested with the official DA14585 Dev Kit Basic on OS X and Windows 10.
## Toolchain
The 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).
The 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](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.'
## Visual Studio 2022
We'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.
Visual Studio can directly open the provided `port/windows-windows-h4-da14585/CMakeLists.txt` and allows to compile and run all examples.
## mingw64
It can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
mingw64-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.'
We've used the Msys2 package available from the [downloads page](https://www.mingw-w64.org/downloads/) on Windows 10, 64-bit and use the MSYS2 MinGW 64-bit start menu item to compile 64-bit binaries.
In the MSYS2 shell, you can install everything with pacman:
@ -24,11 +31,11 @@ In the MSYS2 shell, you can install everything with pacman:
$ pacman -S python
$ pacman -S winpty
## Compilation
### Compilation
With mingw64-w64 installed, just go to the port/windows-winusb directory and run make
With mingw64-w64 installed, just go to the port/windows-h4-da14585 directory and run make
$ cd btstack/port/windows-winusb
$ cd port/windows-h4-da14585
$ make
Note: When compiling with msys2-32 bit and/or the 32-bit toolchain, compilation fails
@ -38,4 +45,6 @@ as `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolch
When 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:
$ winpty ./spp_and_le_counter.exe
$ winpty ./gatt_counter.exe
The packet log will be written to hci_dump.pklg

View File

@ -1,8 +1,10 @@
# BTstack Port for Windows Systems with Zephyr-based Controller
The main difference to the regular posix-h4 port is that that the Zephyr Contoller uses 1000000 as baud rate.
The main difference to the regular windows-h4 port is that that the Zephyr Contoller uses 1000000 as baud rate.
In addition, the port defaults to use the fixed static address stored during production.
The 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).
## Prepare Zephyr Controller
Please follow [this](https://devzone.nordicsemi.com/blogs/1059/nrf5x-support-within-the-zephyr-project-rtos/) blog post about how to compile and flash `samples/bluetooth/hci_uart` to a connected nRF5 dev kit.
@ -28,11 +30,14 @@ In short: you need to install an arm-none-eabi gcc toolchain and the nRF5x Comma
To set the serial port of your Zephyr Controller, you can either update config.device_name in main.c or
always start the examples with the correct `-u COMx` option.
## Toolchain
## Visual Studio 2022
The 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](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.'
Visual Studio can directly open the provided `port/windows-windows-h4-zephyr/CMakeLists.txt` and allows to compile and run all examples.
We'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.
## mingw64
It can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
mingw64-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.'
In the MSYS2 shell, you can install everything with pacman:
@ -44,16 +49,18 @@ In the MSYS2 shell, you can install everything with pacman:
## Compile Examples
With mingw64-w64 installed, just go to the port/windows-h4-zephyr directory and run make
$ cd btstack/port/windows-h4-zephyr
$ make
Note: When compiling with msys2-32 bit and/or the 32-bit toolchain, compilation fails
as `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolchain for now.
## Run example
## Console Output
Just run any of the created binaries, e.g.
When 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:
$ ./le_counter
The packet log will be written to /tmp/hci_dump.pklg
$ winpty ./gatt_counter.exe
The packet log will be written to hci_dump.pklg

View File

@ -4,11 +4,18 @@ The Windows-H4 port uses the native run loop and allows to use Bluetooth Control
Make sure to manually reset the Bluetooth Controller before starting any of the examples.
## Toolchain
The 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).
The 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](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.'
## Visual Studio 2022
We'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.
Visual Studio can directly open the provided `port/windows-windows-h4/CMakeLists.txt` and allows to compile and run all examples.
## mingw64
It can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
mingw64-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.'
We've used the Msys2 package available from the [downloads page](https://www.mingw-w64.org/downloads/) on Windows 10, 64-bit and use the MSYS2 MinGW 64-bit start menu item to compile 64-bit binaries.
In the MSYS2 shell, you can install everything with pacman:
@ -18,11 +25,11 @@ In the MSYS2 shell, you can install everything with pacman:
$ pacman -S python
$ pacman -S winpty
## Compilation
### Compilation
With mingw64-w64 installed, just go to the port/windows-winusb directory and run make
With mingw64-w64 installed, just go to the port/windows-h4 directory and run make
$ cd btstack/port/windows-winusb
$ cd port/windows-h4
$ make
Note: When compiling with msys2-32 bit and/or the 32-bit toolchain, compilation fails
@ -32,5 +39,7 @@ as `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolch
When 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:
$ winpty ./spp_and_le_counter.exe
$ winpty ./gatt_counter.exe
The packet log will be written to hci_dump.pklg

View File

@ -3,6 +3,9 @@
Same as port/windows-winusb, but customized for Intel Wireless 8260 and 8265 Controllers.
These controller require firmware upload and configuration to work. Firmware and config is downloaded from the Linux firmware repository.
The 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).
## Access to Bluetooth USB Dongle with Zadig
To 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.
@ -16,11 +19,14 @@ It works like this:
- Select WinUSB (libusb) in the right pull pull down list
- Select “Replace Driver”
## Toolchain
## Visual Studio 2022
The 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](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.'
Visual Studio can directly open the provided `port/windows-windows-h4-zephyr/CMakeLists.txt` and allows to compile and run all examples.
We'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.
## mingw64
It can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
mingw64-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.'
In the MSYS2 shell, you can install git, python, and, winpty with pacman:
@ -30,7 +36,7 @@ In the MSYS2 shell, you can install git, python, and, winpty with pacman:
## Compilation
With mingw64-w64 installed, just go to the port/windows-winusb directory and run make
With mingw64-w64 installed, just go to the port/windows-winusb-intel directory and run make
$ cd btstack/port/windows-winusb
$ make
@ -42,5 +48,6 @@ as `conio.h` seems to be mission. Please use msys2-64 bit with the 64-bit toolch
When 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:
$ winpty ./spp_and_le_counter.exe
$ winpty ./gatt_counter.exe
The packet log will be written to hci_dump.pklg

View File

@ -2,6 +2,8 @@
The Windows-WinUSB port uses the native run loop and WinUSB API to access a USB Bluetooth dongle.
The 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).
## Access to Bluetooth USB Dongle with Zadig
To 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.
@ -15,11 +17,14 @@ It works like this:
- Select WinUSB (libusb) in the right pull pull down list
- Select “Replace Driver”
## Toolchain
## Visual Studio 2022
The 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](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.'
Visual Studio can directly open the provided `port/windows-windows-h4-zephyr/CMakeLists.txt` and allows to compile and run all examples.
We'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.
## mingw64
It can also be compiles with a regular Unix-style toolchain like [mingw-w64](https://www.mingw-w64.org).
mingw64-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.'
In the MSYS2 shell, you can install everything with pacman: