Closed X-Ryl669 closed 2 years ago
There is already a function for this. It is espfs_faccess. It's usage is slightly different from your mmap implementation. Thanks for your contribution.
/**
* \brief Get raw memory for an uncompressed open file object
*
* \return length of file or < 0 upon error
*/
ssize_t espfs_faccess(
espfs_file_t *f, /* [in] espfs file */
void **buf /** [out] doube pointer to buf */
);
How could I've missed that ? Thanks!
As far as I understand, esp-idf support
esp_partition_mmap
function, and espfs is mostly already a memory mapped filesystem. Is is possible to link both to get a partition on flash containing RO data we could access via mmap (that is getting access toespfs_file_t->raw_start
andlength
) ?I see multiple advantages to this scheme: