Repository navigation
Migration 1 to 2
Igwe Starking edited this page Nov 18, 2026
·
1 revision
Version 2.0 has one breaking change: hardware access is now deny by default. Everything else is additive.
| 1.x | 2.0 |
|---|---|
| A module could use any pin, bus or peripheral | A new instance can use nothing until you grant it |
| Hardware imports always worked | A denied import returns DENIED (3) to the guest and the hardware is not touched |
| One privilege model | Permission bits, pin/bus/I2C-address allow-lists, a denied hook and counters |
| No threads | Optional ECCLES_WASM_ATOMICS and ECCLES_WASM_THREADS (wasi-threads) with your own spawner |
| Files only through built-in backends |
eccles_wasm_set_fs(open, read, close) for your own file source |
Add this after eccles_wasm_init() and before eccles_wasm_load():
eccles_wasm_set_hal_privilege(ECCLES_WASM_ALLOW_PIN_ALL | ECCLES_WASM_ALLOW_SAFE);That gives modules every pin plus the safe peripherals (time, random, log, and so on). Add | ECCLES_WASM_PERM_I2C or other bits if the module needs buses. See Permissions for all presets.
If you trust every module and want exactly the old behaviour, change the default in eccles_wasm_config.h:
#define ECCLES_WASM_DEFAULT_PRIVILEGE ECCLES_WASM_ALLOW_ALLDo this only when you control all the WebAssembly that runs on the device.
- Run your app. If a pin does nothing, the module was denied.
- Call
eccles_wasm_denied_count()andeccles_wasm_last_denied()after a run to see what was refused. - Or install a hook with
eccles_wasm_vm_set_denied_hook()to print each denial.
See Troubleshooting ("The module runs but nothing happens").
- Narrow grants per module: allow only pins 2 and 4, only I2C address 0x48.
- Several instances with different privileges: Instances.
- Threads: Threads and Spawner, Atomics.
- Load from any storage: Custom Filesystems.
- Loop in internal RAM:
ECCLES_WASM_EXEC_IRAM 1(Speed Tuning).
Eccles WASM 2.0.0 · MIT · Repository · Report a problem · Support ♥
Start here
Platforms
Use it
- Writing Guests
- Guest Import Reference
- Loading Modules
- Custom Filesystems
- Host Functions
- Permissions
- Instances
- Threads and Spawner
- Atomics
- Safety, Fuel and Traps
Reference
Proof
More