timr | 1 Jun 2009 07:04

Re: Anchor Downloads

On Sat, May 30, 2009 at 11:30:58PM -0500, Raghav Puranmalka wrote:
>   
> Unfortunately the manufacturer only gave me a header file containing the
> firmware and not a hexfile, which is the reason I guess to try doing the
> "anchor download." If this is just putting the firmware on the device,
> would it be putting it on endpoint 0? If that's the case, would a bulk
> transfer to endpoint 0 accomplish the same thing?

Greg's advice is dead on -- there are several open source projects 
that download firmware to EZUSB and FX2 devices.  As a hint, you 
download the firmware via control messages to endpoint 0.  (You can't 
do a bulk transfer to endpoint 0 -- that's a control pipe, always.)

Do you really have an EZUSB, or is it really an FX2?  They are very
similar -- the EZUSB was the predecessor -- but the register numbers
for downloading are slightly different.
--

-- 
Tim Roberts, timr <at> probo.com
Providenza & Boeklheide, Inc.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Nuno Santos | 1 Jun 2009 11:29

Re: Receiving multiple interrupt transfer packets in order

Hi Peter,

My first experience while developing host programs to interact with usb 
devices was with libusb.

I then choose openusb because it seemed to me that was more probable to 
get support to the three operating systems.

The thing is, altough it is thicker it is supposed to give the same 
control that libusb does, right?

I can start another test program using libusb, but I would also wanted 
to have working version with openusb. Isn't that possible? I would love 
to understand what is the problem with the approach i'm using.

Nuno

Peter Stuge wrote:
> Nuno Santos wrote:
>   
>> What am I supposed to understand from your comments?
>>     
>
> Sorry for being unclear. Should try not to write emails when sleep
> deprived.
>
>
>   
>>>> This is my current implementation. If anyone could tell me what I
>>>> am doing wrong, or if this approach is correct for the results I
(Continue reading)

Xiaofan Chen | 1 Jun 2009 11:38
Picon

Re: Receiving multiple interrupt transfer packets in order

On Mon, Jun 1, 2009 at 5:29 PM, Nuno Santos <nsantos <at> edigma.com> wrote:
> My first experience while developing host programs to interact with usb
> devices was with libusb.
>
> I then choose openusb because it seemed to me that was more probable to
> get support to the three operating systems.

Which three? Linux, Windows, Mac OS X?
libusb 1 supports Linux and Mac OS X.
Openusb supports Solaris and Linux as far as I know.
libusb 0.1 has Linux, Windows, Mac OS X, Solaris, xBSD support.

> I can start another test program using libusb, but I would also wanted
> to have working version with openusb. Isn't that possible? I would love
> to understand what is the problem with the approach i'm using.
>

I think the OpenUSB developers can probably answer your question.
They are in the list as well. But you probably need to provide more
information. Output "lsusb -vvv" is one of them. More of your codes
may help as well.

--

-- 
Xiaofan http://mcuee.blogspot.com

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
(Continue reading)

Lei Chen | 1 Jun 2009 12:22
Picon

Re: Receiving multiple interrupt transfer packets in order

Hi Nuno,
Are you developing your application on Linux? You can set OPENUSB_DEBUG 
environment variable to 4 to have more debug information.

Regards,
Lei Chen

Nuno Santos wrote:
> Hi everyone,
>
> I continue with my quest of receiving multiple packets transfered using 
> interrupt transfers in order and without failing one.
>
>   

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Lei Chen | 1 Jun 2009 12:31
Picon

Re: (OpenUSB) Receiving multiple interrupt transfer packets in order

Xiaofan Chen wrote:
On Mon, Jun 1, 2009 at 5:29 PM, Nuno Santos <nsantos <at> edigma.com> wrote:
My first experience while developing host programs to interact with usb devices was with libusb. I then choose openusb because it seemed to me that was more probable to get support to the three operating systems.
Which three? Linux, Windows, Mac OS X? libusb 1 supports Linux and Mac OS X. Openusb supports Solaris and Linux as far as I know.
Nathan added the support for Mac OS X. He has tested it and we need more developer to test this backend.

Thanks,
Lei Chen


libusb 0.1 has Linux, Windows, Mac OS X, Solaris, xBSD support.
I can start another test program using libusb, but I would also wanted to have working version with openusb. Isn't that possible? I would love to understand what is the problem with the approach i'm using.
I think the OpenUSB developers can probably answer your question. They are in the list as well. But you probably need to provide more information. Output "lsusb -vvv" is one of them. More of your codes may help as well.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Libusb-devel mailing list
Libusb-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Nuno Santos | 1 Jun 2009 12:47

Re: Receiving multiple interrupt transfer packets in order

Hi,

I'm developing my application in linux right now. If the device gets 
stablized I will need to develop drivers for windows and mac osx as 
well. However, that is not a key issue right now.

Maybe my problem right now is how to properly set the code architecture 
for my needs.

I have successfull transfer. Right now my issue is how to get them in 
order and without missing one. I don't errors, I just cant get all the 
packets in order.

Nuno

Lei Chen wrote:
> Hi Nuno,
> Are you developing your application on Linux? You can set 
> OPENUSB_DEBUG environment variable to 4 to have more debug information.
>
> Regards,
> Lei Chen
>
>
> Nuno Santos wrote:
>> Hi everyone,
>>
>> I continue with my quest of receiving multiple packets transfered 
>> using interrupt transfers in order and without failing one.
>>
>>   
>

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Nuno Santos | 1 Jun 2009 16:00

Re: Receiving multiple interrupt transfer packets in order

Hi Alan,

I'm experience a small glitch in package receiving.

I am pretty sure about the order they are being sent. The device is 
sending a buffer in which the content is the packet number. After 
sending all the packets, i send a sync packet.

They are received (interrupt transfer, 16 packets of 64 bytes). But, in 
16 is always one missing.

The way I was requesting was with sync transfer request in a infinite 
while loop.

Is there any better paradigm to request such kind of data, constantly?

Thanks,

Nuno

Alan Stern wrote:
> On Mon, 1 Jun 2009, Nuno Santos wrote:
>
>   
>> Hi,
>>
>> I'm developing my application in linux right now. If the device gets 
>> stablized I will need to develop drivers for windows and mac osx as 
>> well. However, that is not a key issue right now.
>>
>> Maybe my problem right now is how to properly set the code architecture 
>> for my needs.
>>
>> I have successfull transfer. Right now my issue is how to get them in 
>> order and without missing one. I don't errors, I just cant get all the 
>> packets in order.
>>     
>
> The libraries will always deliver the packets in the order they were 
> received.  Maybe they aren't being sent in the right order?
>
> You should use usbmon to verify the order in which the packets are 
> sent.  See the kernel source file Documentation/usb/usbmon.txt for 
> instructions.
>
> Alan Stern
>
>   

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Nuno Santos | 1 Jun 2009 15:35

libusb-1.0 - minimal program for async interrupt transfers

Hi,

I was here in the process of making a minimal program for async 
interrupt transfers with libusb 1.0 but nothing comes out.

The initialization is being done with success as the device is detected 
and the interface claim successfully.

I think I have prepared the necessary steps in order to accomplish a 
successfull transaction but the callback is not called:

This is my alloc transfer and callback code:

static void cb_irq(struct libusb_transfer *transfer)
{
        unsigned char irqtype = transfer->buffer[0];

        if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
                fprintf(stderr, "irq transfer status %d?\n", 
transfer->status);
                do_exit = 2;
                libusb_free_transfer(transfer);
                irq_transfer = NULL;
                return;
        }

        printf("IRQ callback %02x\n", irqtype);
}

static int alloc_transfers(void)
{
        irq_transfer = libusb_alloc_transfer(0);

        if (!irq_transfer)
                return -ENOMEM;

        libusb_fill_interrupt_transfer(irq_transfer, devh, ENDPOINT, 
irqbuf, sizeof(irqbuf), cb_irq, NULL, 0);

        return 0;
}

This is the code where I invoke things out:

r = libusb_claim_interface(devh, INTERFACE);
        if (r < 0) {
                fprintf(stderr, "usb_claim_interface error %d\n", r);
                exit(-1);
        }

        printf("claimed interface\n");

        alloc_transfers()==0?puts("Transfer alloced"):puts("Alloced 
failed");

        r = libusb_submit_transfer(irq_transfer);

        if (r < 0)
                return r;

        while (!do_exit)
        {
                r = libusb_handle_events(NULL);
                if (r < 0)
                        exit(-1);
        }

Any tips?

Thanks,

Nuno

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Alan Stern | 1 Jun 2009 15:50
Picon
Favicon

Re: Receiving multiple interrupt transfer packets in order

On Mon, 1 Jun 2009, Nuno Santos wrote:

> Hi,
> 
> I'm developing my application in linux right now. If the device gets 
> stablized I will need to develop drivers for windows and mac osx as 
> well. However, that is not a key issue right now.
> 
> Maybe my problem right now is how to properly set the code architecture 
> for my needs.
> 
> I have successfull transfer. Right now my issue is how to get them in 
> order and without missing one. I don't errors, I just cant get all the 
> packets in order.

The libraries will always deliver the packets in the order they were 
received.  Maybe they aren't being sent in the right order?

You should use usbmon to verify the order in which the packets are 
sent.  See the kernel source file Documentation/usb/usbmon.txt for 
instructions.

Alan Stern

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Alan Stern | 1 Jun 2009 16:27
Picon
Favicon

Re: Receiving multiple interrupt transfer packets in order

On Mon, 1 Jun 2009, Nuno Santos wrote:

> Hi Alan,
> 
> I'm experience a small glitch in package receiving.
> 
> I am pretty sure about the order they are being sent. The device is 
> sending a buffer in which the content is the packet number. After 
> sending all the packets, i send a sync packet.
> 
> They are received (interrupt transfer, 16 packets of 64 bytes). But, in 
> 16 is always one missing.
> 
> The way I was requesting was with sync transfer request in a infinite 
> while loop.
> 
> Is there any better paradigm to request such kind of data, constantly?

Please use usbmon and post your results.  I can't answer your questions 
without that information.

Alan Stern

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 

Gmane