Open Titibo26 opened 3 years ago
https://github.com/felis/USB_Host_Shield_2.0/blob/master/max3421e.h#L218 0x04 means the device isn't ready yet, so you need to try again. It's not an error, it's more like saying "I'm busy right now, try later."
Oh thanks, didn't see this code ! I'm using an esp32+usb host mini --> to an usb device equipped with FTDI chip. I have to inspire myself of "USBFTDILoopback" example, am I right ?
Does this error (04) can be related to bad communication settings ? the device is supposed to work at [38400, 8bits, no parity, no HS, 1 start bit, 1 stop bit]. I can't see where to set the Start bit. can it be the problem?
rcode = pftdi->SetBaudRate(38400); rcode = pftdi->SetFlowControl(FTDI_SIO_DISABLE_FLOW_CTRL); rcode = pftdi->SetData(FTDI_SIO_SET_DATA_PARITY_NONE |FTDI_SIO_SET_DATA_STOP_BITS_1| 8);
Finnally, Can this error code be caused by wrong command sent ? EDIT : i don't thin it's relative to a bad command sent because the device is in a poll mode : with Putty on a PC i now i'm receiving informations without asking. So i should receive data though the usb host but i always have error code 04 (but it works on my pc with putty).
EDIT 2 : I ont know if it can help but after Ftdi.RcvData(&rcvd, bufin);
, rcvd[0] and rcvd[1] are == 0
Hello,
I'm still investigating my issue and after some debugging, usb allways fall in USB_STATE_ERROR (0x0A).
It goes from 0x11 to 0x20 to 0x40 to 0x50 to 0x51 and then to 0x0A.
Just after 0x51, this condition is true :
if(rcode != USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE) {
Which make it fall in 0x0A.
So the problem seems to be on this line :
rcode = Configuring(0, 0, lowspeed);
Inside this method, Rcode return "5" as "hrStall" at this part of code :
for(devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
if(!devConfig[devConfigIndex]) continue; // no driver
if(devConfig[devConfigIndex]->GetAddress()) continue; // consumed
if(devConfig[devConfigIndex]->DEVSUBCLASSOK(subklass) && (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass))) {
rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED) {
Serial.println("rcode p1 : ");
Serial.println(rcode);
break;
}
}
}
if(devConfigIndex < USB_NUMDEVICES) {
Serial.println("rcode p2 : ");
Serial.println(rcode);
return rcode;
}
Any clue ?
Thanks,
Hi, I'm using an esp32 to read data from a device equiped with an ftdi chip.
I get informations of the device :
but after sending data (rcode = 00, its ok), i get Ret : 04 which means there is a problem at reception. What is the meaning of this code ? i can't find it anywhere in the lib. Thanks,