SPI Flash Init failure [SOLVED]

Started by ssmall, September 21, 2014, 11:35:45 AM

ssmall

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?

Felix

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..

ssmall

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?

Felix

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.

ssmall

Let me know if there is anything I can do on my end.

Thanks for the help

ssmall

Have you had time to look into this issue?

Felix

It's on my list, I hope to get to it soon. Sorry for the delay and thanks for the patience.

Felix

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");

ssmall

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.

Felix

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.

Felix

I am marking this as solved/closed because there was no issue detected after the return of the item.