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
Adds documentation about Pico `AVM_WAIT_BOOTSEL_ON_EXIT` and
`AVM_USB_WAIT_SECONDS` configuration options to "Build Instruction" and their
effects in the "AtomVM Tooling" chapter.
Signed-off-by: Winford <[email protected]>
Copy file name to clipboardExpand all lines: doc/src/atomvm-tooling.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ To use the [`atomvm_rebar3_plugin`](https://atomvm.github.io/atomvm_rebar3_plugi
30
30
* For flashing to ESP32, the [`esptool`](https://github.com/espressif/esptool) program.
31
31
* For flashing to STM32, `st-flash` via [stlink](https://github.com/stlink-org/stlink)
32
32
* (optional) A serial console program such as [minicom](https://en.wikipedia.org/wiki/Minicom) or [screen](https://en.wikipedia.org/wiki/GNU_Screen), to view console output from a device.
33
+
* (recommended) For rp2040, [`picotool`](https://github.com/raspberrypi/picotool) for software resets on Raspberry Pi Pico. (optionally used if found in PATH to disconnect active `screen` sessions, which normally prevent flashing)
33
34
34
35
### Erlang Example Program
35
36
@@ -227,7 +228,7 @@ $ rebar3 atomvm pico_flash
227
228
228
229
See the [`atomvm_rebar3_plugin`](https://atomvm.github.io/atomvm_rebar3_plugin) page for more detailed instructions about how to use the `pico_flash` target.
229
230
230
-
You can now use a serial console program such as [minicom](https://en.wikipedia.org/wiki/Minicom) or [screen](https://en.wikipedia.org/wiki/GNU_Screen) to view console output from a device.
231
+
You can now use a serial console program such as [minicom](https://en.wikipedia.org/wiki/Minicom) or [screen](https://en.wikipedia.org/wiki/GNU_Screen) to view console output from a device. The default build will wait 20 seconds for a serial connection to be established before starting the application.
@@ -249,6 +250,20 @@ You can now use a serial console program such as [minicom](https://en.wikipedia.
249
250
AtomVM finished with return value: ok
250
251
AtomVM application terminated. Going to sleep forever ...
251
252
253
+
254
+
If no connection is made before the timeout is reached the application will start, but the uart console will not be available. At this point you can use [`picotool`](https://github.com/raspberrypi/picotool) to reboot the device into `application` mode.
255
+
256
+
Example:
257
+
258
+
```shell
259
+
$ picotool reboot -f
260
+
The device was asked to reboot into application mode.
261
+
262
+
$
263
+
```
264
+
265
+
This will again give you 20 seconds to establish a serial monitor connection. For information about changing this timeout, or locking down the device so that software resets no longer work (requiring that the device be power cycled and the `BOOTSEL` button help when powering on to flash) consult the [rp2040 section](./build-instructions.md#building-for-raspberry-pi-pico) of the [Build Instructions](./build-instructions.md).
266
+
252
267
## `ExAtomVM`
253
268
254
269
The [`ExAtomVM`](https://github.com/atomvm/ExAtomVM) tool is a [mix](https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html) plugin that can be used to create and flash [Elixir](https://elixir-lang.org) applications that run over AtomVM. Using this plugin greatly simplifies the process of building Elixir applications that run over AtomVM, and is strongly encouraged for new users.
Copy file name to clipboardExpand all lines: doc/src/build-instructions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -769,6 +769,10 @@ $ ninja
769
769
You may want to build with option `AVM_REBOOT_ON_NOT_OK` so Pico restarts on error.
770
770
```
771
771
772
+
The default build configuration allows the device to be re-flashed with the `atomvm_rebar3_plugin``atomvm pico_flash` task or restarting the application after exiting using [`picotool`](https://github.com/raspberrypi/picotool). This behaviour can be changed to hang the CPU when the application exits, so that power must be cycled to restart, and `BOOTSEL` must be held when power on to flash a new application. To disable software resets use `-DAVM_WAIT_BOOTSEL_ON_EXIT=off` when configuring `cmake`.
773
+
774
+
The 20 second default timeout for a USB serial connection can be changed using option `AVM_USB_WAIT_SECONDS`. The device can also be configured to wait indefinitely for a serial connection using the option `AVM_WAIT_FOR_USB_CONNECT=on`.
775
+
772
776
### libAtomVM build steps for Pico
773
777
774
778
Build of standard libraries is part of the generic unix build.
Copy file name to clipboardExpand all lines: doc/src/getting-started-guide.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,6 +277,7 @@ Deployment of AtomVM on the Raspberry Pico platform requires the following compo
277
277
* A serial console program, such as `minicom` or `screen`, so that you can view console output from your AtomVM application.
278
278
* (recommended) For Erlang programs, [`rebar3`](https://rebar3.org);
279
279
* (recommended) For Elixir programs, [`mix`](https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html), which ships with the Elixir runtime;
280
+
* (recommended) [`picotool`](https://github.com/raspberrypi/picotool), useful for resetting the device into `BOOTSEL` or `application` mode, optionally used by the `atomvm_rebar3_plugin` (if available in env $PATH) for disconnecting active `screen` sessions when attempting to flash when still connected.
0 commit comments