I wanted to test the use of WinUSB with STM32F103 for some time now. When I finally got time I created a demo project. It shows basic request - response communication.
WinUSB kernel mode driver enables raw communication through USB pipes. In other words you can communicate with your USB device directly from application on the PC. So there is only code for application and code for firmware. Presuming you are not making standard USB class device like Mass Storage or HID. You might not even need custom PC side software in this case.
Furthermore the libraries to communicate are written for both ends to some extent. There SetupAPI and WinUSB on Windows side while ST has libraries for everything.
To get a taste check images below. I will post more about it in the future and probably publish the sources after I clean and organize them.
VS showing sent data. |
winIDEA showing same received data on STM32. |
This is the first post in this series (of total 4 posts). See 2, 3, 4.
[Update - I have a new WinUSB device project with STM32F407 without the need for Windows side driver info (.inf and .cat files) ]
This comment has been removed by a blog administrator.
ReplyDeleteHi, unfortunately nor the driver, nor the python script work under W8.1. Any suggestion ?
ReplyDeleteIt has been a while since I reviewed the code for this reference project.
DeleteDid you analyze the error messages. One of the problems with Python script could be that it uses Python 2.7 syntax.
Regarding the driver, it might need an upgrade for W8. I never tested it with W8.
Check the WDKPath variable in the script. Does it point to your installation of WDK?
Also check where it is used in script. Are the relative paths for DLLs OK?
I'm not sure that INF file needs to be updated.
Are you locked to this reference project due to the driver for old Windows or the CPU part? BTW ST lib reference might also be outdated. I'm asking because newer Windows (from XP SP3 on I think) support so called "OS USB Descriptors" which enable the device to be associated with WinUSB driver from MS without any driver files (SYS, DLL or INF). I did a reference project for that too, but it uses newer STM32F4xx part.
If you will update sources you are having problems with please find time to send me the updates.
decade passed,time flies
ReplyDeleteVery nice blog yyou have here
ReplyDelete