Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uf2tool is included in device avm #44

Open
petermm opened this issue Feb 7, 2025 · 4 comments
Open

uf2tool is included in device avm #44

petermm opened this issue Feb 7, 2025 · 4 comments

Comments

@petermm
Copy link
Contributor

petermm commented Feb 7, 2025

  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..

if Keyword.get(dep.opts, :runtime, true) do

@UncleGrumpy
Copy link
Contributor

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. ;-)

@petermm
Copy link
Contributor Author

petermm commented Feb 9, 2025

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 ;-)

@UncleGrumpy
Copy link
Contributor

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.

@petermm
Copy link
Contributor Author

petermm commented Feb 13, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants