Arduino: Change Device’s VID/PID/Name

Vendor IDs (VID) and product IDs (PID) are 16-bit numbers used to identify USB devices.

By these numbers a computer identifies what USB device is plugged in and what drivers to use with it.

If you are developing for example some Arduino-based USB HID keyboard, you may want to change the device’s VID/PID and the name, so the computer or any other host identifies and displays it as a standard keyboard.

In this note i will show how to change the VID/PID and the name of the Arduino-based device on the example of the Arduino Pro Micro.

Cool Tip: Simulate keystrokes using the Arduino boards! Read more →

Change Arduino Device’s VID/PID/Name

In Linux you can display the information about the connected USB devices as follows:

$ lsusb
- sample output -
Bus 003 Device 008: ID 1b4f:9207 SparkFun SparkFun Pro Micro
  • 1b4f – Vendor ID (VID)
  • 9207 – Product ID (PID)
  • SparkFun – Vendor name
  • SparkFun Pro Micro – Product name

To see the USB devices in Windows, press the ⊞ Win and search for the “Device Manager” in the “Start Menu”.

Every time you upload an Arduino sketch, the vendor and product names/IDs are also uploaded to the device.

These values are defined in the boards.txt file and can be found by the name of the board you have selected.

There may be several boards.txt files in different locations, for example:

# Windows
C:\Program Files (x85)\Arduino\hardware\arduino\avr\
C:\Users\<user>\AppData\Local\Arduino15\packages\SparkFun\hardware\avr\<version>\

# Linux
/opt/arduino-<version>/hardware/arduino/avr/
/home/<user>/.arduino15/packages/SparkFun/hardware/avr/<version>/

To locate the [aA]rduino15 folder, open the Arduino IDE, go to the “Files” → “Preferences” and check the path under the “More preferences can be edited directly in the file”.

Cool Tip: Add “Arduino Pro Micro” board to the Arduino IDE! Read more →

In my case the boards.txt file was at:

$ cd ~/.arduino15/packages/SparkFun/hardware/avr/1.1.13/
$ cp boards.txt boards.txt.orig
$ vi boards.txt

To spoof the Arduino Pro Micro device’s VID/PID and name i did the following changes:

$ diff -Nur boards.txt.orig boards.txt
--- boards.txt.orig	2022-01-17 14:04:41.248786790 +0100
+++ boards.txt	2022-01-17 15:28:07.863530923 +0100
@@ -94,8 +94,9 @@
 promicro.build.core=arduino:arduino
 promicro.build.variant=promicro
 promicro.build.mcu=atmega32u4
-promicro.build.usb_product="SparkFun Pro Micro"
-promicro.build.vid=0x1b4f
+promicro.build.usb_manufacturer="Logitech, Inc."
+promicro.build.usb_product="Unifying Receiver"
+promicro.build.vid=0x046d
 promicro.build.extra_flags={build.usb_flags}
 
 ######################### Pro Micro 3.3V / 8MHz ################################
@@ -115,7 +116,7 @@
 
 promicro.menu.cpu.16MHzatmega32U4.build.pid.0=0x9206
 promicro.menu.cpu.16MHzatmega32U4.build.pid.1=0x9207
-promicro.menu.cpu.16MHzatmega32U4.build.pid=0x9207
+promicro.menu.cpu.16MHzatmega32U4.build.pid=0xc535
 promicro.menu.cpu.16MHzatmega32U4.build.f_cpu=16000000L
 
 promicro.menu.cpu.16MHzatmega32U4.bootloader.extended_fuses=0xCB

Then, after i restarted the Arduino IDE and uploaded a sketch to the device, the Arduino Pro Micro board was recognized by the PC as a standard Logitech’s USB keyboard:

$ lsusb
- sample output -
Bus 003 Device 016: ID 046d:c535 Logitech, Inc. Unifying Receiver

Cool Tip: Revive the “bricked” Arduino Pro Micro! Read more →

Leave a Reply