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
12 changes: 12 additions & 0 deletions docs/platformio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ default Pico SDK USB stack. To change it, add
Note that the special "No USB" setting is also supported, through the
shortcut-define ``PIO_FRAMEWORK_ARDUINO_NO_USB``.

USB Customization
-----------------

If you want to change the USB VID, PID, product or manufacturer name that the device will appear under, configure them as follows:

.. code:: ini

board_build.arduino.earlephilhower.usb_manufacturer = Custom Manufacturer
board_build.arduino.earlephilhower.usb_product = Ultra Cool Product
board_build.arduino.earlephilhower.usb_vid = 0xABCD
board_build.arduino.earlephilhower.usb_pid = 0x1337

IP Stack
--------

Expand Down
8 changes: 6 additions & 2 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,15 @@ def configure_usb_flags(cpp_defines):

env.Append(CPPDEFINES=[
("CFG_TUSB_MCU", "OPT_MCU_RP2040"),
# used by TinyUSB stack
("USB_VID", usb_vid),
("USB_PID", usb_pid),
# Used by native USB stack
("USBD_VID", usb_vid),
("USBD_PID", usb_pid),
# Used by both stacks
("USB_MANUFACTURER", '\\"%s\\"' % usb_manufacturer),
("USB_PRODUCT", '\\"%s\\"' % usb_product),
("SERIALUSB_PID", usb_pid)
("USB_PRODUCT", '\\"%s\\"' % usb_product)
])

if "USBD_MAX_POWER_MA" not in env.Flatten(env.get("CPPDEFINES", [])):
Expand Down
Loading