Author Topic: Abnormally long time to wakeup flash [SOLUTION]  (Read 4100 times)

Uncle Buzz

  • Full Member
  • ***
  • Posts: 146
  • Country: fr
Abnormally long time to wakeup flash [SOLUTION]
« 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 ?


Uncle Buzz

  • Full Member
  • ***
  • Posts: 146
  • Country: fr
Re: Anormally long time to wakeup flash
« Reply #2 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...)
« Last Edit: October 30, 2017, 11:54:10 AM by Uncle Buzz »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: [SOLVED (a few months earlier)...]Anormally long time to wakeup flash
« Reply #3 on: October 30, 2017, 04:36:07 PM »
No problem, good things do happen sometimes :)