Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ This bootloader implements the draft [WebUSB](https://wicg.github.io/webusb/) sp
For a demo implementing dfu-util features in the browser, see https://devanlai.github.io/webdfu/dfu-util/

## USB VID/PID
The USB VID/PID pair ([1209/DB42](http://pid.codes/1209/DB42/)) is allocated through the [pid.codes](http://pid.codes/) open-source USB PID program.
The default USB VID/PID pair ([1209/DB42](http://pid.codes/1209/DB42/)) is allocated through the [pid.codes](http://pid.codes/) open-source USB PID program.

To use a custom VID/PID pair, you need to set the macros `USB_VID` and `USB_PID`. One way to do this is by setting the `DEFS` environment variable when compiling:

DEFS="-DUSB_VID=0x1209 -DUSB_PID=0xCAFE" make


## Licensing
All contents of the dapboot project are licensed under terms that are compatible with the terms of the GNU Lesser General Public License version 3.
Expand Down
6 changes: 6 additions & 0 deletions src/usb_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@

#include <libopencm3/usb/usbd.h>

#ifndef USB_VID
#define USB_VID 0x1209
#endif

#ifndef USB_PID
#define USB_PID 0xdb42
#endif

#define USB_CONTROL_BUF_SIZE 1024
#define USB_SERIAL_NUM_LENGTH 24
#define INTF_DFU 0
Expand Down