question: error running example script

I have an Arduino Nano 33 BLE Sense, and I am trying to run the example script, PDMSerialPlotter. When I click the Upload button it compiles the program the green LED light is solid on and the orange LED flashes on and off periodically.

It takes a long time, but then returns an error message:

Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano 33 BLE"

Sketch uses 77628 bytes (7%) of program storage space. Maximum is 983040 bytes.
Global variables use 42744 bytes (16%) of dynamic memory, leaving 219400 bytes for local variables. Maximum is 262144 bytes.
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I don't know why its not working. Under Tools:Board I selected "Arduino Nano 33 BLE" and under Tools:Port I selected COM5(Arduino Nano 33 BLE). Why isn't this working?

You could do with setting verbose and Displaying what the error detail is

Sorry for the late reply. Here is the error message with verbose turned on.

Arduino: 1.8.12 (Windows 10), Board: "Arduino Nano 33 BLE"

Sketch uses 77628 bytes (7%) of program storage space. Maximum is 983040 bytes.
Global variables use 42256 bytes (16%) of dynamic memory, leaving 219888 bytes for local variables. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM5
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
PORTS {COM3, COM4, COM5, } / {COM3, COM4, COM5, } => {}
Uploading using selected port: COM5
C:\Users\crovn\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino1/bossac.exe -d --port=COM5 -U -i -e -w C:\Users\crovn\AppData\Local\Temp\arduino_build_516387/PDMSerialPlotter_JR.ino.bin -R
An error occurred while uploading the sketch

Are you by any chance using a POWER ONLY cable ?
Are you by chance running embedded windows OS such as on some tablet type device or NUC ?
Have you ruled out USB 3.0 port issues ?

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

Are you by any chance using a POWER ONLY cable ?
I don't believe so. But I don't remember looking at the cable description when purchasing it in the store. It doesn't have any label on it. And I didn't do any mods to the cable. I tried uploading the standard blink example and it worked earlier. But I retried just now and it is also giving me the same error message.

Are you by chance running embedded windows OS such as on some tablet type device or NUC ?
No, I'm not. I'm using a standard laptop pc running Windows 10 Home.

Have you ruled out USB 3.0 port issues ?
No. How do I do this?

The other thing I forgot to mention is that I noticed that if I connect the Arduino Nano to different usb ports on my laptop that it always shows up as COM5 no mater which one it is connected. Wasn't sure if this was normal or not.

For an Arduino to carry its COM port around on a single computer is quite normal except between
different computers and then it is probably co-incidence.

Check which ports your computer has in terms of USB 2.0 and 3.0.
Try the board in the 2.0 port first.

If it still fails and you have or can borrow a POWERED USB 2.0 hub try that and connect the Arduino to the hub and the hub to the computer.
If that helps then you are one of the few that have USB 3.0 issues.

As for the cable it they can go bad quite easily especially the cheaper ones.
If you have a cell phone that uses the same connector try those cables first with your phone to make sure you can connect to your computer via the phone to be able to transfer data etc.
That would be a power and data cable.
If other cables only allow you to charge they are power only and of no use for Arduino.

Not familiar with your board but it does not react to the reset.

If your board has a reset button, press and release it when you see the lines with PORTS and see if that works.

You should be able to check in Windows device manager if the port changes when the board is reset.