I an not having any luck with overriding the PICO board configuration to use custom usb vendor and product ids and names. This article works fine with amtelavr but not pico or other RP2040 variants.
I also tried adding build flags such as these but no success with Pico.
-D USBD_VID=0xNNNN
-D USBD_PID=0xNNNN
-D USB_MANUFACTURER=“Sample Manufacturer”
-D USB_PRODUCT=“My Product name”
Does anyone know how we can have custom VID/PIDs and product/manufacturer names for our USB devices using Pico or rp2040 boards?
Yeah the PlatformIO builder script is currently not made for havign that overriden via build_flags
In the future I think I can file a PR where we check if USBD_VID, USBD_PID, … have been pregiven and then don’t try and set new ones.
If you’re gonna have a custom product anyways, I’d actually recommend you to creata a new board definition for that. In there you can directly put the PID/VID/Manufacturer/Product you want.
To do that:
Create a new boards folder at the root of your project (same level as platformio.ini)
In it, duplicate pico.json as your board JSON, e.g., my_custom_board.json
Change up the attributes in the earlephilhower object as desired
In the platformio.ini, reference your board definition in boards = .. but without the fileextension, e.g., board = my_custom_board
Oh you’re using the standard ArduinoCore-mbed and not Arduino-Pico? Well in that case you don’t need a custom board JSON since it doesn’t use info from there for that. The pins_arduino.h has the values hardcoded without respect for changability (thank the Arduino core maintainers for that )
Further they hardcoded the Manufacturer name “Arduino” here
So for some quick testing I can recommend you to first try and change the data locally. The pins_arduino.h should be in