I've seen a lot of post about issues with sketch upload, but haven't found my issue yet.
I'm new to arduino and I'm using a Nano BLE 33 Sense with a mac OS 10.15.4. I've been able to connect to the board and upload sketches, but a few times my computer errors out when trying to upload a sketch. It still recognizes the board and the serial port, it verifies the sketch just fine, but produces an error when uploading and states that a board can't be found.
I'm having this issue in both VSCode and Arduino IDE; the first time it happened, I was able to solve the issue by restarting the computer and programs, but no such luck this time. Any suggestions?
I think more people here have experience with the Arduino IDE. If possible, I recommend using the Arduino IDE for the troubleshooting process. It's likely the solution you find to get the Arduino IDE working will also be the solution for VSCode.
Make sure you have selected the port of your Arduino board from the Arduino IDE's Tools > Port menu. The Nano 33 BLE can change ports after the upload, so the port selection that was working fine for one upload will no longer work for the next upload because the port number changed.
Thanks for the feedback. I tried again using the Arduino IDE and the web editor with no such luck. Same issue where it verifies the sketch, the LED on the Nano starts blinking the LED (4 slow, 4 fast) then after a few minutes the error pops up saying that there is no board connected. I can post the long-form error log if that would help.
I'm glad to hear you found the solution! Thanks for taking the time to post an update.
That blink pattern is an indicator that Mbed OS has crashed. When that happens, some serial debug information is output on the TX1 pin at 115200, though it's not always very useful information. So there was something in the sketch you uploaded that caused Mbed OS to crash. Now that you know how to recover your board, you'll be able to effectively troubleshoot to find out what it is in the sketch causing the problem. One thing that can do it is using analogWrite() on too many pins at the same time.