Persistent RAM disk
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Persistent RAM disk
Has anyone ever tried to write something like a persistent RAM disk for the ESP32?
Our device has 16MB of memory and I would like to set aside some of that as a persitent RAM disk to hold various files that need to be accessed frequently and need to be present even after a soft reset. I don't need full file access functionality—I'll handle all that myself—, just a protected SPI RAM block that is not wiped upon a soft reset and that is excluded/protected from the system memory allocator.
Does anyone have any hints how to approach this on the ESP32?
Our device has 16MB of memory and I would like to set aside some of that as a persitent RAM disk to hold various files that need to be accessed frequently and need to be present even after a soft reset. I don't need full file access functionality—I'll handle all that myself—, just a protected SPI RAM block that is not wiped upon a soft reset and that is excluded/protected from the system memory allocator.
Does anyone have any hints how to approach this on the ESP32?
Re: Persistent RAM disk
I didn't know there were 128mbit psram chips available. What are you using?
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Re: Persistent RAM disk
It's a WroverB with 16MB of RAM
Re: Persistent RAM disk
Hello,StridingDragon wrote: ↑Sat Aug 03, 2019 12:17 amHas anyone ever tried to write something like a persistent RAM disk for the ESP32?
Our device has 16MB of memory and I would like to set aside some of that as a persitent RAM disk to hold various files that need to be accessed frequently and need to be present even after a soft reset. I don't need full file access functionality—I'll handle all that myself—, just a protected SPI RAM block that is not wiped upon a soft reset and that is excluded/protected from the system memory allocator.
Does anyone have any hints how to approach this on the ESP32?
Good Question.
I think it is same concept we are following into Linux System in which there are almost 1 to 2 GB in which we want to access few section of RAM as permanent disk like your requirements.
So, I am not sure that it is possible into ESP32. Need to ask to Espressif Developers.
I didn't find that type of support into IDF but ur should be there.
I have one question like why you can't use 16 MB Flash supported module into your project?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Persistent RAM disk
Ritesh wrote: ↑Sat Aug 03, 2019 11:50 amHello,StridingDragon wrote: ↑Sat Aug 03, 2019 12:17 amHas anyone ever tried to write something like a persistent RAM disk for the ESP32?
Our device has 16MB of memory and I would like to set aside some of that as a persitent RAM disk to hold various files that need to be accessed frequently and need to be present even after a soft reset. I don't need full file access functionality—I'll handle all that myself—, just a protected SPI RAM block that is not wiped upon a soft reset and that is excluded/protected from the system memory allocator.
Does anyone have any hints how to approach this on the ESP32?
I have one question like why you can't use 16 MB Flash supported module into your project?
Hi
@Ritesh
i think he mean persistent System but not RAM technic
HiStridingDragon wrote: ↑Sat Aug 03, 2019 12:17 amHas anyone ever tried to write something like a persistent RAM disk for the ESP32?
Our device has 16MB of memory and I would like to set aside some of that as a persitent RAM disk to hold various files that need to be accessed frequently and need to be present even after a soft reset. I don't need full file access functionality—I'll handle all that myself—, just a protected SPI RAM block that is not wiped upon a soft reset and that is excluded/protected from the system memory allocator.
Does anyone have any hints how to approach this on the ESP32?
The 16MB are the 16 MB of SPI Flash i think.
And you want to make from this 16 MB a persistent RAM disk for the ESP32 ?
+ "to hold various files that need to be accessed frequently and need to be present even after a soft reset."
this is no problem, you could use the SPI Flash as FS System too, you can save on this files, you can use this after a soft reset and so on.
have a look to storage examples:
- fopen could usefull for you perhabs
- FAT FS on external SPI Flash could usefull for you too
- ... many other possibles
i think you need not a persistent RAM i think you mean a possible way, to save, read, write files or data to the 16MB "Flash"
that you can use after a soft reset further more and does not be deleted..
persistent RAM
is bytewise read, write over CPU Bus
( Variables, Functions, ...)
SPI Flash
is blockwise over I/O
( Files, Data, Save Variables to Flash Disk, Read Variables from Flash Disk ..)
if you want use persistent RAM on a SPI Flash for read and write you have to do many hacks in the ESP-IDF,
but it is possible. ( Let me know if you are finnish )
I remember that we can do one way, ( read or write ) from/to SPI Flash as a "RAM" expanded system
for the esp32 but this is an other theme.
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: Persistent RAM disk
128mbit / 16MB of RAM - sure?
Do you not mean 128mbit / 16MB SPI Flash System ?
If you have 128mbit RAM ( PSRAM ) on Wrover soldered,
can you please say, which CHIP you used and where the manufacturer is?
i do not believe that is 128mbit/16MB [ps]RAM on the Wrover, but we are all want deeper learning
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Re: Persistent RAM disk
Just to clarify, when I say, 16MB of memory, I am referring to 16MB of SOM SPI RAM.
Re: Persistent RAM disk
SOM:StridingDragon wrote: ↑Sat Aug 03, 2019 5:36 pmJust to clarify, when I say, 16MB of memory, I am referring to 16MB of SOM SPI RAM.
a-> System on Module, example
b-> SOM ... example
c-> Semantic object model
d-> Self-Organizing (Feature) Maps (Kohonen Feature Maps, Teuvo Kohonen) ( AI Theme )
z-> ...
the thing are the 16MB you mentioned, i do not know just in time there are 128mbit (16MB) SPI RAM on (MP*) Market, or on ESP32 Modules / Kit *S. i know and hold in the hand 64mbit (8MB) and 32mbit (4MB).
Can you point to the IC / Manufacturer where you have the 16MB SPI RAM please.
the second is the SPI, so SOM DDRx RAM i think you not mean.
If you mean pSRAM ( SPI PSRAM ) , and you want a resistent ram disk / drive from this
you can do this,
-> init the ramdisk code one time on boot and tag it in your spi flash custom register file
-> if you need the disk / data after reboot do not power off the PSRAM if you power off the ESP32
-> on next boot you can read the flash register tag and do not again an init on psram that would be reinit by self instead then.
-> if you want clear the RAM DISK simpy power off the 16MB SPI RAM
you could help with a picture you can upload here of your 16MB of SOM SPI RAM
txs.
hope this helps
best wishes
rudi
edit: added (MP*) mean mass production
append:
edit: added Switching PSRAM Bank Modul on PicoD4Kit
the switching pSRAM Bank Modul can use 8x XXX pSRAM example 8x 128mbit = 64MB
it is programmed as extended RAM, allocated RAM and RAM Disk, same like it is mentioned here, also as Persistent RAM "DISK"
if there are onetime 16MB on Market it goes 8x16 = 128MB
the goal is to describe PSRAM Bank via OTA
and the boot get an load pointer...
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Re: Persistent RAM disk
Thanks for all the info, Rudi. It turns out, we have an 8MB RAM module with 16 MB SPI Flash. As a result, my plans have actually changed, and I will use the Flash memory for storage.
Re: Persistent RAM disk
Bear in mind that writing to flash is slow, and FATFS is slow to read and write. PSRAM is mega fast in comparison.
Last edited by jcsbanks on Tue Aug 06, 2019 8:24 pm, edited 1 time in total.