Arduino Port Is Recognised but wont upload

My arduino wifi r4 was working just fine untill it eventually decided to switch ports randomly. Now its still automatically recognised by arduino IDE on the new port but when I try to upload or open serial monitor I get the error "No device found on COM9". The device is on the device manager as COM9 however I cannot upload. It does work when I run it in bootloader mode as it switches back to COM7 as it was before however I need it to work without bootloader since im trying to use Excel datastreamer where the port wont work anymore either. Before the ports switched I could connect it to Excel aswell.

Seems like it was a library that was causing the problem, when I removed the line "#include <HID.h>" it worked however im not sure what im doing wrong with the library.

Hi @osasus.

Great job of identifying the cause of the problem!

You aren't doing anything wrong. Unfortunately, due to the unique design of the UNO R4 WiFi board, a special upload procedure is required when the board is running a sketch program that uses its HID capabilities:

https://docs.arduino.cc/tutorials/uno-r4-wifi/usb-hid/#sketch-upload-interference

So just make sure to follow the instructions provided at the link above when you encounter this "No device found on ..." error while uploading.


The Arduino developers are tracking some ideas about how the need for a special upload procedure might be avoided here: