Xiao rp2040 with Arduino IDE 1.8.19 upload simple sketch failed

press “R” and hold, then press “B”, upload sketch failed times!

Are you not being able to enter the bootloader mode?

I have a similar issue. As instructed from this page:XIAO RP2040 with Arduino - Seeed Wiki
If I power up with the boot button pressed, I get the RPI-RP2 disk window open. If I start the Arduino IDE version 1.8.19 then try to select a serial port, I find that the device is not present. If I plug in the XIAO-RP2040 without pressing the boot button, I can select the serial port but the IDE always fails to load the program. The message I receive is: “An error occurred while uploading the sketch” I have not found a combination that works. The board Manager version is the latest 2.7.2
Thanks for any help.
I purchased 8 of these because I could not get the SAMD XAIO version.

please refer to this wiki

Thanks for the suggestion Jay1206.
Following the instructions provided in the Wiki does not resolve the problem.
The wiki suggests:
“Long press the “B” button
Connect the XIAO to your computer
The computer will appear a disk driver.”(this is awkward english)
I take this to mean, hold the B button while connecting the XIAO to the USB cable.
This does open a disk window but the serial port does not appear.
If I disconnect the XIAO then reconnect, the port appears but I always get an error when I try to upload a sketch.
The RPI-RP2 disk window appears and after a time I get the following message:
“An error occurred while uploading the sketch”
The disk window remains open at this point and the serial port disappears.
I have tried the programming procedure with multiple rp2040 with the same result.
Thank you.
Craig Newswanger

I have the same problem as Craig on 3 different boards. I have tried on 2 different PCs with the exact same results. Let me know if anyone is able to figure this out.

That’s true! I try the board Manager version 1.9.3, the problems disappeared.

Same problem here: Board manager v2.7.2 not working.
I changed to v1.12.0 - and now I can upload code.