exatomvm
exatomvm copied to clipboard
uf2tool is included in device avm
def start do
:uf2tool.main([])
|> IO.inspect()
end
AtomVM init.
I (1419) sys: Loaded BEAM partition main.avm at address 0x250000 (size=1048576 bytes)
Starting application...
UF2 Tool: create or join UF2 binaries, for example for Raspberry Pi Pico
:ok
AtomVM finished with return value: ok
so we need to add at least runtime: false, if not only: :dev as well in mix.exs..
https://github.com/atomvm/exatomvm/blob/cbd2fb6cb3b0c614c1973919a4f43c00f4495c33/lib/mix/tasks/packbeam.ex#L163
Good catch! It did not even cross my mind that could be a possibility when I wrote the task. We should double check that the pico flash, and stm32 flash tasks are not in there too, since I also contributed those. ;-)
uf2tool is there because it's a dep.
Believe "Mix is not part of the runtime env", which is also why we have that deprecation/migration Mix.Config->Config afaik, so they should not be there..
But we should of course check ;-)
Believe "Mix is not part of the runtime env", which is also why we have that deprecation/migration Mix.Config->Config afaik, so they should not be there..
Another reason we might actually want to keep the current Mix.Config... it's guaranteed not to leek into the runtime environment.
these all currently works:
ExAtomVM.hello()
|> IO.inspect()
ExAtomVM.PackBEAM.module_info()
|> IO.inspect()
Mix.Tasks.Atomvm.Check.module_info()
|> IO.inspect()
My current thought is install instructions should include runtime: false eg:
{:exatomvm, git: "https://github.com/atomvm/ExAtomVM/", runtime: false},
that correctly gives you:
error: following modules or functions are not available on AtomVM:
* Elixir.ExAtomVM.PackBEAM:module_info/0
* Elixir.ExAtomVM:hello/0
* Elixir.Mix.Tasks.Atomvm.Check:module_info/0