Skip to content

Commit 264b9ef

Browse files
Return custom USB product and manufacturer (#1223)
Return the pre-existing USB_PRODUCT/MANUFACTURER to the USB host in the ID stage, allowing for reports like: [1412958.589070] usb 1-6.3.4.1: New USB device found, idVendor=2e8a, idProduct=f00a, bcdDevice= 1.00 [1412958.589076] usb 1-6.3.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1412958.589079] usb 1-6.3.4.1: Product: Pico W [1412958.589080] usb 1-6.3.4.1: Manufacturer: Raspberry Pi [1412958.589081] usb 1-6.3.4.1: SerialNumber: E6614C775B6C7F31 or [1413190.272233] usb 1-6.3.4.1: New USB device found, idVendor=2e8a, idProduct=1037, bcdDevice= 1.00 [1413190.272239] usb 1-6.3.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1413190.272242] usb 1-6.3.4.1: Product: HunterCat NFC RP2040 [1413190.272243] usb 1-6.3.4.1: Manufacturer: ElectronicCats [1413190.272244] usb 1-6.3.4.1: SerialNumber: E6614C775B6C7F31
1 parent 9fd5cdf commit 264b9ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/rp2040/RP2040USB.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,15 @@ void __SetupUSBDescriptor() {
301301

302302
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
303303
(void) langid;
304-
#define DESC_STR_MAX (20)
304+
#define DESC_STR_MAX (32)
305305
static uint16_t desc_str[DESC_STR_MAX];
306306

307307
static char idString[PICO_UNIQUE_BOARD_ID_SIZE_BYTES * 2 + 1];
308308

309309
static const char *const usbd_desc_str[] = {
310310
[USBD_STR_0] = "",
311-
[USBD_STR_MANUF] = "Raspberry Pi",
312-
[USBD_STR_PRODUCT] = "PicoArduino",
311+
[USBD_STR_MANUF] = USB_MANUFACTURER,
312+
[USBD_STR_PRODUCT] = USB_PRODUCT,
313313
[USBD_STR_SERIAL] = idString,
314314
[USBD_STR_CDC] = "Board CDC",
315315
#ifdef ENABLE_PICOTOOL_USB

0 commit comments

Comments
 (0)