GPIO operations fail with "Bulk write failed"

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

GPIO operations fail with "Bulk write failed"

Post 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.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: GPIO operations fail with "Bulk write failed"

Post by xol »

What about other functions?
Do they also fail?

What Linux do you use?

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

Re: GPIO operations fail with "Bulk write failed"

Post 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.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: GPIO operations fail with "Bulk write failed"

Post 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.

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

Re: GPIO operations fail with "Bulk write failed"

Post 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

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

Re: GPIO operations fail with "Bulk write failed"

Post 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

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: GPIO operations fail with "Bulk write failed"

Post 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.

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

Re: GPIO operations fail with "Bulk write failed"

Post by ray »

Now it seems to work!
Thank you for the instructions.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: GPIO operations fail with "Bulk write failed"

Post by xol »

Thank you too for the patience and cooperation.

BTW what is your project?

ray
Posts: 6
Joined: Fri Nov 05, 2010 11:57 am

Re: GPIO operations fail with "Bulk write failed"

Post 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.

Post Reply