LowPowerLab Forum

Hardware support => Low Power Techniques => Topic started by: Uncle Buzz on October 30, 2017, 09:58:24 AM

Title: Abnormally long time to wakeup flash [SOLUTION]
Post by: Uncle Buzz on October 30, 2017, 09:58:24 AM
Hi all,
I was trying to log some data at 1 min intervalle in flash memory on my moteino R6, but I see about 40s more than expected between saves.
I tryied to find out where was the problem, and it seems than the spiflash::wakeup function is the guilty !

As I understand it, when we put flash in sleep mode (power-down mode as Winbond names it), we have to wake up the flash before trying to use it. But spiflash::wakeup function is calling spiflash::command function to send commands to the flash memory, which check and wait until the spiflash::busy function said the memory flash is available and not doing some other stuff...

the spiflash::busy function returns the "read status" register of the flash memory

But from Winbond datasheet, when in power-down mode, the read status command is ignored :
Quote
While in the power-down state only the Release Power-down /
Device ID (ABh) instruction, which restores the device to normal operation, will be recognized. All other
instructions  are  ignored.  This  includes  the  Read  Status  Register  instruction
,  which  is  always  available
during normal operation. Ignoring all but one instruction makes the Power Down state a useful condition
for securing maximum write protection. The device always powers-up  in the normal operation  with  the
standby current of ICC1.

So, I wonder if waiting than memory flash are not busy when it sleep always return false ?

Shouldn't we bypass the busy function if we are in sleep mode and we are trying to wake up the flash ?

Is there something I didn't well understood ?
Title: Re: Anormally long time to wakeup flash
Post by: Felix on October 30, 2017, 10:59:11 AM
Discussion and solution in these threads:

https://lowpowerlab.com/forum/low-power-techniques/moteino-weathernode-won't-wake-up/
https://lowpowerlab.com/forum/moteino/one-solution-to-moteino-failure-to-return-from-sleep/
Title: Re: Anormally long time to wakeup flash
Post by: Uncle Buzz on October 30, 2017, 11:50:21 AM
well, I should have check the repository of spiflash before starting this thread... this is already fixed.
I didn't though these threads were relevant since I don't use radio on my sketch.
Sorry for the inconvenience (but proud to have found same solution, even if it was waste of time...)
Title: Re: [SOLVED (a few months earlier)...]Anormally long time to wakeup flash
Post by: Felix on October 30, 2017, 04:36:07 PM
No problem, good things do happen sometimes :)