Data Persistence Issue with Data Storage Module in Multi-Module Setup Without Host Interaction #4019
Open
Description
I am encountering an issue with WAMR where data stored in a module does not persist across function calls in a multi-module setup, without any host interaction.
Setup:
- Entry Module: Host calls entry function, module manages interaction between submodules until finished.
- Data Storage Submodule: Provides functions for storing and retrieving data to and from C arrays.
- Other Submodules: import and call the storage module's get/set functions to read or write data to the arrays.
Problem:
- Modules can call the storage module’s getter and setter functions successfully.
- However, data does not persist between calls. The storage module resets to its initial state, as if a new instance is created for each function call.
- Each data retrieval returns the initial values, rather than the values previously written.
- I would guess the module instance gets deleted after every function call. (?)
Questions:
- Is this behavior expected in WAMR? Or do I probably have some kind of configuration error?
- Is there any way to achieve such a persistent data module - across multiple submodule interactions and without host intervention?
Environment:
- bare-metal microcontroller (STM32, Cortex-M4)
- WAMR 2.2.0 without WASI
Expected Behavior:
Data in the submodule should remain persistent and be accessible across all module interactions without reinitialization or host involvement.
Actual Behavior:
Data resets to the initial state following each function call.
BTW: I know I can implement a similar setup with host-controlled data/memory allocations, but in my experiment I deliberately don't want to do this.
Metadata
Assignees
Labels
No labels