Hi.
I am building an e-Typewriter using ESP32(Lilygo t-display-s3 long). It has 16MB of flash. My plan is to save multiple text files on that flash. I want to know if the following functionality is feasible for such a microcontroller.
I want to save the texts files as they are being written( as frequently as possible).
The problem I am encountering is with the implementation using FatFS or any other file system. As far as my understanding goes one cannot insert data in the middle of a file. If that needs to be done I'd have to store the entire text, which follows the position where I am inserting something, in a buffer, delete that text from the file and then add it again after the insertion is complete. With constant saving ON this process would happen multiple times for a single editing session. That seems very unproductive given the limited number of write cycles the flash has? Is there a way to achieve this? Another idea I had was to work on the entire file in a RAM buffer and save it to the flash at the end of editing but that is not exactly what I want. Any help or advice would be appreciated.
I am building an e-Typewriter using ESP32(Lilygo t-display-s3 long). It has 16MB of flash. My plan is to save multiple text files on that flash. I want to know if the following functionality is feasible for such a microcontroller.
I want to save the texts files as they are being written( as frequently as possible).
The problem I am encountering is with the implementation using FatFS or any other file system. As far as my understanding goes one cannot insert data in the middle of a file. If that needs to be done I'd have to store the entire text, which follows the position where I am inserting something, in a buffer, delete that text from the file and then add it again after the insertion is complete. With constant saving ON this process would happen multiple times for a single editing session. That seems very unproductive given the limited number of write cycles the flash has? Is there a way to achieve this? Another idea I had was to work on the entire file in a RAM buffer and save it to the flash at the end of editing but that is not exactly what I want. Any help or advice would be appreciated.
Last edited: