Attempting to change the Vendor ID (VID) and Product ID (PID) on UNO R4 WIFI

Hello everyone,

I’m facing an issue while attempting to change the Vendor ID (VID) and Product ID (PID) on my Arduino UNO R4 WIFI board. I’ve used the same method that has worked for me in the past with older boards like the Arduino Leonardo. Specifically, I’ve modified the VID and PID values in the boards.txt file under the UNO R4 WIFI section.
After making these changes, I upload a sketch to the board. The upload completes successfully, but the VID and PID remain unchanged—they still show the default values.

What am I doing wrong ?
Thank you in advance for your help.

Hi @hafyzwithawhy. The UNO R4 WiFi is different from the Leonardo in that the USB capabilities are provided by the ESP32-S3 "bridge" module on the UNO R4 WiFi board.

The primary RA4M1 microcontroller on the UNO R4 WiFi is connected to the computer through that ESP-S3 rather than being connected directly to the computer as is the case with the Leonardo.

This means that the VID/PID pair are set in the "bridge" module firmware:

So you would need to modify that firmware sketch and then upload it to the ESP-S3 on the UNO R4 WiFi board

1 Like

@hafyzwithawhy I see you opened an issue on the GitHub repository to ask for help with modifying the firmware:

GitHub issues are only used to report bugs and propose enhancements. They are not an appropriate place to request assistance with your projects. The appropriate place to request assistance is here on the forum. I find it quite inexplicable that you switched over to GitHub after you were already receiving assistance here.

We can provide assistance here, but first you need to close the GitHub issue you created so that we don't waste time duplicating the efforts of those who might respond over there.

Hello @ptillisch ,

I apologize for the misunderstanding regarding the use of GitHub for asking questions. I now understand it's intended for bug reports and enhancements. I've closed the GitHub issue to avoid duplicating efforts.

Now, back to my original issue; I'm new to Arduino and am attempting to modify the existing firmware on my Arduino Uno R4, specifically the VID and PID. I downloaded the esp32-2.0.9.zipfile and tried to add it to the Arduino IDE as a ZIP library, but I received an error message, I really dont understand how I am supposed to update it with the custom firmware, I'm also uncertain about how to convert the .ino firmware file to a .bin file and then upload it to my ESP32 module.

Any guidance on these topics would be greatly appreciated.
Best regards

OK, well the first thing I should say is this is a very advanced endeavor. It is even possible you might end up putting your board into a state that makes it impossible to recover back to normal functionality. So this is definitely to be done "at your own risk" .

Disclaimer out of the way, I'll proceed to answer your questions:

It is an Arduino boards platform, not a library so this is entirely to be expected. Arduino IDE's "Add .ZIP Library..." feature is only for installing libraries.

The easiest way to install Arduino boards platforms is via the Arduino IDE Boards Manager. I'll provide instructions you can follow to install version 2.0.9 of the ESP32 boards platform using Boards Manager:

  1. Open the web page containing Espressif's official installation instructions for the ESP32 boards platform:
    https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide
  2. Copy the URL shown under the "Stable release link" section of that page.
  3. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  4. If it is not already present, add the URL you copied from the ESP32 boards platform installation instructions to the "Additional Boards Manager URLs" field.
    If there are other URLs in the field, separate them with commas (,).
  5. Click the OK button.
  6. You will now see a "Downloading index: ..." notification at the bottom right corner of the IDE window. Wait for that notification to close.
  7. Select Tools > Board > Boards Manager from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  8. Scroll down through the list of boards platforms until you see the "" entry.
  9. Click the "INSTALL" button at the bottom of the entry.
  10. Wait for the installation to finish.

You should now see the boards of the installed platform under the Tools > Board menu in Arduino IDE.

The next step after that is to apply the patches to the installed platform according to step (2) of the firmware building instructions. If you have troubles doing that, reply here on this forum topic and I'll provide assistance.

@ptillisch Thank you for the detailed guidance. I have successfully installed the platform and can now see it under the Tools > Board menu in the Arduino IDE.

I understand that proceeding with firmware modifications is a risky endeavor and I'm willing to take that risk. I'm now at step 2, where I'm supposed to apply the needed patches to the installed platform. Could you please provide a step-by-step guide on how to go about doing this? I have the patch file, but I'm not sure how to correctly apply it.
Additionally, once I've successfully applied the patch, what would be the next steps to compile and upload the sketch to my board?

Your expertise and help are much appreciated.

Update: I've successfully applied the patch to the file using Git Bash. Now that this step is complete, could you guide me through the process of compiling and uploading the sketch? What are the next steps I should follow?

I seem to have problems with applying the patch files for each step. I've gotten to the third step to run compile.sh but this is what it shows

Hi @exeryze. I see from the issue you submitted to the GitHub repository that you were able to find a solution for this "platform not found" error:

although now I'm having an entirely different issue, would you be able to walk me through this or assist me with it, much appreciated. Although when I try to run compile.sh through git, I get this error instead too

UPDATE: I got through this error by fixing my directories but now, by using the compile.sh script im getting these errors instead


UPDATE: I was able to fully run the compile.sh script without any errors by going to the unor4wifi.csv file and just leaving the subtype blank

1 Like

Update: after successfully uploading the custom firmware(Only changed the HID, PID and Name of the hardware) , I've reconnected the r4 wifi usb cable and it seems like there was an issue?

image
The device details are not the same as what I changed them to

Thank you for taking the time to post an update with your solution. I'm sure those who find this thread while searching for a solution to the same problem will be very grateful.

This VID/PID pair is produced by the ESP32-S3's ROM bootloader. Do you still have the jumper shorting the pins on the header?:

If so, unplug the USB cable, remove the jumper, then connect the USB cable again. Hopefully this time the ESP32-S3 module will produce the expected USB data.

Update: I've fixed it by using the download.sh script in the repository. Everything is now working as intended