This is a simple libusb-application to benchmark the USB-connection to the STM32F4-Discovery board with this firmware.
This was developed and tested on a host with Windows 10 and Visual Studio 2017. Since CMake is used for building the application and vcpck for dependency management, the application should build on hosts with Linux and recent gcc (supporting at least C++11) as well. For Linux hosts, test and updates to this description follows soon...
git clone https://github.com/pavolk/libusb_stm32_testapp.git
cd libusb_stm32_testapp
See here for the documentation on installation and getting started with vcpkg C++ package manager.
The root CMakeLists.txt will use the environment variable VCPKG_DIR to look for the vcpkg.cmake file. Set the variable VCPKG_DIR to point to the root directory of the vcpkg installation. E.g. on Windows like this
setx VCPKG_DIR=c:\Users\<usename>\vcpkg
Then just run following to install libusb to the host:
bootstrap.bat
Note: The script expects the
vcpkgto be callable from the shell, e.g. thePATHvariable should point to the root directory of thevcpkginstallation.
mkdir build
cd build
cmake ..
cmake --build . --config Debug
start libusb_stm32_testapp.sln
Supposed that a STM32F4-Discovery board with this firmware is connected to the host, then...
bin\Debug\stm32_bench.exe
... will output something like this:
Starting send_test...
ep_addr=0x1
buffer_size=4096
transfer_count=2000
Sending 8192000 bytes took 11563millis.
Output transfer-rate was 708467 bytes/sec.
Starting receive_test...
ep_addr=0x81
buffer_size=8192
transfer_count=2000
Received 1022000 bytes took 1628millis.
Input transfer-rate was 627764 bytes/sec.
Note: No driver installation is necessary, since the firmware implements a WCID device, which will make sure that the WinUsb driver is mapped to the device automatically.