Did I brick my ExpLoRer by putting it into sleep mode?

Hello,

Just ordered a whole bunch of your ExpLoRer boards and started hacking away on a quick demo. I uploaded a sketch with some sleep mode stuff on a few of my boards and I can’t reprogram them any longer.

void enterDeepSleepMode(void)
{
  // Put bluetooth to sleep
  pinMode(BLUETOOTH_WAKE, OUTPUT);
  digitalWrite(BLUETOOTH_WAKE, HIGH);

  // Put lorawan modem to sleep
  ttn.sleep(60000);

  // Deep sleep mode
  SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
  
  // Disable USB
  USB->DEVICE.CTRLA.reg &= ~USB_CTRLA_ENABLE;

  //Enter sleep mode
  __WFI();
}

Once enterDeepSleepMode() is called, it of course shuts off the USB and so I need to press the reset button while a new sketch is uploading…I’ve had to do this before for many other arduino boards and your tracker board. The issue is that it isn’t working on this board. No matter what I do (pressing reset once, twice, and every different time possible), the output of Arduino IDE looks like this now:

Dear @Zane,

Do you see a fading blue LED when you press the reset button twice?
If yes, then the board correctly goed into bootloader mode.

If your PC doesn’t recognize the COM port try:
Closing and opening Arduino
Force quit Java, or reboot your pc to let the board be recognized again.

Let me know if one of these options solves your issue,

Best regards,
Jan

So it turns out that about half of the ExpLoRer boards I ordered work and half don’t (I ordered 20 of them). Half of them when I opened them up out of the packaging and plugged them in had blinking blue LEDs and were recognized as a COM device and the other half didn’t.

The ones that aren’t working I’ve tried pressing the reset button multiple times, I’ve tried different USB cables, different USB ports, different computers and I can’t seem to get them to do anything.

The ones that are working, when I put them into sleep mode I can get them to appear temporarily in the Arduino IDE by pressing the reset button, but the only sketch that will upload successfully is a blank sketch. Afterwards I can then upload any sketch I want.

Any suggestions on getting the non-responsive ExpLoRers working?

@Zane,

With a normal reset you indeed have only time to upload a blank sketch before the board goes back into sleep.

If you double press the reset button, do you see the blue led blinking/fading?
When you see the blinking/fading blue led you should be able to upload a sketch without having to upload a blank sketch first.

Best regards,
Jan

On about half of them there was no blinking LED, even after pressing the reset button. Even the ones that worked were behaving strangely. For reference, my boards are all version 6c and I’m using the 1.6.19 library from the boards manager.

I decided to take my Atmel ICE and I burned the bootloader onto all of them. They all work perfectly now. I think these boards had an issue with the bootloader that was on them.

Dear @Zane,

I am glad to hear that burning the bootloader fixed the boards.
Thanks for sharing your solution, I have made a note that in your batch there might be some boards with a faulty bootloader.

Best regards,
Jan