
WinUSBCommSTM32F4_Init takes the address and size of the buffer. That is why it is declared as "extern unsigned char _sram " This is saying to compiler: "Yo, somewhere is a variable _sram of type unsigned char." and when compiler hits it's usage with address operator '&' it says: "Ah, an address of some variable is needed here, I'll let linker deal with it." This is a trick to get link time values in your code. It is set in linker file as "_sram = ORIGIN(SRAM) " But to use it in source it must somehow be known at compile time. _sram is just a symbol (not an actual variable) defined in linker file, known at link time. Just be sure to match GUID from descriptor with one used in SetupDiGetClassDevs call. If you are asking how you can detect your WinUSB device from application, that is done through DeviceInterfaceGUID property in Extended Properties OS Descriptor. Or you respond to Extended Compat ID OS Descriptor request with "WINUSB" string in compatibleID field as described in the post above. You can do that by writing INF file telling Windows that a device with your VID and PID uses WinUSB.sys. So, for your device to be recognized as WinUSB device (by Windows) you need to associate it with WinUSB driver. Optionally you can make your device respond properly to OS descriptor requests and that eliminates the need for driver INF files which need to be signed with Code Signing certificate. WinUSB is useful because you don't need to write your own kernel driver for device. But nevertheless, I assume you want raw communication from your Windows application to microcontroller. As you can see the project is a bit complex and spread across few posts.

What do you mean with "Winusb template of Visual Studio"?
