How did I brick two Arduino Nano 33s?

I bought two Arduino Nano 33 IoT boards and both of them became unresponsive within minutes of me starting to use them. I didn't make any electrical connections to either one except to my computer with a USB cable.

The first one I just loaded my sketch and power cycled it, and nothing happened after that. The only LED that would come on is the power LED, and the computer didn't show any USB events when I plugged it in.

The second one I watched more closely. I plugged it in and saw that a serial device appeared on the computer. I tried loading an example sketch called ASCIITable then power-cycled the board and connected to the serial device with the GNU screen utility (my computer runs Ubuntu BTW). I saw an ASCII table as expected. I then tried loading my sketch and it became unresponsive as soon as I power-cycled it - only the power LED, no USB events or serial device.

So, since an example sketch works OK but my sketch apparently bricks the board, I guess this is an issue with my sketch.

This is my first Arduino sketch, and haven't done any C/C++ programming in decades, so I certainly didn't expect it to work the first time (or the fifth time) but I was surprised that apparently a sketch problem can brick the board.

So, two questions:

  1. What could have caused this sketch to brick the board, and how can I avoid this in the future? Here is my sketch - I suppose it has a multitude of problems and may not be workable at all, but the question is why did it brick the board.... Arduino Cloud

  2. Is there a practical way to revive the two dead boards? There are articles for reflashing an Uno, but they use a debugging connector which the Nano 33 apparently doesn't have. It does seem to have a 3x2 grid of solder pads, with one pad missing, so five pads. Could something like an Olimex AVR-JTAG-USB or a Sparkfun PGM-09825 re-flash the Nano through these pads? I guess I could get a 3x2 100 mil plug and stuff some pogo pins in it, unless there is a jig made for this.

You should be able to double-tap the reset button to put the board into bootloader mode, then upload a working sketch.

Your sketch gives several errors if you set compiler warnings to "all", and I see a few additional things that the compiler isn't complaining about.

Thank you, the double-tap did it! I really thought I had tried that already, and I figured I would have to buy more Nano boards, or a programmer, or both.

I was able to upload an example sketch again, and I even figured out that the online IDE has a serial communications window so I don't have to use GNU screen.

I haven't yet found a place to set a compiler warnings option in the online IDE, but I'm pretty sure I can start making progress now.

Thanks again!

david_2018:
You should be able to double-tap the reset button to put the board into bootloader mode, then upload a working sketch.

Your sketch gives several errors if you set compiler warnings to "all", and I see a few additional things that the compiler isn't complaining about.

Thanks! I got the same problem, solved with a double tap!