hello,
I have discovered how to load the Windows generic serial driver. Microsoft have a designated class and sub class codes to select the "usbser.sys" driver. So I don't need the STM micro one, i was using....
DataIntf: (
bLength: sizeof(TUsbInterfaceDescriptor);
bDescriptorType: USB_DESC_TYPE_Interface;
bInterfaceNumber: 0;
bAlternateSetting: 0;
bNumEndpoints: 2;
bInterfaceClass: 2; // WIN GENERIC codes
bInterfaceSubClass: 2;
bInterfaceProtocol: 255;
iInterface: 2;
);
I merged in your changes to the UsbHal unit from the simple usb project.
I am still getting the hang problem. The request/response transactions stop after the 50 - 250 point. I don't think the bug is in my PC program as I have it working normally using the PC uart com port and using the FTDI usb card.
When it hangs, the PC is battering the STM32 with Tx requests and these trigger in the USbHal unit... The program on the STM32 is active and I can debug it ok,
reg := @USB.EPR[endpoint];
if (reg^ and USB_EP_CTR_TX) <> 0 then
At this point no data receive events are triggered on the STM32 although it is polling for it.
When I close and open the port, some setup packets are sent by the PC and these trigger the receive events ....
reg^ := reg^ and (USB_EP_MASK xor USB_EP_CTR_RX);
if (reg^ and USB_EP_SETUP) <> 0 then
event := TDriverEvent.deSetup // <<<<<<<<<<<<<<<<< THIS ONE TRIGGERS
else
event := TDriverEvent.deRx;