Getting Sensible Behavior form BLE Sense

I have been working with the TensorFlow Lite tutorials from the tensorflow repository on github, using an Arduino BLE Sense. This has been frustrating because the Arduino frequently wakes up (that is, on powering up my system) in some condition in which my system (Win 7, on a Dell Optiplex 760) is unable to communicate with it - my system reports that a "usb device is malfunctioning."

I have tried a number of different methods for ameliorating this problem, with little success.

The greatest success I have had is with the following procedure:

  1. Always load a very simple sketch to the Arduino (e.g. "blink") before shutting down the system.
  2. Start (or restart) with the Arduino connected or not.
  3. If the system fails to recognize the Arduino, switch back and forth between "normal" and "bootloader" modes until the system successfully recognizes the Arduino (could be a dozen times or more).

If I understand correctly, you're saying that sometimes the board is still not recognized even when it's in bootloader mode, with the "L" LED pulsing. Is that right?

That is correct.

That's unexpected to me.

Is this behavior specific to when you're using the tensorflow code, or does it also occur when you have Blink sketch on the board? I read that it is part of your "greatest success" strategy, but it wasn't clear to me whether the problem completely goes away once Blink is loaded, or if it only makes the problem less likely to occur.

Can we presume you have read the README's and the warnings about USB 3.x ?

ballscrewbob,

Can you be more specific as to the READMEs and usb 3.x warnings to which you refer?

By the by, I am working with a rather old Dell desktop that has no USB 3 ports.

The ones at the top of each section that are STICKIED there.

Note that some of them are specific to a section.
See the ones in the BLE sense specific section too near the bottom of the forum.

bsb,

Having (now) read the relevant posts, to the best of my understanding, I am avoiding all relevant issues.

pert,

Here is another complication which may be relevant:

As of today, I have the BLE Sense installed in a small solderless breadboard. I have successfully uploaded and run two variations of the tensorflow micro_speech sketch, and the blink sketch, each more than once, all without experiencing a lost connection.

Prior to today, I had the BLE Sense, with headers soldered in, standing, pins down, on my wooden work bench, or on a rubber mat (the kind one uses as a base when soldering electronics).

...but...wait a minute...

So, just now, with the micro_speech sketch running, I attempted to upload the blink sketch. And, after compiling, the upload failed and the IDE reports "No device found on COM12." Win7 Device Manager shows Nano 33 BLE on COM12. The Tools tab shows "Port: 'COM12 (Arduino Nano 33 BLE)'"

I tried uploading blink again, same result

I put the BLE in bootloader mode (led pulsing slowly) and it disappeared from both Device Manager and the Tools tab.

I then tried disconnecting/reconnecting the BLE several times, but no joy, until I waited about 20 seconds between disconnect and reconnect. Now it is back (in both Device Manager and Tools tab), and successfully uploaded blink twice...three times. In bootloader mode, Device Manager shows BLE on COM13, as it should.

Other possibly relevant conditions: I have a 3ft usb extension cable between my computer and the 2ft USB A to micro-USB cable that connects to the BLE Sense.

Very long and multiple USB cables can also be a factor in failure.

For long USB cables use a single good quality one preferable with a ferrite, the often seen BULGE on a cable.

Most ESD type soldering mats should be avoided when testing as they can ground things in an unwanted manner. Always test on a NON ESD NON CONDUCTIVE surface.

EDIT.

Putting the newer boards into bootloader mode will usually just swap a COM port and nothing else.
So just check that you have the correct COM port selected which would be indicated in COM & LPT ports.

bob,

I believe I have met all your criteria, non-conductive surface, ferrite on the usb cable, usb 2 port.

I am still getting the occasional communications failure, though less frequently. Communications failures are resolved consistently by disconnecting the Arduino, waiting 10-20 seconds, and reconnecting. Occasionally I have to put the Arduino in bootloader mode after re-connecting (and change the port setting in Tools->Port to reflect the port change made when the Arduino switches form normal to bootloader mode).

Bit of a p-i-t-a, but not unbearable.

Win7, Optiplex 760, IDE v 1.8.13, Nano BLE board package v 1.1.6

Make sure you have no power saving options enabled for the USB ports.

These can usually be accessed via the more advanced power options.
Here I have ALL power options OFF so everything is always fully awake and responds when asked without having to come out of any hibernation / power saving modes.
If you have it also set Javascript to maximum in advanced power savings too.

BTW the Optiplex you have was a very old model and only barely able to run win 7 coming from Vista, XP era. They benefitted greatly from additional ram and better hard drives along with almost any better display adaptor than the slow onboard.
Going ahead you may want to consider some better hardware.