LowPowerLab Forum

Hardware support => Moteino => Topic started by: ssmall on September 21, 2014, 11:35:45 AM

Title: SPI Flash Init failure [SOLVED]
Post by: ssmall on September 21, 2014, 11:35:45 AM
I have a Moteino with a 4Mbit flash chip.  When flash.initialize () is called most of the time it fails.  I have had this Moteino for 6+ months and it has been locking up on me recently and I have narrowed it down to the flash chip.  Is there anything I can try to determine if the flash chip is bad?  Might one of the solder connections be bad?
Title: Re: Flash Init failure
Post by: Felix on September 21, 2014, 02:17:39 PM
Can you verify you have the latest library version?
I do test all the Moteinos and verify their init and signature to make sure the mega can talk to the FLASH chip. I've never seen any of the winbond  FLASH chips fail or misbehave or be corrupted, not even a single time.
It's possible that visually I missed a bad one because of bad soldering but I'd put that at 0.1% chance. You can use a multimeter or loupe to inspect the soldering. Let me know if you have updates..
Title: Re: Flash Init failure
Post by: ssmall on September 21, 2014, 07:21:07 PM
I pulled down the latest version of the SPIFlash library and installed it.  I ran the example sketch and it ran just fine.  So it appears that the hardware is OK.

I am having trouble with the following code:

  Serial.println("Sleeping");
  Serial.flush();
  radio.sleep();
  flash.sleep();
 
  for (int i = 0; i < 1; i++)
  {
    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
  //  delay(8000);
  }
  Serial.println("Waking"); 
  flash.wakeup();
  Serial.println("Flash awake");


I never get to the flash.wakeup()

If I comment out the flash.sleep() or flash.wakeup() it does not lock up.  If I omit powerDown, it works just fine.  Am I doing something wrong?
Title: Re: Flash Init failure
Post by: Felix on September 22, 2014, 10:56:08 AM
I tried your code and I do see there's an issue. I will need to look into this some more. I'll get back with updates.
Title: Re: Flash Init failure
Post by: ssmall on September 22, 2014, 11:36:24 AM
Let me know if there is anything I can do on my end.

Thanks for the help
Title: Re: Flash Init failure
Post by: ssmall on October 29, 2014, 11:34:25 AM
Have you had time to look into this issue?
Title: Re: Flash Init failure
Post by: Felix on October 29, 2014, 03:05:30 PM
It's on my list, I hope to get to it soon. Sorry for the delay and thanks for the patience.
Title: Re: Flash Init failure
Post by: Felix on November 11, 2014, 08:59:14 PM
I've tried to duplicate this again and I can't seem to be able to.
Please try this sketch below, I've added a sleep/wakeup section in setup().
Let me know if you get past the wakeup:

  //SPIFlash sleep/wakeup testing
  radio.sleep();
  flash.sleep();
  Serial.println("Sleeping");
  Serial.flush(); 
  LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
  Serial.println("Waking");
  Serial.flush(); 
  flash.wakeup();
  Serial.println("Flash awake");
Title: Re: Flash Init failure
Post by: ssmall on November 12, 2014, 01:41:52 PM
I tried the FreezeTest sketch on the original Moteino I discovered this issue on and it still locks up.  I tried the sketch on a different Moteino and it does not lock up.
Title: Re: Flash Init failure
Post by: Felix on November 13, 2014, 09:12:17 AM
I doubt an older Moteino would have anything different hardware wise that could cause this type of thing. As long as the library is the same it should behave the same, all other things equal as well. If you are interested I can arrange a return of the unit that locks for further debugging by myself and either fix it or replace it depending on my findings. Let me know, you can email me directly about this.
Title: Re: Flash Init failure
Post by: Felix on November 19, 2014, 10:59:17 AM
I am marking this as solved/closed because there was no issue detected after the return of the item.