Flashing via cmd

Hello, I started with my new electron today and run into a beginner problem. I am trying to get the hello world(“blink led”) programm to work.
If I flash it OTA it works fine without problems(The led on D0 blinks and the onboard led on D7 blinks). But if I try to flash it direct via cmd and the usb the led on D0 does not blink(The onboard Led on D7 does).

Here is what I do:
I copy the code from the web-developer to the desktop particle dev
Then I run in cmd

  1. particle compile electron blinkled.ino
  2. particle flash --serial electron_firmware_123542342123
    I get no errors and it tells me I sent the new firmware with success. The D7 led blinks BUT the D0 led does not.
    If I flash the same programm OTA again the D7 led and the D0 led start to blink.

Would be really nice if somebody can help a beginner here :smile:

What do you mean by the D0 led?

What do you mean by the D0 led?

In the example blink-an-led1.ino I should connect a led to D0. This is what I did. If I flash now blink-an-led1.ino OTA the led I connected to D0 blinks. But if I flash the same programm with the 2 commands I posted aboth the led connected to D0 does not blink.

int led1 = D0; // Instead of writing D0 over and over again, we'll write led1
// You'll need to wire an LED to this one to see it blink.

int led2 = D7; // Instead of writing D7 over and over again, we'll write led2
// This one is the little blue LED on your board. On the Photon it is next to D7, and on the Core it is next to the USB jack.

So my guess is that I have a problem when I compile and flash via usb. But I don´t get any errors

Do you happen to have dfu-util and the DFU drivers installed?
If so, you could try

particle flash --usb firmware.bin

this should give you some better idea if something goes wrong with the flash.
And you could post the output too.

Thank you for your help!

particle flash --usb electron_firmware_1461781721688.bin

gives me:

running dfu-util -l
Found DFU device 2b04:d00a
checking file electron_firmware_1461781721688.bin
spawning dfu-util -d 2b04:d00a -a 0 -i 0 -s 0x08080000:leave -D electron_firmware_1461781721688.bin
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

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 = 4184

Download        [                         ]   0%            0 bytes
Download        [                         ]   0%            0 bytes
Download        [======================== ]  97%         4096 bytes
Download        [=========================] 100%         4184 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!

Flash success!

Have you updated your device to 0.5.0 already?

Can you post the response for particle serial inspect?

particle serial inspect

Platform: 10 - Electron
Modules
  Bootloader module #0 - version 6, main location, 16384 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 13, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #2 - version 13, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 13
  User module #1 - version 4, main location, 131072 bytes max size
    UUID: 2AC463ACFD7E9FDF5171023D8D60AB3D0D97F3B169D557A191C906A3D2ECD06C
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #2 - version 13
  empty - factory location, 131072 bytes max size

I am not sure, how can I update ?

Hi @Gecko, Did you manage to get this working? I seem to be having the sample problem, though I haven’t yet tried flashing OTA. All my outputs seem to be the same, and likewise it appears to have 0.5.0 installed already.

Any suggestions?

Yes I managed to get it working! I think I got some kind of hardware problem. I replaced the whole setup (breadboard, resistor,led) with hardware from my own and it worked. Saddly I am a totaly beginner when it comes to electronics so I can´t give you more information here.

Thanks for that, I just did a bit more experimenting only to find out that the SIM card is actually required for code to run. I was hoping to do all my development without a SIM and just add it when required, but apparently it won’t boot properly without it. The behavior I see is that once the code is loaded, it appears to briefly start and then reset the Electron.

Anyway, all appears fine, provided the SIM is configured.

You can develop without SIM card, but you need to set another SYSTEM_MODE() than AUTOMATIC or you can also use SYSTEM_THREAD(ENABLED) (or a combination thereof)

Ahhh, yes - now that makes sense. Thanks very much for the tip, I suspected it was going to be some little setting like that.