[Workbench] Not flashing the firmware I think it's flashing?

I’m trying to use the VS Code Workbench to locally flash firmware that turns off the cellular device on my Electron; but after flashing, the LED on the Electron just goes back to blinking cyan and then breathing cyan, which (according to https://docs.particle.io/tutorials/device-os/led/electron/#sts=Electron) means it’s still using the cellular module to connect to the Cloud. I’m concerned that it’s not flashing the firmware that I think it’s flashing.

Here’s my .ino program:

I used the ‘Particle: Compile application (local)’ command to compile it locally
image
which generated the terminal in the previous screenshot

Now I’m using the ‘Particle: Flash application (local)’ command to flash it to my Electron
image

After flashing, the terminal shows this:

> Executing task: make -f 'C:\Users\spenc\.particle\toolchains\buildscripts\1.9.2\Makefile' flash-user -s <


:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

   text    data     bss     dec     hex filename
   4412     108    1392    5912    1718 c:/Users/spenc/Documents/Particle/Projects/test/target/1.5.0/electron/test.elf
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d00a
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08080000, size = 4520
Download        [=========================] 100%         4520 bytes
Download done.
File downloaded successfully

*** FLASHED SUCCESSFULLY ***


Press any key to close the terminal.

But after flashing, the Electron goes back to blinking cyan (connecting to the Cloud) and then breathing cyan (connected). It could be helpful to mention, the target device is not a personal device. It’s registered as a development device for a product I’m working on.

Also, I’m checking the Event Feed on the console and I’m seeing events being published from a previous firmware

Any idea why my Workbench isn’t flashing the firmware in front of me when I try the ‘Particle: Flash application (local)’ command, even though the terminal says ‘FLASHED SUCCESSFULLY’?

EDIT: I got it to flash the firmware in front of me by choosing the ‘Particle: Flash application & DeviceOS (local)’ option, instead of ‘Particle: Flash application (local)’.
image

I tried this after reading this here: https://docs.particle.io/tutorials/developer-tools/workbench/#local-build-and-flash

I don’t understand anything about these 3 paragraphs

Follow-up question:

image

Any idea why this firmware binary is created only when I input particle compile electron in the CLI, and not created when I use the command from the command palette or click the ‘Compile Project’ button in the top right?

Also, what uses that firmware binary? EDIT: My best guess is that firmware binary can be used when uploading new firmware to the Cloud console (specifically for developing a Product).

And is it necessary for that to be created when flashing new firmware to my device? EDIT: No, I’ve been able to flash locally to my device without creating the firmware .bin by choosing ‘Particle: Flash application & DeviceOS (local)’ option from the command palette :slight_smile:

I don’t think that was the root cause.
Looking at your first (not working) screenshot and the latter working one I see that you hadn’t saved your changes before compiling but later had
image
(note the dot in the file tab - this tab holds unsaved changes)

The file explorer even tells you so
image

@ScruffR Thanks for taking a look! By the “latter working one”, are you referring to the first picture in my “Follow-up question:” post? If so, just clarifying, I didn’t post that picture to show that it was now working; that whole post was a separate somewhat-related question.

Yes, I was refering to that, but even if there was no direct relation to your inital issue, chances are that you had saved the file at some point between seeing the issue and then not seeing it when building with CLI.

So my point still stands that I’d put my money not on Workbench build task vs. CLI but rather unsaved vs. saved

@ScruffR Hmm maybe I’m misunderstanding you. I just pulled up a new program, made sure it was saved, and then tried these out:

  1. Clicking the ‘Compile Project’ button

  2. Using the ‘Particle: Compile application (local)’ command

  3. Using ‘particle compile electron’ in the CLI

So, even when the .ino I’m working on is saved, I’m still seeing that only using the CLI actually creates the .bin file. Am I understanding you correctly?

Have you looked inside the target folder and therein again inside the electron folder?

obviously not :wink:

image

I’m confused - Could you elaborate?

Your screenshot clearly shows that analyze.bin was created during Particle: Compile application (local), so the assumption that only CLI would create a .bin file is false.

What’s the difference between ‘electron_firmware_1588429389905.bin’ and ‘analyze.bin’?

I’d say the name only :wink:
Have you compared the sizes?

But you can run particle binary inspect analyze.bin and particle binary inspect electron_firmware_1588429389905.bin if you see any difference.

They look to be the same size. So sounds like a difference between the different ways of compiling in the Workbench is that they put the .bin file in different places and call it different things?

Pretty much so