Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

TinyWasmModule::from_twasm portable across architectures? #31

@dragonnn

Description

@dragonnn

Hi!
I tried using a program on my PC to serialize TinyWasmModule into a file and then load it on a STM32L552 into TinyWasm but it fails:

1.000610 INFO  loading twasm: 296
└─ embassy_stm32f4_examples::wasm_test::{async_fn#0} @ src/main.rs:62  
1.001403 ERROR access error: "Error { inner: Failure }"
└─ tinywasm_types::archive::{impl#2}::from_twasm::{closure#0} @ tinywasm/crates/types/src/archive.rs:62  
1.003570 INFO  loaded twasm with result: "Err(InvalidArchive)"
└─ embassy_stm32f4_examples::wasm_test::{async_fn#0} @ src/main.rs:64 

That isn't a supported use case? I am not sure where the issue lies, as far I understand rkyv should be stable across architectures (https://rkyv.org/format.html)?
If that isn't supported by rkyv maybe using postcard as an alternative format would work too?
By itself when not having to include tinywasm::parser::Parser my program is like ~15kB with is freaking amazing, but having to include the parser blows it up to like 350kB :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions