UNO R4 WIFI COM ports changing?

There's one thing I noticed after modifying the USBBridge.ino to change the HID, VID and name of my board then uploading the modified firmware. The board info completely changes again to it's original when I upload my mouse sketch that utilizes HID communication . It opens another COM port and completely closes off the previous.

Prior to this, the default COM port was COM8, COM9 for download mode, COM10 after modifying the firmware, then COM11 after uploading my HID sketch.

Below shows the spoofed USBBridge using the custom firmware
image
image

Now below shows the board after I upload the sketch mentioned.
image

Hi @exeryze. Arduino pin 21 on the RA4M1 is connected to NLASB3157 switches on the board that control whether the USB data lines are electrically connected directly to the UNO R4 WiFi's RA4M1 microcontroller or to the ESP32-S3 "bridge" module.

You adjusted the USB data produced by the "bridge" module when you installed your custom firmware, but you didn't do any modification of the USB data that is produced by the RA4M1.

The "HID" library uses the USB capabilities of the RA4M1 microcontroller, so when the board is running a sketch that uses that library (or one of the HID based libraries such as "Keyboard" or "Mouse"), it sets the NLASB3157 switches so that the RA4M1 is connected to the USB data lines. This is the reason why the changes you made to the bridge module firmware don't have any effect when an HID sketch program is running on the board.

is it okay if you guide me towards this? I have been working on this for days and haven't figured out why it's opening new COM ports each time. Thank you for the information though

UPDATE: I figured out a solution for this along with editing the boards.txt file found in the renesas boards directory. I modified the USB.cpp file found in the usb core of the board.

1 Like