Memory is voliated when power source is detached half hour or longer [SOLVED]

When I used the example Brick An LED, it flashed successfully.

But when I detach the USB from my macbook as my power source for a long time, say half hour, my Core unit LED ( color one ) is OFF as well as D0 LED.

My only chance is factory reset and flash -usb cc3000 & tinker to claim back my device. However need several times of factory reset to claim it back.

Any Clue? Will wifi defect cause the Core Color LED Blank at reset?

Thanks.

@KennyL,
I may have a problem understanding what you are saying, sorry. Lets try this.
Are you saying that you have the simple “blink led on D7” script loaded and running ok. Then if you disconnect power for a while (half hour), when you reconnect power, the program will not start running ? It should start running! Is this what you are seeing?

You got my meaning.

And in some rare cases, when I reconnect power, it will start running again after waiting 5 to 30 minutes(varies).

https://www.dropbox.com/s/2wi3y3k9vtiym1s/core480.mp4?

So to understand, the following is true?
You have loaded the “blink led on D7” into your core. It runs fine. you can hit reset and it runs fine again.

You disconnect power (usb cable to your computer), and

  1. you reconnect power in 2 minutes, the “blink led on D7” starts running again, fine.
  2. if you reconnect power in an hour, the “blink led on D7” script does not run.

Question: do you have good WiFi / internet connection? Is the core to far away from your WiFi?
Thanks for your patience.

Yes.

I think my WIFI / internet connection is good, since my MacBook shows full bar signal.

And the router is just 3 feets far from my core / MacBook.

My router BSSID is hidden with WPA2-PSK. Should I concern this situation?

@KennyL, I am sorry, I do not know of a solution. Maybe one of the others (smarter than I) on the forum has a suggestion.

It may be helpful to know

  1. How long you have had the core?
    2 Has it had this problem since you first got it?

Anyone else have a suggestion?

Thanks for your effort.

  1. I get it at this week (Tue).
  2. I found the problem at Day 2 (Wed).

I suspect that is WIFI or CC3000 problem.

1 Like

Thanks for your effort.

  1. I get it at this week (Tue).
  2. I found the problem at Day 2 (Wed).

I suspect that is WIFI or CC3000 problem, and I tried following already.
I will try another MCU with CC3000 in same WIFI env, if I am available.

@KennyL, sorry to hear of your problem and pity that @Jack’s endeavour to help you solve your problem didn’t bear any fruit.
I wouldn’t consider myself as smarter than anybody else on this forum, but I’d still contribute my twopence worth of insight :wink:

Judgeing by the title of your topic, you suspect your Core’s flash mem to lose its content.
To establish if this is the case or not (which I’d rather think), and if it is WiFi related or not, you could try a little offline sketch like this.

SYSTEM_MODE(SEMI_AUTOMATIC)

void setup()
{
  pinMode(D7, OUTPUT);
  pinMode(D0, INPUT_PULLUP);
}

void loop()
{
  digitalWrite(D7, !digitalRead(D7));  // blink the on board LED

  if (!digitalRead(D0) && !Spark.connected())  // way out of offline mode for OTA reaflashing
  {  // to reconnect just pull D0 to GND
    Spark.connect();
    while (!Spark.connected())
    {
      SPARK_WLAN_Loop();
      delay(500);
    }
  }
  delay(500);  // 2Hz LED blink
}

If this firmware keeps blinking even after you had the Core detached, your flash is OK.
If you can reconnect to the Cloud after this, you’re fine too.
If you have to answer any of these with “NO”, we’ll have to look further.

Meanwhile you could also check some common issues, like disable 5GHz band on your router, check DHCP address range of your router, since the router might keep hold to previously leased IPs but try to hand out a new one, when the Core comes back too late and hence running out of possible IPs in its DHCP range, …
This theory can be tested by leaving the Core alone, but reboot your router once you face this problem again.

2 Likes

As a result LED still off, I try following.

  1. DFU Mode
  2. flash cc3000 to Core
  3. LED magenta then yellow.
  4. flash code / firmware as you mention.
  5. LED off.

https://www.dropbox.com/s/8gz4guh3xal57bm/Untitled.mp4?

Sorry to put you through all of this, but could you remove your Core from the breadboard.
Power the Core off a 5V wall wart.
Perform two or three (really!) factory resets in a row - no other flashing!
After this the Core should blink blue.
Try to connect the Core via SmartConfig to your network. If this doesn’t work, reattach the Core to your USB and provide the WiFi credentials via USB.
Disconnect the Core from USB and reconnect to 5V wall wart.
Try out Tinker (digitalWrite D7).

Sorry to put you through all of this, but could you remove your Core from the breadboard.
Power the Core off a 5V wall wart.

After that , my Core start flashing blue and acts normally. (no factory reset)
and tinker works on digitalWrite D7.

And now I think uplug the Core for an hour and retest again.

1 Like

Thats great if it is now working. So @ScruffR thought to take the core off of the bread board, and use another power source (rather than the USB from the laptop) solved the problem? Which of the two does it look like was causing the problem?

I think the problem is breadboard, because I try everything except remove the breadboard.
However, I think I need to reproduce the case for retesting.

I think I noticed a LED, and two resistors on the bread board. Could the LED being drawing too much current? What are the values of the resistors? Is the LED connected between D0 and D1, or just one of those?
Getting close to the reason for the problem I think.

BTW Core didn’t wake even it is naked (nothing connect).
FYI it is 1k ohm *2 resistor. LED+ D0 , LED- GND Rail

The LED/resistors should not cause any problems then.
So, do you still think the problem was from the bread board?

I suspect that you really have the LED- going to ground through the two 1k resistors.
If you have the LED hooked between D0 and ground, without the resistors, it could be drawing to much current!

BTW, I got no problem in two days, so I think it is solved.
Thank you all of your effort.

Good to hear :+1:

Just for the sake of other people experiencing something similar, have you got any idea what the actual source of the problem might have been?
It would be nice if you could quickly summarize - if possible :smile:


I’ll mark this as solved, if you don’t mind.

1 Like