board didn't work after uploaded a incompatility sketch [close]

My board unable to uploaded sketchs now. I need to recover it ASAP but I am unable to.

I planed to store a cipher in flash, so I found a library enabled me to accessing flash memory. But once I
had uploaded the sketch from the library’s example, yellowLED on board blinked frequently. I replugged
USB cable, and then all LEDs were blind as well as no corresponded COM port, never even the USB device were detected by Device Manager.

I have talking with techsupport, and they effort to assist, which they sugguest to burn the bootloader. I used USBasp and CH341A as programmer or FTDI, but failed. for FTDI, no data recived. and for prog., the board cannot be recognized. And I already double trapped reset button. I’d be greatful if you share some views.

My board is 33 BLE.
Situation like this case: https://forum.arduino.cc/index.php?topic=667985.0

Thanks all

Jim_Leung:
I already double trapped reset button.

After you did that, did the "L" LED start pulsing?

pert:
After you did that, did the "L" LED start pulsing?

No, I repeated the process several times but nothing happened still.

Please post a link to where you downloaded that library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Please tell me the name of the example you used.

I want to see if I can reproduce your problem by bricking my Nano 33 BLE, so I can then see how to fix it.

pert:
Please post a link to where you downloaded that library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

Please tell me the name of the example you used.

I want to see if I can reproduce your problem by bricking my Nano 33 BLE, so I can then see how to fix it.

The last sketch I uploaded successfully names "flash_erase_and_write". You
can download the library and sketch from the search whose keyword is "nvm", which you will get the only result. And you need add "#define NRF52840" or "#define NRF52" in sketch
I think it necessary that you made adequate preparations before do that. And I hope you can work it out.
Truy appreciate your experiment.

For anyone else interested in this subject, here's the library:

and the sketch:

That sketch does indeed brick the board. It must manage to erase the bootloader. It's funny because earlier I was doing my best to erase the bootloader on my Nano 33 BLE to reproduce your situation, doing the things I know would accomplish that with the AVR and SAMD boards I'm more familiar with, and I couldn't manage to brick the thing. But that sketch does the trick.


I'm going to share what I did to recover my Nano 33 BLE.

You'll need

  • ARM CMSIS-DAP compatible debug probe.
  • A way to make a connection to the debug probe. These usually use a 2x5 0.05" pitch header/cable.
  • A way to make the connections to the SWD pads on the Nano 33 BLE. Options:
    • Pogo adapter like https://www.sparkfun.com/products/11591
      Even with this adapter, it's a bit challenging to get the pogo pins aligned with the small test pads on the Nano 33 BLE, but if you keep at it you'll get it eventually. Better would be to have a jig like this, but if you're not going to be doing this regularly then that's probably overkill.
    • Some people have managed to use a regular 0.1" pitch 2x3 male header pressed down on the test pads to make the connections. I think that would be a bit more challenging, but it's cheap enough and something you might already have on hand.
    • Soldering wires to the test points.

Instructions

  1. Start the Arduino IDE.

  2. Select Tools > Board > Arduino Nano 33 BLE from the Arduino IDE's menus.

  3. Select Tools > Programmer > ARM CMSIS-DAP Compatible from the Arduino IDE's menus.

  4. Make the connections between the debugger/programmer and the Nano 33 BLE:

    Programmer Target
    Vref +3V3
    SWDIO SWDIO
    SWCLK SWCLK
    GND GND
    RESET RESETN

    Here's the pinout of the test pads on the Nano 33 BLE:
    Nano 33 BLE SWD1. Connect the USB cable of the programmer to your computer.

  5. Power the Nano 33 BLE (you can do this via the USB connector on the board). The debugger doesn't power the board.

  6. Select Tools > Burn Bootloader from the Arduino IDE's menus.

pert:
For anyone else interested in this subject, here's the library:
GitHub - d00616/arduino-NVM: Direct flash memory access, round robin virtual pages and EEPROM like memory.
and the sketch:
arduino-NVM/flash_erase_and_write.ino at master · d00616/arduino-NVM · GitHub

...

Definitely, you made it. It will take me some time to get compatible programmer. And thanks again.

I wonder if it's possible to connect VCC、GND and RESET with corresponded pins on 33 BLE, which I am more likely to make it. Is there potential danger?

my way for this contact points.

Nice one Juraj! Which programmer/debugger is that you're using?

Jim_Leung:
I wonder if it's possible to connect VCC、GND and RESET with corresponded pins on 33 BLE, which I am more likely to make it. Is there potential danger?

Yes. You can connect VCC to the 3.3 V pin, GND to GND, and RESET to RESET. Then you only need to connect SWDIO and SWCLK on the test points (since those are not broken out to the normal pins).

pert:
Nice one Juraj! Which programmer/debugger is that you're using?

NXP LPC-Link2.
it was available locally and has the cable with the small SWD connectors for my M0

Looks nice, with a good price too!

It works now, thanks pert and Juraj.

Way cool. Great work!

It's unfortunate your board got bricked, but at least now you will have no problems recovering it in the future, so you'll feel free to experiment.

I had been meaning to give the burn bootloader on my Nano 33 BLE a try ever since getting it a couple weeks ago, but was a bit nervous I'd end up putting my Nano 33 BLE in an unusable state so I was putting it off. This thread gave me the motivation to go for it, so I came out ahead for the experience.