Coder Social home page Coder Social logo

mkromfs segfault about lua-rtos-esp32 HOT 2 OPEN

progerstar avatar progerstar commented on May 28, 2024
mkromfs segfault

from lua-rtos-esp32.

Comments (2)

progerstar avatar progerstar commented on May 28, 2024 1

I've fixed it.

I've found a first strange thing in an add_entry() function
memcpy(pa_new_entry->name, name, name_len);
where name_len - filename length, but pa_new_entry->name has only 1 byte size.
so i've changed romfs_entry_t's field char name[1] to name[32]; (I didn't understand the idea, so I'm not sure I didn't break something).

And have changed the following things in the traverse() function (I think they depend on the compiler - mkromfs executes on a pc):
if (!centry) -> if (centry == NULL)
and
if (!rest) -> if (strlen(rest) == 0)

from lua-rtos-esp32.

the0ne avatar the0ne commented on May 28, 2024

The Wiki states about the ROMFS:

ROMFS is a file system, developed by the Lua RTOS team from the scratch, in which all it's data is stored together with the Lua RTOS firmware.

Although you can use other general-purpose file systems, such as SPIFFS or LFS (and mount them as read-only), the use of ROMFS has the following advantages:

There is no wasted space, since in ROMFS each file consists of a single block of data, that has the same size as the file content.
As the file system is builded and linked together with the firmware, it can be updated through OTA.
Small footprint, and minimal RAM usage (usually 1K per opened file).
ESP32 firmwares based on Lua RTOS and Lua scripts are deployed in the same way as firmwares enterely written in C.

As it says [...] each file consists of [...] the issue can't be that you include more than one file.
I've never tried to use the ROMFS so I can't give more advise than this.

from lua-rtos-esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.