2022-09-06 12:57 PM
My chipset is a STM32L4R9 and I have Nor Flash SPI chip used for file storage (FileX, LevelX, QuadSPI capable). My application is battery powered device. It wakes up reads some IO, logs to flash file system, sets RTC Wakeup timer and goes to sleep.
Before I enter low power mode (Stop 1 or Stop 2) should I call fx_media_close()?
In Stop 1 and Stop 2 the SRAM is preserved however OCTOSPI peripheral is not available.
Fx_media_open() takes about 1 minute to complete and I would like to avoid this if possible.
Thanks,
2022-09-21 02:19 AM
hi,
Yes is necessary to call fx_media_close() before entering in low-power mode.
So, to avoid opening the media fx_media_open() in 1 minute it is necessary to restore (enable) the clock (PLL, msi) after low power.
2022-09-21 06:37 AM
2022-09-21 08:26 AM
Hi @MFARH.1
THank you for your help. Let me restate what I understood from your comment.
I think you are saying that if I restore the clocks (PLL, MSI) after exiting low power mode I can avoid having to call fx_media_open after waking from sleep. Is that correct?
Here is how I understand the sequence of events for the processor (and the flash media)
There is no need to keep calling the fx_media_open() in my list if I understood you correctly
Thanks,
Martin
2022-09-21 08:43 AM
hi @MD'Si.1
Here is the scenario:
1 Open Nor Flash media. “nor_disk�?
2 Open a file and write data.
3 Flush media
4 Close Nor Flash media. “nor_disk�?
5 Enter STOP mode.
6 Wakup from STOP mode.
7 Configure clocks for PLL, msi
8 Open Nor Flash media. “nor_disk�?
9 Open a file and read data.
10 Close Nor Flash media. “nor_disk�?
Thanks,
Maher
2022-09-21 09:17 AM
hi @MFARH.1,
So it seems I have to perform fx_media_open on every wakeup. Do you know if there are ways (Compiler defines) to reduce the time it takes to perform the fx_media_open?
I have not looked through all the code for fx_media_open but I assume the time to open media is dependent on at least:
Are there any other factors?
Thanks