[issue] Workbench IDE flash issues using examples

I wanted to move the examples to the Workbench IDE as projects by creating projects for each so that I would not to use the Electron’s SIM minutes and to test the environment. I am working on a Linux system. The WebIDE flashes the examples properly. I copy the source code of a WebIDE example to the file created under the SRC directory of the project. I can compile and flash via the CLI command this file, but not this MotionPublish.bin . Neither the flash button or the >Particle: Compile application(local) command flash properly. Result is the magenta and blue LED are pulsing. I would like to get the IDE compiles to work properly. The correct device is set and the latest compiler is selected. The tools for the first example

john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$ particle serial flash MotionPublish.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE 
sending file: MotionPublish.bin
Error writing firmware: Transfer cancelled
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$ cd ..
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish$ particle serial flash electron_firmware_1554824674527.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE 
sending file: electron_firmware_1554824674527.bin
$ Flash success!
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish
Operating System:	Ubuntu 18.04.1 LTS
Computer:		Dell Precision 4600

VSCode Version Etc:	
Version: 1.32.3
Commit: a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4
Date: 2019-03-14T23:38:49.842Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-46-generic

Other extensions installed: 
	Workbench Snipelts 1.3.0
	Workbench Extension Pack for Particle Workbench 1.3.0
	Workbench Core 1.3.0 (for Particle)
	Workbench Themes 1.3.0

Run a check particle binary inspect MotionPublish.bin, particle binary inspect electron_firmware_1554824674527.bin and particle serial inspect (with the Electron in Listening Mode) and post all three results here.

BTW, you have two binaries MotionPublish.bin and electron_firmware_1554824674527.bin.
Why and which is the correct one?

electron_firmware_1554824674527.bin works, but is not generated by the Workbench IDE compile. It may have come from a cloud compile I ran. MotionPublish.bin is generated by the compile. There is also a MotionPublish.dfu file generated by the flash button compile.

john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish$ particle binary inspect electron_firmware_1554824674527.bin
electron_firmware_1554824674527.bin
 CRC is ok (3dadb2bd)
 Compiled for electron
 This is an application module number 1 at version 5
 It depends on a system module number 2 at version 1002
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish$
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$ particle binary inspect MotionPublish.bin
MotionPublish.bin
 CRC is ok (cb5a7134)
 Compiled for photon
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$ 
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$ particle serial inspect
Platform: 10 - Electron
Modules
  Bootloader module #0 - version 201, main location, 16384 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 1002, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #3 - version 1002
  System module #2 - version 1002, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 1002
      Bootloader module #0 - version 201
  System module #3 - version 1002, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #2 - version 110
  User module #1 - version 5, main location, 131072 bytes max size
    UUID: A4038BFFABB6705AE32A51365B7D9A36801ECE59ED7FE171C88CBDEDC7D4DBF4
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #2 - version 1002
  empty - factory location, 131072 bytes max size
john@john-Precision-M4600:~/ProjectsforParticleIO/WorkspacesLocal/MotionPublish/target$

This is obviously wrong and may well explain your issue :wink:

It also suggests this isn't quite so then

So just to recheck, again I selected the electron device via Particle: Configure Workspace for Device and select Electron. The indicator at the bottom of the screen shows Electron and the correct device name of EI. Yet I still get the same results blue and red magenta. I don’t know of any other way to select the Electron. I think it is selecting the photon to compile in spite of Electron being selected.

Try Particle: Clean application (local) and then build via Particle: Compile application (local) and run particle binary inspect again for the new binary (you may remove the target folder before compiling).

Can you also post a screenshot of your Workbench status bar?

I deleted the files in the target folder, cleaned application (local), and compiled application (local) and then flashed application (local). Then it worked. Then I flashed again using the flash upper right-hand corner button and it worked.
So when copying an application to a new project to the source folder, one must be sure to Particle: Configure Workspace for Device and Particle: Clean application (local). Alternatively the device can be selected from the status bar.
Thanks much.

1 Like