Not working with Arduino USB Host examples?

The USBDroid provides USB Host functionality for use as an Android peripheral as an Open Android Development Kit board. [Product page]
Post Reply
ChiggenWingz
Posts: 3
Joined: Thu Apr 09, 2015 7:21 am

Not working with Arduino USB Host examples?

Post by ChiggenWingz » Thu Apr 09, 2015 7:26 am

So I just bought the USBDroid for its USB Host functionality, and I loaded up the Examples -> USBHost -> "MouseController" code and hit build on it. But it comes up with the following problems.

Googling did not yield anything that seemed to help :( Nor could I find any documentation about this issue on freetronics.

Code: Select all

WARNING: library USBHost claims to run on [sam] architecture(s) and may be incompatible with your current board which runs on [avr] architecture(s).

In file included from C:\Arduino\libraries\USBHost\src/MouseController.h:22:0,
                 from MouseController.ino:16:
C:\Arduino\libraries\USBHost\src/hidboot.h: In member function 'virtual void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*)':
C:\Arduino\libraries\USBHost\src/hidboot.h:474:62: error: 'UOTGHS_HSTPIPCFG_PTYPE_INTRPT' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                              ^
C:\Arduino\libraries\USBHost\src/hidboot.h:474:93: error: 'UOTGHS_HSTPIPCFG_PTOKEN_IN' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                             ^
C:\Arduino\libraries\USBHost\src/hidboot.h:474:151: error: 'UOTGHS_HSTPIPCFG_PBK_1_BANK' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                                                                                       ^
C:\Arduino\libraries\USBHost\src/hidboot.h:474:178: error: there are no arguments to 'UHD_Pipe_Alloc' that depend on a template parameter, so a declaration of 'UHD_Pipe_Alloc' must be available [-fpermissive]
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                                                                                                                  ^
C:\Arduino\libraries\USBHost\src/hidboot.h:474:178: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:\Arduino\libraries\USBHost\src/hidboot.h: In member function 'virtual uint32_t HIDBoot<BOOT_PROTOCOL>::Release()':
C:\Arduino\libraries\USBHost\src/hidboot.h:500:54: error: there are no arguments to 'UHD_Pipe_Free' that depend on a template parameter, so a declaration of 'UHD_Pipe_Free' must be available [-fpermissive]
  UHD_Pipe_Free(epInfo[epInterruptInIndex].hostPipeNum);
                                                      ^
C:\Arduino\libraries\USBHost\src/hidboot.h: In instantiation of 'uint32_t HIDBoot<BOOT_PROTOCOL>::Release() [with unsigned char BOOT_PROTOCOL = 2u; uint32_t = long unsigned int]':
MouseController.ino:92:1:   required from here
C:\Arduino\libraries\USBHost\src/hidboot.h:500:54: error: 'UHD_Pipe_Free' was not declared in this scope
C:\Arduino\libraries\USBHost\src/hidboot.h: In instantiation of 'void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*) [with unsigned char BOOT_PROTOCOL = 2u; uint32_t = long unsigned int]':
MouseController.ino:92:1:   required from here
C:\Arduino\libraries\USBHost\src/hidboot.h:474:178: error: 'UHD_Pipe_Alloc' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                                                                                                                  ^
Error compiling.

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Not working with Arduino USB Host examples?

Post by andrew » Thu Apr 09, 2015 11:28 am

The USBHOST library that's available with the new Arduino IDE is only for the Arduino Due/Freetronics EtherDue.
Please use a library written for the MAX3421 such as:
https://github.com/felis/USB_Host_Shield_2.0
along with IDE v1.0.6
http://arduino.cc/en/Main/OldSoftwareReleases

ChiggenWingz
Posts: 3
Joined: Thu Apr 09, 2015 7:21 am

Re: Not working with Arduino USB Host examples?

Post by ChiggenWingz » Thu Apr 09, 2015 1:31 pm

Ah yep I see now

Managed to get the USB Host Library 2.0 to work, and played around with a few of their examples (there are lots)

What I assumed was since I had already the latest Arduino IDE installed, that the USB Host examples that came with it on there would be version 2.0. I assumed wrong. Thus I downloaded the actual ones you linked above.

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Not working with Arduino USB Host examples?

Post by andrew » Thu Apr 09, 2015 9:34 pm

Good news. I'll update the product details now.

webwarrior
Posts: 4
Joined: Thu Dec 03, 2015 2:02 am

Re: Not working with Arduino USB Host examples?

Post by webwarrior » Thu Dec 03, 2015 2:12 am

Hi,

I copied the USB files to C:\Users\Username\Documents\Arduino\libraries\USB_Host_Shield_2.0.

I am still getting errors when trying to compile the stuff...

Using V1.0.6 of the IDE for the USBDroid....

What am I doing wrong?

webwarrior
Posts: 4
Joined: Thu Dec 03, 2015 2:02 am

Re: Not working with Arduino USB Host examples?

Post by webwarrior » Thu Dec 03, 2015 2:36 pm

ChiggenWingz wrote:Ah yep I see now

Managed to get the USB Host Library 2.0 to work, and played around with a few of their examples...
How did you get it to work, Chiggen?

Which version of the USDroid board do you have?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests