Skip to content

Commit c54cc84

Browse files
committed
Merge pull request #1661 from pguyot/w03/add-support-for-pico2_w
Add support for Pico 2 W These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 011a8df + d2f4e4e commit c54cc84

15 files changed

+45
-12
lines changed

doc/src/build-instructions.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ After your application has been tested (_and debugged_) and is ready to put into
831831

832832
## Building for Raspberry Pi RP2
833833

834-
You can build with all boards supported by Raspberry Pi pico SDK, including Pico, Pico-W and Pico2. AtomVM also works with clones such as RP2040 Zero.
834+
You can build with all boards supported by Raspberry Pi pico SDK, including Pico, Pico W, Pico2 and Pico 2 W. AtomVM also works with clones such as RP2040 Zero.
835835

836836
### RP2 Prerequisites
837837

@@ -855,7 +855,7 @@ $ ninja
855855
You may want to build with option `AVM_REBOOT_ON_NOT_OK` so AtomVM restarts on error.
856856
```
857857

858-
### AtomVM build steps (Pico-W)
858+
### AtomVM build steps (Pico W)
859859

860860
```shell
861861
$ cd src/platforms/rp2/
@@ -869,7 +869,7 @@ $ ninja
869869
You may want to build with option `AVM_REBOOT_ON_NOT_OK` so AtomVM restarts on error.
870870
```
871871

872-
### AtomVM build steps (Pico2 or boards based on RP2350)
872+
### AtomVM build steps (Pico 2 or boards based on RP2350)
873873

874874
For ARM S platform (recommended) :
875875
```shell
@@ -894,6 +894,31 @@ $ ninja
894894
You may want to build with option `AVM_REBOOT_ON_NOT_OK` so AtomVM restarts on error.
895895
```
896896

897+
### AtomVM build steps (Pico 2 W)
898+
899+
For ARM S platform (recommended) :
900+
```shell
901+
$ cd src/platforms/rp2/
902+
$ mkdir build
903+
$ cd build
904+
$ cmake .. -G Ninja -DPICO_BOARD=pico2_w
905+
$ ninja
906+
```
907+
908+
For RISC-V platform (supported but slower) :
909+
910+
```shell
911+
$ cd src/platforms/rp2/
912+
$ mkdir build
913+
$ cd build
914+
$ cmake .. -G Ninja -DPICO_BOARD=pico2_w -DPICO_PLATFORM=rp2350-riscv
915+
$ ninja
916+
```
917+
918+
```{tip}
919+
You may want to build with option `AVM_REBOOT_ON_NOT_OK` so AtomVM restarts on error.
920+
```
921+
897922
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`.
898923

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

doc/src/getting-started-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ For information about how to flash your application to your STM32, see the [Atom
259259

260260
## Getting Started on the Raspberry Pi RP2
261261

262-
AtomVM supports deployment of the VM and applications onto boards based on Raspberry Pi RP2 socs, including RP2040 and RP2350. This includes [Raspberry Pi Pico and Pico-W](https://www.raspberrypi.com/products/raspberry-pi-pico/), as well as [Raspberry Pi Pico 2](https://www.raspberrypi.com/products/raspberry-pi-pico-2/) boards. For information about supported boards, please refer to the AtomVM [Release Notes](./release-notes.md).
262+
AtomVM supports deployment of the VM and applications onto boards based on Raspberry Pi RP2 socs, including RP2040 and RP2350. This includes [Raspberry Pi Pico and Pico W](https://www.raspberrypi.com/products/raspberry-pi-pico/), as well as [Raspberry Pi Pico 2 and Pico 2 W](https://www.raspberrypi.com/products/raspberry-pi-pico-2/) boards. For information about supported boards, please refer to the AtomVM [Release Notes](./release-notes.md).
263263

264264
The following instructions show you how to install the AtomVM onto one of the [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/) boards.
265265

doc/src/network-programming-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
# Network Programming Guide
88

9-
One of the exciting features of the ESP32 and the Pico-W is their support for WiFi networking, allowing ESP32 and Pico-W micro-controllers to communicate with the outside world over common IP networking protocols, such as TCP or IDP. The ESP32 and the Pico-W can be configured in station mode (STA), whereby the devices connect to an existing access point, as well as "softAP" mode (AP), whereby they function as an access point, to which other stations can connect. The ESP32 also supports a combined STA+softAP mode, which allows the device to function in both STA and softAP mode simultaneously.
9+
One of the exciting features of the ESP32 and the Pico W/Pico 2 W is their support for WiFi networking, allowing ESP32 and Pico W/Pico 2 W micro-controllers to communicate with the outside world over common IP networking protocols, such as TCP or IDP. The ESP32 and the Pico W/Pico 2 W can be configured in station mode (STA), whereby the devices connect to an existing access point, as well as "softAP" mode (AP), whereby they function as an access point, to which other stations can connect. The ESP32 also supports a combined STA+softAP mode, which allows the device to function in both STA and softAP mode simultaneously.
1010

11-
AtomVM provides an Erlang API interface for interacting with the WiFi networking layer on ESP32 and Pico-W devices, providing support for configuring your ESP32 or Pico-W device in STA mode, AP mode, or a combined STA+AP mode, allowing Erlang/Elixir applications to send and receive data from other devices on a network. This interface is encapsulated in the [`network` module](./apidocs/erlang/eavmlib/network.md), which implements a simple interface for connecting to existing WiFi networks or for functioning as a WiFi access point. The same `network` module is used for both the ESP32 and the Pico-W.
11+
AtomVM provides an Erlang API interface for interacting with the WiFi networking layer on ESP32 and Pico W/Pico 2 W devices, providing support for configuring your ESP32 or Pico W/Pico 2 W device in STA mode, AP mode, or a combined STA+AP mode, allowing Erlang/Elixir applications to send and receive data from other devices on a network. This interface is encapsulated in the [`network` module](./apidocs/erlang/eavmlib/network.md), which implements a simple interface for connecting to existing WiFi networks or for functioning as a WiFi access point. The same `network` module is used for both the ESP32 and the Pico W/Pico 2 W.
1212

1313
Once the network has been set up (in STA or AP mode), AtomVM can use various socket interfaces to interact with the socket layer to create a client or server application. For example, on ESP32, AtomVM supports the [`gen_udp`](./apidocs/erlang/estdlib/gen_udp.md) and [`gen_tcp`](./apidocs/erlang/estdlib/gen_tcp.md) APIs, while AtomVM extensions may support HTTP, MQTT, and other protocols built over low-level networking interfaces.
1414

@@ -18,7 +18,7 @@ This document describes the basic design of the AtomVM network interfaces, and h
1818

1919
## Station (STA) mode
2020

21-
In STA mode, the ESP32 or the Pico-W connect to an existing WiFi network.
21+
In STA mode, the ESP32 or the Pico W/Pico 2 W connect to an existing WiFi network.
2222

2323
In this case, the input configuration should be a properties list containing a tuple of the form `{sta, <sta-properties>}`, where `<sta-properties>` is a property list containing configuration properties for the device in station mode.
2424

examples/erlang/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ project(examples_erlang)
2323
include(BuildErlang)
2424

2525
add_subdirectory(esp32)
26-
add_subdirectory(rp2040)
26+
add_subdirectory(rp2)
2727

2828
pack_runnable(hello_world hello_world)
2929
pack_runnable(udp_server udp_server estdlib eavmlib)

0 commit comments

Comments
 (0)