USBHost (UHD): cannot write to bulk EP

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greetings to All,

 

I am working on a projet involved the USBHost ASF library, on an arduino due (SAM3X8 mcu) board. I cannot manage to write to the bulk endpoint of my USB device, despite I can perfectly get emumeration and interfaces specs.

Here is the code I am using to write on this bulk interface:

 

        uhi_vendor_dev.dev->address = 1;

        usb_ep_desc_t desc;

        desc.bEndpointAddress = 0x81;

        desc.bDescriptorType = 5;

        uhd_ep_alloc(1, &desc);

        printf("Push device info: address %i, display_in_ep 0X%X \n", uhi_vendor_dev.dev->address, uhi_vendor_dev.ep_display_in);

        

        printf("Sending display header : %i\n", uhi_vendor_bulk_out_run(headerPkt, sizeof(headerPkt), NULL));

        delay_ms(500);        

        printf("Sending display buffer: %i\n", uhi_vendor_bulk_out_run(displayBuffer, DATA_SZ, NULL));

        

        delay_ms(500);

        printf("Sending display header: %i\n", uhd_ep_run(uhi_vendor_dev.dev->address,

                    uhi_vendor_dev.ep_display_in, false, headerPkt, sizeof(headerPkt),

                    1000, NULL));

        delay_ms(500);

         printf("Sending display buffer: %i\n",uhd_ep_run(uhi_vendor_dev.dev->address,

                    uhi_vendor_dev.ep_display_in, false, displayBuffer, DATA_SZ,

                    1000, NULL));

                    

        delay_ms(1000);

 

As you can see, I am trying both the uhi_vendor_bulk_out_run and the uhd_ep_run functions (actually, from the source code, this former one is just calling the later function): both calls return 0 (failure).

 

Could someone point out to the right direction?

 

Thanks and regards,

Mike

Last Edited: Tue. Jan 30, 2018 - 04:32 AM