Changes not uploading

Total newbie here. I'm using Visual Studio with the Particle Workbench extension. I wrote and uploaded the Blinking LED code with a 3 second wait period. This worked 100%. Then changed the wait period to 250ms. I clicked the Compile Project button.

:::: COMPILING APPLICATION

text data bss dec hex filename
4460 112 1148 5720 1658 c:/Users/root/Documents/Particle/Blink/LED/LED/target/3.3.1/electron/LED.elf

*** COMPILED SUCCESSFULLY ***
Then flash project button
:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

text data bss dec hex filename
4460 112 1148 5720 1658 c:/Users/root/Documents/Particle/Blink/LED/LED/target/3.3.1/electron/LED.elf
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 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 = 4572
Download [=========================] 100% 4572 bytes
Download done.
File downloaded successfully

*** FLASHED SUCCESSFULLY ***
However no difference in blink time. The yellow DFU light did come on and then resumed with the 3 second blinking LED.

@Hanro ,

Welcome to the community.

Having been a newbie myself once, I have had (and continue to have) moments like this. Often it turns out to be something simple and it always ends up with me learning something.

Would you mind posting your code and let us know if you are creating your sketch as an .INO file (default approach)?

Thanks,

Chip

Yes it is an INO. I just copied the the code from the example Blink an LED hardware examples | Getting Started | Particle but used 3s in stead of 1s (wich worked) and then changed the value of 3s to 250ms. This however does not work.

// We define MY_LED to be the LED that we want to blink.
//
// In this tutorial, we're using the blue D7 LED (next to D7 on the Photon
// and Electron, and next to the USB connector on the Argon and Boron).
const pin_t MY_LED = D7;

// The following line is optional, but recommended in most firmware. It
// allows your code to run before the cloud is connected. In this case,
// it will begin blinking almost immediately instead of waiting until
// breathing cyan,
SYSTEM_THREAD(ENABLED);

// The setup() method is called once when the device boots.
void setup()
{
  // In order to set a pin, you must tell Device OS that the pin is
  // an OUTPUT pin. This is often done from setup() since you only need
  // to do it once.
  pinMode(MY_LED, OUTPUT);
}

// The loop() method is called frequently.
void loop()
{
  // Turn on the LED
  digitalWrite(MY_LED, HIGH);
  // Leave it on for one second
  delay(250ms);
  // Turn it off
  digitalWrite(MY_LED, LOW);
  // Wait one more second
  delay(250ms);
  // And repeat!
}

May be a silly question, but have you saved the altered source code before building?
I'm not sure a mere build would auto-save before initiating the actual build process.

I did not. So I saved, recompiled and flashed but no change.

@Hanro ,

I will ask this as I have made this mistake a few times.

The .INO file will auto generate a .CPP file with the same name when you compile. If you were to make a change to the .CPP file (it looks quite similar) and recompile, your changes would be overwritten.

Perhaps it would make sense to give this a try - delete the associated .CPP file, make your change, recompile and try flashing again.

Thanks,

Chip

1 Like

Still no change. I'm going to try with web workbench and also another electron and report back.

Finally got it working. Still don't know what the cause was though. Tried out a couple of different electrons without success. Tried Web IDE. Went back to Visual Studio with first electron. Updated device O/S again, checked all settings again, reflashed again and now it works. :person_shrugging: Just one of those things.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.