Link to the official repository
###Objectives
- provide open-source(Lesser GPL3) usb host library for embedded devices
- execution speed. This library doesn't use blocking sleep, making low overhead on runtime performance
- use static allocation for all of its buffers. This means no allocation and reallocation is affecting performance (possibility of memory fragmentation. execution time indeterminism). No malloc(), realloc(), free()
- do not depend on any operating system
- stm32f4discovery
- HUB
- Gamepad - XBox compatible Controller
- Generic Human Interface driver: mouse, keyboard (raw data)
- USB MIDI devices (raw data + note on/off)
Make sure the following prerequisities are installed to be able to compile this library
- git for libopencm3 submodule fetch
- gcc-arm-none-eabi toolchain for cross compilation
- cmake
- ccmake (optional)
- openocd (optional)
- go to build directory located in the root of the project
cd build
- compile demo and the library with the default options set
cmake .. && make
Executable demo is placed into build/demo.hex
.
Library is placed into build/src/libusbhost.a
.
cmake initial cache variables
Cache variable | Value | Description |
---|---|---|
USE_STM32F4_FS | TRUE | Enable STM32F4 Full Speed USB host peripheral |
USE_STM32F4_HS | TRUE | Enable STM32F4 High Speed USB host peripheral |
USE_USART_DEBUG | TRUE | Enable writing of the debug information to USART6 |
OOCD_INTERFACE | "stlink-v2" | Interface configuration file used by the openocd |
OOCD_BOARD | "stm32f4discovery" | Board configuration file used by the openocd |
- Graphical user interface
ccmake ..
- Command line interface
cmake .. -D{VARIABLE}={VALUE}
If the openocd is installed, make flash
executed in the build directory
flashes the build/demo.hex
to the stm32f4discovery board.
The following table represents the configuration of the debug output
GPIO | GPIOC6 |
---|---|
USART periphery | USART6 |
Function | UART TX |
Baud rate | 921600 |
Uart mode | 8N1 |
The libusbhost code is released under the terms of the GNU Lesser General Public License (LGPL), version 3 or later.
See COPYING.GPL3 and COPYING.LGPL3 for details.