[Resolved] Freezing after flashing deep-update

Ok, i tried to extract the correct functions to perform factory reset over code but it’s not that straightforward because i’m calling the variable directly.

There should be some exposed functions available to perform a factory reset in user code.

Let me ping @Dave and @satishgn for some help here. :wink:

I copied the code from bootloader:

https://github.com/kennethlimcp/Spark-Snippets/blob/master/Snippets/0008%20-%20Factory%20Reset.ino

Hmm, I don’t seem to be able to compile that (I added void loop() {} just to see if that had a difference).

In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from clean.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from clean.cpp:2:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
clean.cpp: In function 'void setup()':
clean.cpp:2:3: error: 'OTA_FLASH_AVAILABLE' was not declared in this scope
#include "application.h"
^
clean.cpp:3:3: error: 'REFLASH_FROM_BACKUP' was not declared in this scope
void setup();
^
clean.cpp:4:3: error: 'USB_DFU_MODE' was not declared in this scope
void loop();
^
clean.cpp:5:3: error: 'FACTORY_RESET_MODE' was not declared in this scope
#line 1
^
make: *** [clean.o] Error 1

Error: Could not compile. Please review your code.

Do I need to include something special to be able to access those system variables?

The code isn’t working and I have @ping for help so we have to wait :smiley:

No worries - Just figured I’d post up the results.
I’m heading to bed anyways (it’s almost midnight here, and I have work in the morning), but thank you again for all your help!

1 Like

You need the latest bootloader to trigger a factory reset from an application, so that code won’t work from user-space.

@DanielBernard when did you last update your spark-cli? What do you see when you run spark --version ?

Thanks,
David

1 Like
0.3.94

I just installed it yesterday, and verified that it was updated by running

npm update -g spark-cli

EDIT: unless you meant I needed to be running the latest git version?
I suppose I could try that and see if it made a difference tonight.

1 Like

So I tried running from source, and I get the following error:

$ sudo node app.js help

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/tamotsu/Programs/spark-cli/js/bin/app.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Running nodejs version 0.10.29 (from ppa:chris-lea/node.js).

Copying the app.js file from the js directory into the bin directory and rerunning results in:

$ sudo node app.js help

module.js:340
    throw err;
          ^
Error: Cannot find module 'xtend'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/tamotsu/Programs/spark-cli/js/settings.js:31:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

I honestly don’t think that the deep update broke anything.

There must be something not allowing the core to enter Listening Mode.

Let me try to get the code to wipe all the Wifi profile for you :slight_smile:

EDIT

I tried the code which is supposed to trigger the deleting of Wifi Profiles and it wasn’t working.

Someone else has to take over from here. @Teke, you might want to bring this offline :wink:

Thanks again for all your help and suggestions - I sure appreciate it.

1 Like

Hi @DanielBernard,

We’ll get you back on track! :slight_smile: If you want to run the spark-cli from source, don’t forget to install dependencies with:

cd spark-cli/js
npm install

Thanks!
David

Thanks Dave, I did indeed forget to install (npm install) before running the commands.
After a successful install, I attempted reflashing, with the same results.
The .webm’s linked below detail the results of different attempts.

CC3000 flash
Deep Update flash
Factory Reset flash
Tinker flash

@DanielBernard,

It seems from the video that your core is somehow breathing white. Am i right to say that?

Indicating that there’s some communication issue with the CC3000 module.

Let us know if it’s indeed breathing/blink white :wink:

Hi @DanielBernard,

Thank you for posting those videos, but they cut off right as they were getting to the good part, a few seconds after the flash / while the core is trying to get online… :smiley: Any chance you could post the 10-15 seconds after the core starts up while it’s trying to get on the network?

Thanks!
David

You know, I didn’t notice before, but you would correct in saying that it is breathing white instead of cyan.

After the flashing, it either blinks purple until the device is re-flashed, breathes white, or blinks white if factory reset.

1 Like

I’d be happy to re-record the videos when I get home tonight

1 Like

Again confirming that it is flashing/breathing white.
[CC3000 flash][1]
[Deep Update flash][2]
[Factory Reset flash][3]
[Tinker flash][4]

[1]: http://a.pomf.se/hhhnay.webm
  [2]: http://a.pomf.se/lhfhyo.webm
  [3]: http://a.pomf.se/datyjy.webm
  [4]: http://a.pomf.se/kqhugh.webm

Breathing white indicates communication issues between the CC3000 WiFi module and the STM32.

Maybe @Teke can see what can be done since there isn’t much troubleshooting that can be done. (IMO)

What i do with some faulty cores is to heat them up with a hair-dryer manual for just few seconds.

They will power up blinking blue after i do that :stuck_out_tongue:

1 Like

HI there, @DanielBernard - Why don’t you drop me a line at hello@spark.io and we’ll get you into the pipeline for a replacement - please reference this thread and we’ll get you taken care of quickly.

Thanks!

1 Like

Thanks @Teke,
I just sent the email now.

Again, I really appreciate all your help @Everyone_in_this_thread.

EDIT:
Marked topic [Resolved], as I will work through the hello@spark.io contact address to finalize resolution.

5 Likes

Hello,

Just shortly reviving this thread in which I found the exact problem that I am experiencing since a couple of days and could not find a solution. First I though having a problem with my code compatibility after some updates to the web ide and firmare of the core i have been using with xivley successfully for about 1 year and then stopped posting data onto the xivley feed. I thinkl it was breathing cyan but not connected to the web.

It turned out that the core is directly breathing cyan/white after every boot and flashing firmware and tinker over CLI but the it directly returns to breathing cyan and I can´t get the core into listening mode. It just freezes whith a solid white when pressing the mode button for a couple of seconds.

It seems to me beeing the same than describe above.

-DFU Mode works
-Flashing over USB with CLI works

But entering listening mode is not possible anymore.

I though I just try my luck and maybe there have been some new insights to this since last post?

Kind regards