If I want to make an Arduino derivative product based on the Arduino UNO design, and I make no modifications to the firmware loaded on the ATMega8u2 usb chip, do I still have to go off and buy my own VID/PID from USB-IF?
Arduino UNO USB VID/PID
productionusb
Related Solutions
As per my comment, you have specified UNO board, but it doesn't have Keyboard/Joystick required definitions for the board (I'm not sure if UNO has any buttons to be defined there, it only has Leds, and leds are defined in Led.h - check out \LUFA-111009\LUFA\Drivers\Board\AVR8\UNO)
So what you could do is to create Board folder under your KeyboardMouse and make empty files Joystick.h and Buttons.h there. This should get you going further. Errors you are seeing are due to the following code in \LUFA\Drivers\Board\Buttons.h
#if (BOARD == BOARD_NONE)
#error The Board Buttons driver cannot be used if the makefile BOARD option is not set.
#elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Buttons.h"
....
#else
#include "Board/Buttons.h" <------ THIS IS EXECUTED SINCE UNO DOES NOT HAVE BUTTONS
#endif
So your error
../../../../LUFA/Drivers/Board/Joystick.h:119:31: error: Board/Joystick.h: No such file or directory
means that your folder structure and your LUFA configuration is correct, but you're missing file Buttons.h in your KeyboardMouse/Board/ folder. Got it?
Try what I've suggested and see how far you get. You can see how to define buttons in other Board's folders, for example in LUFA\Drivers\Board\AVR8\USBKEY\
EDIT Btw, I forgot to mention, error about common.h should go away hopefully after fixing this since that ........\ is coming from a file in a different location in folder structure thus confusion.
EDIT OK, so here's the link on how to build custom board drivers: http://www.fourwalledcubicle.com/files/LUFA/Doc/111009/html/page_writing_board_drivers.html
What you need to do is to copy files Buttons.h and Joystick.h LUFA\CodeTemplates\DriverStubs\ (or try copying Buttons.h and Joystick.h from USBKEY better, I think you still would need to specify a value for each definition otherwise) This should get rid of undefined errors. You have TODO sections in the files that you need to update.
OK, so I think I should also mention how this is supposed to be used before going further. These drivers/definitions are meant to be used in a specific manner in your code, and LUFA is unifying the approach for you. As far as I can tell, buttons are used in a following manner:
if (Buttons_GetStatus() & BUTTONS_BUTTON1){ ... do something when button 1 pressed....
This way, if you have several boards with at least one button, your code should theoretically stay the same across the boards. Similar stands for LEDs, you can use them like:
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
....
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
I hope you get the picture. In order to use these library functions you have to define buttons/joystick/led specifics in their respective header files. So for example - in buttons.h you need to specify any custom header files you need, add port masks for buttons (on which pin of which port they are connected), specify port initialization and how to read the status of the buttons. You can find all of that in the USBKEY's buttons.h - e.g. it's importing common.h, defines BUTTONS_BUTTON1 like pin 2 of a port, initializes PortE with this button (so button is pin 2 on port E), and in Buttons_GetStatus it reads the status of the button.
I could go on and on in the same manner for joystick as well, but I hope you get the picture. Joystick is more involved but it's like having 4 buttons of which 0, 1 or 2 can be active at any time.
BTW, this is only useful if you have any buttons on your board. For example, I made keyboard driver without any buttons (I had to remove buttons specific code though). I used Ir Diode to read remote control codes and make the board act as keyboard. So you don't really need the buttons, nor the joystick (of course, it completely depends on what you're doing).
Is the HWBE bit (HardWare Boot Enable) set in your fuses?
Related Topic
- Electronic – Firmware & Circuit of ATtiny45 direct USB 2.0 Connection
- Electronic – arduino – how to cut off power from usb device using arduino
- Re-programming PIC microcontrollers with USB through smartphone
- Both USB and ESC power options
- Cannot Connect AVR USB ISP 2.0
- Electronic – Is a valid USB VID/PID necessary for strictly embedded use of the Bus
Best Answer
(i) It is generally agreed that you have to buy your own VID/PIC licence at a cost of about $2000 AND they are unlikely to take your $2000 unless you can prove that you are substantially real :-(. See references at end.
(ii) BUT - you appear to be legally allowed to buy VID/PID pairs from legitimate owners under some circumstances. What the conditions are would need to be determined from the licence. See iii
(iii) I am aware that a member of this forum owns a VID/PID licence and has sold VID/PID pairs to enthusiasts. I won't say who they are to prevent possible deluging but will bring this post to their attention. They can speak if they wish.
Gilberti industries discussion October 2010 [1] = No
Official answer here, 6th post down, is not encouraging. October 2010. Essentially - "we are not ALLOWED to give them away but are negotiating to be allowed to do so for use on a non commercial basis" = No in your case. [2]
Lady Ada wiki. No. [3]
Things may have changed since late 2010, but it seems unlikely. This is a grave impediment [tm] to any would be roll your own USB designs aimed at small scale production. $2000 is "not a lot of money" once you get into the 1000 - 10,000 production range but below that it starts to be noticeable.
[1] http://www.gilberti-industries.com/2010/10/02/arduino-uno-and-its-usb/
[2] http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285500728/180
[3] http://wiki.ladyada.net/arduino/unofaqV