You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
i2c_bus crashes VM on ESP32-C6: i2c:open/1 uses open_port which may not exist ? #17
I was asked to report the issue from users on telegram, I think that this is a bgu in atomvm_lib, but maybe its atomvm.
i2c_bus:start/1 crashes the AtomVM VM on ESP32-C6 when called. The root cause is that i2c:open/1 internally calls open_port({spawn, "i2c"},
...), which causes a fatal VM crash (Load access fault / Guru Meditation Error) on ESP32-C6. My fix is/was to use i2c:open_nif/1 directly.
Environment
Board: SparkFun Thing Plus ESP32-C6
AtomVM: v0.7.0-alpha.1 (confirmed also on current HEAD / v0.8.0-dev)
i2c:open/1 in AtomVM resolves to open_port({spawn, "i2c"}, ...). On ESP32-C6, this crashes the VM. The NIF path (i2c:open_nif/1) works correctly.
Fix
Replace the i2c:open/1 call in init/1 with i2c:open_nif/1. Also, as a heads up, i tripped up passing clock_speed_hz in my args, which i think overwrote the freq_hz in the map (oops!)
Activity