hello,
I have changed my app somewhat and the problem manifests itself in a different way. This time it is in the receiver:
function TCDCDevice.Read(var ABuffer; ASize: SizeInt): SizeInt;
var
left: SizeInt;
ptr: pbyte;
begin
Result:=0;
ptr:=@ABuffer;
while ASize>0 do
begin
if fRXPos<=0 then
begin
if fBlocking then
fDevice^.Poll
else
break; // <<<<<<<<<<<<<< NEVER EXITS
end
I am requesting 1 byte but the receiver does not return and sits polling the USB.
RXPos=0
fBlocking = true
TXpos=0
TXDone=true
The comms is request/response
THe request is 4 bytes
This works fine when the response is small ~ 8-16 bytes
When I increase the response size (probably over the TX buffer size of 64 bytes), there is a point when it hangs.
Is the problem due to the operation of "fBlocking", I have not looked at the code in any detail so i am guessing here.
edit:
I can normally plug and unplug the usb when the STM32 app is running with no problem. In the hang situation, when i plug it in Windows registers an error handling the USB interface.