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 :
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 ?