Can't flash from web IDE

Hi folks,

All my attempts of flashing my core through the web ide are failing no matter if it’s a new app or a firmware update (like the deep update). After compiling a new app and starting the flash procedure, my core starts to blink in magenta and after some (long) time it automatically enters in DFU mode blinking in green.

This only happens when I try to flash OTA. Using the spark-cli I can compile and flash over USB without any problem.

What could be the problem?

Cheers,

Eric

You can try patching the core with spark flash --usb cc3000 via DFU mode and try again. :slight_smile:

hi kenneth, I actually already patched it, but I had to do it via DFU. The spark flash --usb cc3000 produces the same outcome of the web flash (ie, blinking in magenta then enter DFU mode). I guess due to the fact that it has to download the patched firmware OTA.

What I found most strange is that, once I flash a new app using the cli the core communicates without any problem with Spark REST server. All my Spark variables and functions work as expected. The only thing that I can’t do (to my knowledge) is to update my core over the air.

That shouldn’t be the case but i’m guessing that some code you wrote is causing the behavior and not permitting OTA to occur properly. If you are able to share it, we should be able to see what’s going on. :wink:

The problem is happening with any code and any firmware I try. The code I was working on was a very simple humidity sensor reading (see below) but even if I try to flash the sample blink the OTA flashing fails. However the same code gets flashed ok when using the spark cli over usb.

What get’s me confused is that only the flashing step fails. Once it it’s flashed the core does connect to the wifi successfully and interact if the Spark API server without any problem.

What exactly is the core doing when it blinks in magenta? Could be the case of the download be failing?

Also, Is it possible to set the core to use a proxy? If so I may check what is happening when it goes from magenta to green (in dfu mode).

Cheers,

ps.: you can check the code I’m running below.

int umidade = 0;
char message[20] = "inicializando";

void setup() {
    Spark.variable("umidade", &umidade, INT);
    Spark.variable("message", &message, STRING);
    pinMode(A0, INPUT);
}

void loop() {
  umidade = map(analogRead(A0), 1023, 0, 0, 100);
  strcpy(message, umidade <= 50 ?  "seco" : "umido");
  delay(200); 
}

OH! The core is blinking magenta when you perform a flash?

Each magenta blink is one packet received and you will eventually see it flashing magenta rapidly which indicates that the OTA flashing is done.

Sounds like OTA flashing is working for you then. :smiley:

Indeed it does start flashing but it looks like the flashing is interrupted or does not end properly.
After flashing magenta for some time, the core then stops and start flashing green. At this point it can be listed with dfu-util -l which indicates to me that the flashing process was not successful.

That’s weird. I’ll have to ping @dave and @will for help.

Hmm… you mentioned it fails during an auto-update, or any kind of flash, have you done the deep_update on this core yet?

Can you post a video of what the core’s main RGB led does during / after an OTA flash?

Thanks!
David

Hi guys, sorry for the long delay on replying. @Dave, after it failed the upgrade dispatched using the web IDE, I performed a manual deep_update by downloading the patched firmware from the docs site and flashing it with dfu-util.

I tried to upload some videos yesterday but I got beated by my iphone. Today I finally made it and just upload two videos showcasing my troubles. One was recorded yesterday and the other today.

There is a curious change in how core behaves from yesterday to today, but I can’t explain why. The code and process from yesterday to today were exact the same. Links are below, with short explanation about what happens.

http://youtu.be/vyxWZm37EYs: recorded 15/09. The core was running already running my app and feeding data into Spark cloud when I flashed it using the WEB IDE. It keeps blinking magenta for almost 8 minutes when it finally stops and automatically enter in DFU mode (you can save your save 07 minutes of boriness by jumping into the final 7min.).

http://youtu.be/cKBXqBKnOeY: recorded 16/09. The core is in DFU mode (from yesterday) when I first flash it using the CLI. It uploads the firmware as expected and start feeding the Spark Cloud. Then I flash the same code using the web IDE. After some minutes (only 2min) it stops blinking (and working) but does not enter in DFU mode requiring me to manually put it into DFU mode so I can flash it again.

The code used during those tests are liste below. When I flash it over usb the core runs without trouble, feeding the REST api without any trouble.

int umidade = 0;
int sensor  = 0;
char message[20] = "inicializando";

void setup() {
    Spark.variable("sensor", &sensor, INT);
    Spark.variable("umidade", &umidade, INT);
    Spark.variable("message", &message, STRING);
    pinMode(A0, INPUT);
}

void loop() {
  sensor = analogRead(A0);
  umidade = map(sensor, 1023, 0, 0, 100);
  strcpy(message, umidade <= 50 ?  "seco" : "umido");
  delay(200); 
}

Regards,

Since yesterday I have been able to Flash from the WEB IDE but the last 4 hours I am incapable of flashing, is there any issues with the sever ? or any one facing this issue, and I can’t even read my serial connection when I use spark serial monitor I seeI didn't find any cores available via serial No serial port identified, when I use the cmd line tool spark list I can see the core that its online,
The other funny thing is that when I reset the core I can access it with serial cmd line but as soon as it connects and goes into cyan mode, Am incapable of serial monitoring.
Just wrote this small code to demonstrate it.
Thanks
Meth

    int LED = D7;void setup() {
    pinMode(LED, OUTPUT);
    Serial.begin(9600);
    Serial.println("started!");
}

void loop() {
    Serial.println("Working!");
    digitalWrite(LED, HIGH);
    delay(250);
    digitalWrite(LED, LOW);
    delay(250);
}