|
Michael Stoops submitted pull requests to make a set of USB parameters configurable in your CMake file.
|
What USB IDs can be configured?
- USB_VID
- USB_PID
- USB_MANUFACTURER
- USB_PRODUCT
- USB_SERIALNUMBER
Before this new functionality was introduced, these attributes were defined in the LabLib source code. They had the same values as those of the Pico SDK examples.
When you want to commercialise a device, you need to set those to IDs that you license from the USB.org, and to your internal IDs.
In the past, you needed to alter LabLib's source. You can now define these, in the build file (or from the command line).
In the past, you needed to alter LabLib's source. You can now define these, in the build file (or from the command line).
Setting the IDs
In your CMake config file (example from LabTool), you can add a section with the defines.
# set the USB IDs for this device
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
USB_VID=0xCafe
USB_PID=0x4000
USB_MANUFACTURER=0x01
USB_PRODUCT=0x02
USB_SERIALNUMBER=0x03
)
If you don't define (some of) those, the initial example values from the Pico SDK are used.
