I was fighting some code to pass a char array that successfully uploaded to my Nano, but causes memory corruption on run time. In turn, the sketch has bricked the Nano since as soon as I plug it in to my USB port, Windows reports a device malfunction. I can no longer upload anything
Is it possible to clear the sketch somehow independently of connecting to Windows?
The tricky thing about the boards with native USB functionality like your board is that the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running.
Fortunately, there is an easy way to recover from this situation:
Press and release the reset button on your board quickly twice. You should now see the LED on the board pulsing, which means the bootloader is running. The double press causes the bootloader to run indefinitely (until the board is reset, powered off, or an upload is done), which means you don't need to get the timing of the reset just right.
Select the port of your board from the Tools > Port menu. The port may be different when the bootloader is running so don't assume you already have the correct port selected.
Start an upload in the Arduino IDE.
The upload should now finish successfully. Of course, if you upload the same bad sketch, the same problem will likely come back, but now that you know how to recover your Nano 33 IoT, you won't have much trouble working away at it until you have found the problems in your sketch.