Giter VIP home page Giter VIP logo

stm32winusb's Introduction

STM32WINUSB

This project show the steps to convert STM32 USB CDC to WINUSB Device with HAL library. This will change the source code of CDC USB HAL library. "CDC" name will be retained in order to show the differenece. Also with Microsoft OS String Descriptor, no need to install WINUSB driver for Windows 10.

Create STM32 USB CDC device using CubeMX.

Using STM32F072 Discovery board

Implement echo function

Changes of usbd_cdc_if.c and main.c to implement simple echo function.

Convert CDC USB device to WINUSB device

Change source code of USB library. Create a DeviceInterfaceGUID = {13eb360b-bc1e-46cb-ac8b-ef3da47b4062} The DeviceInterfaceGUID is written into both OSStringPropertyDescriptor and INF file.

Create Windows 7 Driver

Create my_winusb.inf using DeviceInterfaceGUID as described previously. The inf file need to match the VID, PID, and DeviceInterfaceGUID of the USB device. Only Windows 7 and before need install driver.

Create Echo Test Win Form program using WINUSBNET library

Use WINUSBNET library from https://github.com/madwizard-thomas/winusbnet to create simple echo test program using Visual Studio with C# WinForm

Create STM32F4 WinUSB example

Using STM32F4 Discovery board with generate project using TrueStudio. There is not much difference from F0.

Driver Installation using Zadig

Another option to install drivers is using Zadig. The usage of Zadig can be found at here..

  • Advanced Mode (Options ? Advanced Mode)

    In this mode we can configure our device with defined values.

  • Open Preset (Device ? Load Preset Device)

    Load the predefined values(especially "Device Interface GUID") for the device driver. The sample config.ini is in the folder "Zadig".

Debug Tips and Registry

Windows will save registry entry "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Usbflags\VVVPPPRRRR" where VVV is PID, PPP is PID, and RRRR is version number. This will save the request of OS string descriptor(0xEE) and will prevent request for next plug in device. Please delete corresponding registry entry and uninstall the device driver to debug new device program.

stm32winusb's People

Contributors

michaeltien8901 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.