This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Run Zephyr OS for qemu_x86 and access guest Filesystem

Hi,

We're developing with Zephyr OS on nrf9160 and recently added SD Card support. We build our application also for qemu_x86 for testing purposes and would like to add some kind of filesystem support to basically fake the contents of the SD Card. Ideally this files can be accessed & manipulated from the host system.

To achieve this my current idea is to enable LittleFS on the storage partition provided by qemu_x86.dts (https://docs.zephyrproject.org/latest/samples/subsys/fs/littlefs/README.html). The second step would be to somehow make this partition accessible from outside QEMU, the host system. If this cannot be done then at least I would like to preinsert some testdata in this partition..

Has anyone already tried something similar, or can give me some advice on this matter?

best regards

Parents
  • I found a workaround process which gives me some basic testing abilities.

    1. use the cmake function "generate_inc_file_for_target"
    2. include resulting hex values in application and use the data in init function at startup
    3. write data to littleFS file using default file api
    4. the application can now use this file and I am able to run my tests

    So currently my limitation is that I am only able to modify files during build time. For my current testing purposes this is ok, not perfect but ok.
    I'm still watching https://github.com/zephyrproject-rtos/zephyr/issues/4911 and I'm still hoping to find a solution to be able to read/write files during runtime from outside qemu without having to implement some special features in the application.

Reply
  • I found a workaround process which gives me some basic testing abilities.

    1. use the cmake function "generate_inc_file_for_target"
    2. include resulting hex values in application and use the data in init function at startup
    3. write data to littleFS file using default file api
    4. the application can now use this file and I am able to run my tests

    So currently my limitation is that I am only able to modify files during build time. For my current testing purposes this is ok, not perfect but ok.
    I'm still watching https://github.com/zephyrproject-rtos/zephyr/issues/4911 and I'm still hoping to find a solution to be able to read/write files during runtime from outside qemu without having to implement some special features in the application.

Children
No Data
Related