Electron not executing code

Hi all, my electron seems to be having some uploading issues. When I upload my code over the CLI, it says “Flash Success!” but then when I check to see how the code is doing, the previous code is still on it and the new one isn’t. The thing is, my new code has functions, and my old code’s function still appear on the Particle app after several times of refreshing and exiting out of the app. I know the board isn’t just not connected to the cloud, because on the Particle app V2 when I click signal for ten seconds, the RGB lights up accordingly. I’m wondering if I’m doing something wrong or if my board is malfunctioning.

-Thanks in advance,
Jack

1 Like

Do you know which system firmware version is on the electron?

@kennethlimcp

The firmware is 0.4.8
Even if I were to flash a new one, I don’t think it would be able to go through to the board.

Are you using the command: particle flash deviceName . ?

How did you check the system firmware?

Can you use https://build.particle.io and flash an empty app to the electron?

I checked the firmware by going into particle.build, then clicking on Devices -> my electron and it says this:

Building with firmware:
On the device: 0.4.8

and then when i upload my code to the board, I say this particle flash --serial firmware.bin

@JackD12,

ok so you are flashing the electron that is attached to your laptop?

Any reason why you are not upgrading the electron firmware?

Also, how are you compiling your code into a .bin that gets uploaded using particle flash --serial firmware.bin?

@kennethlimcp

Yes.
I press the button that’s like a cloud with an arrow pointing down. It’s next to the name of the project.
Thanks for your suggestions, I got it to work!

I have same issue with Firmware version 0.5.2. Anything I update via serial using Particle CLI has no effect! The old code on the device continue to execute!. I’ve even tried the Blinking LED sample and it does not turn the LED on even though the flash was successful according to CLI output.

Any guidance on what to do next?

Could you try flashing Tinker using DFU mode, which has better error output? particle flash --usb tinker should do the trick in DFU mode.

I already did that more than once. Also tried updating the firmware to 6.0 RC2 as well as down grading. Nothing works!

What’s the output of particle flash --usb yourFirmware.bin?

Just complied and download the Blinlking LED example and here’s the output of CLI (BTW - was done over USB-serial and not USB)

particle flash --serial firmware.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE
sending file: firmware.bin

Flash success!

The point why --usb would be better is that you’ll get better feedback of what’s actually happening.
With --serial you even get a “Flash success!” when you try to flash a Photon binary onto an Electron - which would of course not stick.

C:\Users\tracie.huang\Downloads>particle flash --usb firmware.bin
Found DFU device 2b04:d00a

Error writing firmware…Incorrect platform id (expected 10, parsed 0), use --force to override

That does explain a lot.
As expected your binary is not targeted for Electron (10) but for Core (0).
So rebuild that binary with the correct target device selected.

1 Like

That worked but now stuck in DFU mode!

Even after a reset you end up in DFU again?

If so, try to upgrade to 0.6.0-rc.2 again flashing all three system parts and finally Tinker.
After that you should be back at in breathing cyan and then you can flash your code again.

Update your CLI, then do particle update followed by particle flash --usb tinker. That should get you to a working state. Should you want to try newer firmware than the latest stable one, you should update manually by flashing the respective system parts, as mentioned by @ScruffR.

Phewww…after a lot of trial and error. It works for now :smile:

So far my experience on the electron board has been really really bad. What I could do with any other platform and IDE’s (MPLAB, PSOS, Atmel Studio included beside Arduino or RPI or Intel) this takes 10 times the work and time to do something very simple…not sure if this is a good promise of so called rapid prototype board or simply misleading. This seems an over engineered tool and platform in my opinion.

I would recommend the following

  1. A local IDE that does NOT rely on any cloud. Instead,
    Could compile, do syntax highlight, go to the error (line) with a simple click, Perhaps integration with Arduino or some other IDE would be even better.
  2. Simple firmware and embedded application update mechanism that works and consistent without 2-3 different methods and drivers and mode.
  3. Simple, preferably one page guideline of all the operation.
  4. Of course all these fancy stuff could still be relevant for people who thinks it’s helpful to them so please keep building.

Wow.