- build:
cd src/platforms/rp2040/
mkdir build
cd build
cmake .. -G Ninja
ninja
Note: requires cmake and ninja
You may want to build with option AVM_REBOOT_ON_NOT_OK
so Pico restarts on
error.
To build for Pico-W, pass the board to cmake as follows:
cd src/platforms/rp2040/
mkdir build
cd build
cmake .. -G Ninja -DPICO_BOARD=pico_w
ninja
The approach consists in installing various uf2 files which include the address they should be loaded to.
You typically need three uf2 files:
AtomVM.uf2
for the VMatomvmlib.uf2
for the standard libraries- your application's uf2.
We provide an escript-based (what else?) tool to build uf2 files called
uf2tool
that you can use to bundle your avm
into uf2.
If you need to upgrade AtomVM or the standard libraries, simply copy them again.
VM binary is file src/platforms/rp2040/build/src/AtomVM.uf2
. Simply copy it
to the pico. The VM will crash because there is no application.
AtomVM library must be installed as well.
Build of standard libraries is part of the generic unix build.
From the root of the project:
mkdir build
cd build
cmake .. -G Ninja
ninja
Note: requires cmake, ninja, Erlang/OTP and Elixir for elixir libs
The library to install is build/libs/atomvmlib.uf2
This example will print a Hello Pico message repeatedly.
It is built into build/examples/erlang/rp2040/hello_pico.uf2
.
You can install it and then connect to the serial port with minicom.
You need to create an avm file using PackBEAM binary (or rebar3 plugin).
./PackBEAM packed.avm module.beam
Then the BEAM file must be converted to UF2. The VM currently expects the application to be loaded at address 0x10100000.
./uf2tool create -o packed.uf2 -s 0x10100000 packed.avm
Copy this UF2 to the Pico after you copied the VM (AtomVM.uf2
) and the
standard libraries (atomvmlib.uf2
).