Page 1 of 2

GPIO operations fail with "Bulk write failed"

Posted: Fri Nov 05, 2010 12:10 pm
by ray
I'm testing the SUB-20 module in Linux with the provided sub_app application.
When using the GPIO functions (config and read) they fail most of the time with error code 7, "Bulk write failed".
Approx. every 10th call is successful.
ADC and I2C calls work perfectly.

Version information:
XDimax LTD, V0.1.6, Sep 16 2010 12:05:54
DLL/Lib: 1.0.0.18
Driver : 0.0.0.0
SUB-20 : 0.2.2
Boot : 0.5

Any ideas?
Thanks.

Re: GPIO operations fail with "Bulk write failed"

Posted: Fri Nov 05, 2010 12:53 pm
by xol
What about other functions?
Do they also fail?

What Linux do you use?

Re: GPIO operations fail with "Bulk write failed"

Posted: Thu Nov 11, 2010 9:15 am
by ray
The functions for configuring and reading AD-converter work without problems.
Also I2C functions and writing on the LCD work correctly.
I haven't tested PWM or SPI.

I'm running Ubuntu 9.04 with libusb-1.0-0 version 2:1.0.0-1.

Re: GPIO operations fail with "Bulk write failed"

Posted: Thu Nov 11, 2010 9:22 am
by xol
Are GPIO connected to target?
Try to disconnect everything for the test.

If it is not working please run it with trace enabled:
export SUB_DEBUG=10
and send us a trace.

Re: GPIO operations fail with "Bulk write failed"

Posted: Thu Nov 11, 2010 9:41 am
by ray
./sub_app --gpio=c,0,0

BULK_OUT 11 bytes:
0a 60 08 00 00 00 00 00 00 00 00
BULK_IN 7 bytes:
06 60 04 cf 00 00 00
Transfer incomplete
Failed(rc=7): Bulk write failed

Re: GPIO operations fail with "Bulk write failed"

Posted: Thu Nov 11, 2010 9:42 am
by ray
Sometimes it works and then I get this:

./sub_app --gpio=c,0,0

BULK_OUT 11 bytes:
0a 60 08 00 00 00 00 00 00 00 00
Transfer completed, transferred=11
BULK_IN 7 bytes:
06 60 04 cf 00 00 00
GPIO Config: val=00000000,mask=00000000
GPIO Config: 000000CF

Re: GPIO operations fail with "Bulk write failed"

Posted: Thu Nov 11, 2010 3:10 pm
by xol
HI,
There is a line

Code: Select all

#define ASYNC_OUT
in libsub.c.

Please try to comment it and rebuild library and application and run this way. Let me know the result.

Re: GPIO operations fail with "Bulk write failed"

Posted: Fri Nov 12, 2010 9:00 am
by ray
Now it seems to work!
Thank you for the instructions.

Re: GPIO operations fail with "Bulk write failed"

Posted: Fri Nov 12, 2010 9:40 am
by xol
Thank you too for the patience and cooperation.

BTW what is your project?

Re: GPIO operations fail with "Bulk write failed"

Posted: Fri Nov 12, 2010 11:58 am
by ray
It's a mobile robotics project.

We have this large (80kg) tracked robot, which needs sensors. We'll use the SUB-20 i2c-bus at least for ultrasonic sensors and local I/O-expanders. AD-converters are used for monitoring voltages and currents of the power system and GPIO for various simple control or sensing tasks. We'll also test if the FPWM can be used for controlling standard hobby servos.