Docker Container USB Flashing Tool

Hi All,

I’m trying to design a good way to load firmware onto B series devices to enable testing and potentially some configuration prior to shipping to customer. We will also be loading firmware onto devices that cannot connect to cellular before they reach the customer, ie. LTE and 2g/3g devices.

I came across this on the documents page GitHub - particle-iot/node-example-device-cloud-setup: Example script for doing cloud configuration for product devices . Could I setup a Docker container with this nodejs app inside it, so that there is no setup required by a vendor if we go down the root of getting the devices setup by an assembler? I am a complete beginner with Docker and maybe there are blatant reasons why this won’t work. How are people loading firmware onto commercial devices for foreign regions or without cellular service?

Thanks

That example could run in a Docker container, however if you are looking to set up out-of-area devices, it won’t be helpful because it relies on the cloud to flash firmware to the devices.

The other way is the use something like node-example-device-flash-setup
. It flashes the devices by USB, so you can set up devices out-of-area. You might have some difficulty getting that to work in Docker, especially on a Windows host, because Docker normally doesn’t grant access to host USB devices.

1 Like

Thanks for the reply @rickkas7 .

If I want to setup an out of area device prior to sending to a customer is the following ok?

  1. Plug in B5Som to PC,
  2. Particle CLI: particle usb list , then I add the particle device number to my particle product.
  3. Local Compile in VS Code particle workbench
  4. Local Flash from VS Code
  5. Particle CLI: particle usb setup-done

When this device arrives with the customer and is powered on, will it connect and run our application? Our application uses

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

We have completed the above steps, but I was still expecting to see our application running, eg. Logs and being able to connect via BLE through our phone app. As this functionality is in our app even if a device is rebooted without an Antenna.

Is there some SIM verification that will only happen when the device first connects to the cloud that is preventing this device from running our application?

@chipmc Have you come across a need for out of area setup on your travels?

My guess is that when you flashed the code by Workbench you did not get all of the necessary dependencies. Workbench does not flash the bootloader and softdevice, for example, even if you flash application and Device OS.

When there is a missing dependency, the device boots into safe mode. The device will be blinking green , and eventually breathing magenta if a connection is available, and it will download the missing dependencies. However, your code does not run in safe mode.

To determine for sure, connect the device by USB and put it in listening mode (blinking dark blue) by holding down the MODE button and:

particle serial inspect

If there are failed dependencies, that is what happened.

1 Like

Thanks again @rickkas7

That seems to have been the problem.

Any way I could get a procedure for flashing out of area devices with all dependencies, so that we could potentially hand over flashing to an device assembler, and they can do offline testing via our ble app?

There are a couple ways to flash firmware and all dependencies by USB:

  • Using Device Restore USB from a web browser. You can use it with a custom firmware binary.
  • Using a .hex file and SWD programmer. Some contract manufacturers can program devices by SWD/JTAG and you just need to send them the hex file, which you can create using the hex file generator.
  • Using a custom tool such as the example above. That example can flash all of the necessary parts by USB from node.js.
  • Using particle update from the Particle CLI to update dependencies, though this limits the versions of Device OS you can use to the latest LTS release.