Is it possible to overwrite data to the In Endpoint, that is, overwrite data in the buffer before the host has a chance to read it? In my device I am sending a series of responses to a request from the host. Each of these responses are less than 64 bytes. I know the IN is double buffered, is it possible that the 3rd write can overwrite a buffer if the first 2 have not been read yet? Or is all that prevented by hardware? I am looking at a Keil example of writing data to an endpoint and it just writes to the tranmit data register without any type of checking?
"is it possible for the device side to re-initiaite a sort of USB reset? "
Usually, "soft-detach/attach" using D+ (or D-) pull-up resistor is applied for this purpose, for such as firmware update. But in your case, D+ pull-up is fixed one.
I've seen an implementation in which, - D+ pull-up resistor is an external one and fixed - At the power-up, the firmware sets the USB engine to drive D+/D- line low (SE0), until the start-up initialization (except for the engine) finishes. - When initialized, the firmware resets the engine once, releases D+/D- line drive and initializes it.
At plug-in, (root) hub doesn't drive D+/D- line until it detects connection; until one of these lines goes high. Therefore, this method is relatively safe, though I don't like it :-)
For re-enumeration, however, this method may cause output conflict of D+/D- line drivers between your device and hub. The hub puts SOF periodically. When there is any other device on the hub, OUT transactions to other device are sent to your device, too.
If you have to do it on the device side, modify the circuit to control D+ pull-up resistor.
To issue bus reset from the host side, - 'device reset' control request, when the PC device driver supports it. - For Windows, SetupDiChangeState ( DICS_ENABLE / DICS_DISABLE )
Tsuneo