Not able to connect to Arduino

Hi,
I have 2 arduinos with the same problem, when I upload a new code it shows this error

No device found on cu.usbmodemDC5475CC01F02
Failed uploading: uploading error: exit status 1

I am using ide 2.2.1 to upload code to arduino uno R4 wifi.

when I connect the arduino from the usb port. the on light is on and the tx led is always on. I checked the system information on the mac, it doesn't detect the arduino when I connect it.

I tried to connect it directly without a hub. also tried to connect it to different usb port. didn't solve it.
I also tried to push the reset button twice the L led is blinking , but still arduino is not detected on my machine.
I know it is not the code problem because it was working fine before.

is the hardware is damaged ?

First run " Run espflash directly" (make sure that UNO R4 board is the only USB device connected to your machine) Update the connectivity module firmware on UNO R4 WiFi and once your board is detected correctly, run the firmware update.

Note: Make sure that your IDE is properly installed and all the dependencies that show up after installation are installed as well.-

Thank you so much, I have used "Use the updater script" and now code uploading is working again.

I had to use a jumper cable to connect that pin to ground. After following the instructions, I got this message: "Error: espflash::timeout"

I gave it second try with that command, and then it worked. Now I can upload sketches. Sigh of relief!