From 4ba25b2e612ad8fb9b901b965806dffde19bbe1f Mon Sep 17 00:00:00 2001 From: khasc <200988182+khasc@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:49:45 -0500 Subject: [PATCH 1/3] Update rp2040.mdx fix typo, move lab link earlier, add link to lf-pico-template --- docs/embedded/rp2040.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/embedded/rp2040.mdx b/docs/embedded/rp2040.mdx index 562e40e9e..ed4a60f1a 100644 --- a/docs/embedded/rp2040.mdx +++ b/docs/embedded/rp2040.mdx @@ -5,8 +5,6 @@ description: Developing LF Programs for RP2040. # Overview Lingua Franca's C-runtime supports the [Raspberry Pi RP2040](https://en.wikipedia.org/wiki/RP2040), an inexpensive microcontroller that is typically used without an operating system ("bare metal"). -A series of lab excercises have been developed for instructional use, but these also -serve as the best documentation and guide for developing programs for the RP2040. +A [series of lab exercises](https://lf-lang.org/embedded-lab/) have been developed for instructional use, but these also serve as the best documentation and guide for developing programs for the RP2040. These lab exercises use the [Pololu 3pi+ 2040 robot](https://www.pololu.com/docs/0J86), -which has an RP2040, but the exercises can be adapted to other robots and RP2040 platforms. -See the [RP2040 lab page](https://lf-lang.org/embedded-lab/) for more information. +which has an RP2040, but the exercises can be adapted to other robots and RP2040 platforms, including the Raspberry Pi Pico board. See the [Embedded Systems Labs](https://lf-lang.org/embedded-lab/) and [Template for the Lingua Franca RP2040 target platform](https://github.com/lf-lang/lf-pico-template) for more information. From 1b3ed4bc91615ec8736d28f5070826ed32006f7c Mon Sep 17 00:00:00 2001 From: khasc <200988182+khasc@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:48:05 -0500 Subject: [PATCH 2/3] Update rp2040.mdx * copyedit Overview * add Templates section ** refer to RP2350 ** PICO_BOARD ** link to SDK manual --- docs/embedded/rp2040.mdx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/embedded/rp2040.mdx b/docs/embedded/rp2040.mdx index ed4a60f1a..fc72df657 100644 --- a/docs/embedded/rp2040.mdx +++ b/docs/embedded/rp2040.mdx @@ -3,8 +3,11 @@ title: RP2040 description: Developing LF Programs for RP2040. --- # Overview -Lingua Franca's C-runtime supports the [Raspberry Pi RP2040](https://en.wikipedia.org/wiki/RP2040), -an inexpensive microcontroller that is typically used without an operating system ("bare metal"). -A [series of lab exercises](https://lf-lang.org/embedded-lab/) have been developed for instructional use, but these also serve as the best documentation and guide for developing programs for the RP2040. -These lab exercises use the [Pololu 3pi+ 2040 robot](https://www.pololu.com/docs/0J86), -which has an RP2040, but the exercises can be adapted to other robots and RP2040 platforms, including the Raspberry Pi Pico board. See the [Embedded Systems Labs](https://lf-lang.org/embedded-lab/) and [Template for the Lingua Franca RP2040 target platform](https://github.com/lf-lang/lf-pico-template) for more information. +Lingua Franca's C-runtime supports the [Raspberry Pi RP2040](https://en.wikipedia.org/wiki/RP2040), an inexpensive microcontroller that is typically used without an operating system ("bare metal"). A [series of lab exercises](https://lf-lang.org/embedded-lab/) have been developed around the [Pololu 3pi+ 2040 robot](https://www.pololu.com/docs/0J86), which is based on the RP2040. The lab serves mainly for instructional use, but is also recommended as the best documentation and guide for getting started developing for the RP2040, and may be adapted to other robots and RP2040 platforms, including the Raspberry Pi Pico boards. + +# Templates +Templates have been developed to lower the barrier to getting started with Lingua Franca on RP2040-based platforms: +* [Template for the Lingua Franca RP2040 target platform](https://github.com/lf-lang/lf-pico-template) +* [reactor-uc Raspberry Pi Pico template](https://github.com/lf-lang/lf-pico-uc-template/) + +We find that these templates are applicable to the first-generation Pico boards based on the RP2040, as well as the second-generation Pico 2 based on the software-compatible [RP2350](https://en.wikipedia.org/wiki/RP2350). Some customization is required, but in many cases, it is sufficient to set the board configuration (`PICO_BOARD`) and then let the build system automatically set the platform (`PICO_PLATFORM`). For more information, see the individual templates, and the "Platform and Board Configuration" chapter of the [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) book. From 662673746ad77c6e69b45a6afda67e2cf8dfa35c Mon Sep 17 00:00:00 2001 From: khasc <200988182+khasc@users.noreply.github.com> Date: Thu, 12 Mar 2026 22:03:20 -0400 Subject: [PATCH 3/3] Update rp2040.mdx - how to set `PICO_BOARD` --- docs/embedded/rp2040.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/embedded/rp2040.mdx b/docs/embedded/rp2040.mdx index fc72df657..69aa19181 100644 --- a/docs/embedded/rp2040.mdx +++ b/docs/embedded/rp2040.mdx @@ -10,4 +10,12 @@ Templates have been developed to lower the barrier to getting started with Lingu * [Template for the Lingua Franca RP2040 target platform](https://github.com/lf-lang/lf-pico-template) * [reactor-uc Raspberry Pi Pico template](https://github.com/lf-lang/lf-pico-uc-template/) -We find that these templates are applicable to the first-generation Pico boards based on the RP2040, as well as the second-generation Pico 2 based on the software-compatible [RP2350](https://en.wikipedia.org/wiki/RP2350). Some customization is required, but in many cases, it is sufficient to set the board configuration (`PICO_BOARD`) and then let the build system automatically set the platform (`PICO_PLATFORM`). For more information, see the individual templates, and the "Platform and Board Configuration" chapter of the [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) book. +We find that these templates are applicable to the first-generation Pico boards based on the RP2040, as well as the second-generation Pico 2 based on the software-compatible [RP2350](https://en.wikipedia.org/wiki/RP2350). Some customization is required, but in many cases, it is sufficient to set the board configuration (`PICO_BOARD`) and then let the build system automatically set the platform (`PICO_PLATFORM`). For example, suppose we want to build for the Pico 2 W. We find that `pico2_w.h` is one of the over 120 board header files under `pico-sdk/src/boards/include/boards/`. At the shell prompt, we can `export PICO_BOARD=pico2_w`, which will then be cached/latched by CMake during the first build. + +Other ways to get `PICO_BOARD` so it is seen by CMake include: +* if the template uses `nix develop`, set environment variables `shell.nix` +* if the template has integrated the Lingua Franca compiler into CMake: + * pass `PICO_BOARD` directly to `cmake`: `cmake -Bbuild -DPICO_BOARD=pico2_w`, or + * insert a line into `CMakeLists.txt`: `set(PICO_BOARD pico2_w CACHE STRING "Board type")` + +For full details, see the individual templates, and the "Platform and Board Configuration" chapter of the [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) book.