From e730c98054cad9584f4fbb0e862b4bff45b4380f Mon Sep 17 00:00:00 2001 From: Michael Redig Date: Tue, 30 Jul 2024 01:46:20 -0500 Subject: [PATCH 1/3] Update pico readmes with additional clarity --- pico-blink-sdk/README.md | 2 +- pico-blink/README.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pico-blink-sdk/README.md b/pico-blink-sdk/README.md index 11012e54..ee32af42 100644 --- a/pico-blink-sdk/README.md +++ b/pico-blink-sdk/README.md @@ -25,7 +25,7 @@ $ cd pico-blink-sdk $ export TOOLCHAINS='' $ export PICO_BOARD=pico $ export PICO_SDK_PATH='' -$ export PICO_TOOLCHAIN_PATH='' +$ export PICO_TOOLCHAIN_PATH='' # A default `brew` install will be located at `/Applications/ArmGNUToolchain/[version]/arm-none-eabi` $ cmake -B build -G Ninja . $ cmake --build build ``` diff --git a/pico-blink/README.md b/pico-blink/README.md index 481362e3..e0200556 100644 --- a/pico-blink/README.md +++ b/pico-blink/README.md @@ -10,10 +10,22 @@ - Connect the Pico board via a USB cable to your Mac, and make sure it's in the USB Mass Storage firmware upload mode (either hold the BOOTSEL button while plugging the board, or make sure your Flash memory doesn't contain any valid firmware). - Make sure you have a recent nightly Swift toolchain that has Embedded Swift support. +- Before building, you need to install the python dependencies (ideally in a virtual environment): + +```console +cd swift-embedded-examples +mkdir pyenv +cd pyenv +python3 -m venv . +source bin/activate +cd ../Tools +pip3 install -r requirements.txt +``` + - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): ``` console $ cd pico-blink -$ TOOLCHAINS='' ./build.sh +$ TOOLCHAINS='' ./build.sh # toolchain-name is typically `swift` $ cp .build/blink.uf2 /Volumes/RP2040 ``` - The green LED should now be blinking in a pattern. From 39b05e36aa916a634b703e4e02ac84d80cdae66f Mon Sep 17 00:00:00 2001 From: Michael Redig Date: Sat, 10 Aug 2024 02:57:31 -0500 Subject: [PATCH 2/3] Address PR feedback --- pico-blink-sdk/README.md | 4 +++- pico-blink/README.md | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pico-blink-sdk/README.md b/pico-blink-sdk/README.md index ee32af42..c69b3d07 100644 --- a/pico-blink-sdk/README.md +++ b/pico-blink-sdk/README.md @@ -20,9 +20,11 @@ This example demonstrates how to integrate with the Pico SDK which is using CMak - Make sure you have a recent nightly Swift toolchain that has Embedded Swift support. - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): + - (determining your toolchain identifier is step 5 in this [matter tutorial](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/)) + ``` console $ cd pico-blink-sdk -$ export TOOLCHAINS='' +$ export TOOLCHAINS='' $ export PICO_BOARD=pico $ export PICO_SDK_PATH='' $ export PICO_TOOLCHAIN_PATH='' # A default `brew` install will be located at `/Applications/ArmGNUToolchain/[version]/arm-none-eabi` diff --git a/pico-blink/README.md b/pico-blink/README.md index e0200556..f15c7dbd 100644 --- a/pico-blink/README.md +++ b/pico-blink/README.md @@ -23,9 +23,10 @@ pip3 install -r requirements.txt ``` - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): + - (determining your toolchain identifier is step 5 in this [matter tutorial](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/)) ``` console $ cd pico-blink -$ TOOLCHAINS='' ./build.sh # toolchain-name is typically `swift` +$ TOOLCHAINS='' ./build.sh $ cp .build/blink.uf2 /Volumes/RP2040 ``` - The green LED should now be blinking in a pattern. From dd065a44c41549b0741e06fd97a43c7901f33362 Mon Sep 17 00:00:00 2001 From: Rauhul Varma Date: Wed, 28 Aug 2024 13:33:10 -0700 Subject: [PATCH 3/3] maintainer updates --- README.md | 21 +++++++++++++++++---- nrfx-blink-sdk/README.md | 2 +- pico-blink-sdk/README.md | 1 - pico-blink/README.md | 13 ------------- pico-w-blink-sdk/README.md | 2 +- pico2-neopixel/README.md | 2 +- stm32-blink/README.md | 2 +- stm32-lcd-logo/README.md | 2 +- stm32-neopixel/README.md | 2 +- stm32-uart-echo/README.md | 2 +- 10 files changed, 24 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 999c692a..399c00d4 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,22 @@ This repository is a set of demonstration projects of **Embedded Swift**. Embedd > [!WARNING] > Embedded Swift is experimental. Some information on this page might be out of date with latest development. -> [!IMPORTANT] -> Use the latest downloadable 'main' [Development Snapshot](https://www.swift.org/install/macos/#development-snapshots) from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift. +## Building the examples -> [!NOTE] -> This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome. +Each example in this repository contains build and deployment instructions, however there are a couple common steps needed for many of the examples included below: + +1. Install the latest downloadable 'main' [Development Snapshot](https://www.swift.org/install/macos/#development-snapshots) from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift. + + You can follow the [tutorial here](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/) for instructions on installing and using nighly Swift toolchains. + +2. Install the Python3 dependencies listed in `requirements.txt`. + + ```console + $ cd swift-embedded-examples + $ python3 -m venv .venv + $ source .venv/bin/activate + $ python3 -m pip install -r Tools/requirements.txt + ``` ## Catalog of Examples @@ -55,6 +66,8 @@ Please note that the presence of community repositories and devices in this list ## Contributing to this repository +This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome. + ### Code of Conduct Like all Swift.org projects, we would like these Embedded Swift example projects to foster a diverse and friendly community. We expect contributors to adhere to the [Swift.org Code of Conduct](https://swift.org/code-of-conduct/). diff --git a/nrfx-blink-sdk/README.md b/nrfx-blink-sdk/README.md index ad93e503..bb023efc 100644 --- a/nrfx-blink-sdk/README.md +++ b/nrfx-blink-sdk/README.md @@ -23,7 +23,7 @@ This example demonstrates how to integrate with the Zephyr SDK via CMake and how ``` console $ cd nrfx-blink-sdk $ source ~/zephyrproject/.venv/bin/activate -(.venv) export TOOLCHAINS='' +(.venv) export TOOLCHAINS='' (.venv) cmake -B build -G Ninja -DBOARD=nrf52840dk_nrf52840 -DUSE_CCACHE=0 . (.venv) cmake --build build ``` diff --git a/pico-blink-sdk/README.md b/pico-blink-sdk/README.md index c69b3d07..8bac29f5 100644 --- a/pico-blink-sdk/README.md +++ b/pico-blink-sdk/README.md @@ -20,7 +20,6 @@ This example demonstrates how to integrate with the Pico SDK which is using CMak - Make sure you have a recent nightly Swift toolchain that has Embedded Swift support. - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): - - (determining your toolchain identifier is step 5 in this [matter tutorial](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/)) ``` console $ cd pico-blink-sdk diff --git a/pico-blink/README.md b/pico-blink/README.md index f15c7dbd..a9ae654a 100644 --- a/pico-blink/README.md +++ b/pico-blink/README.md @@ -10,20 +10,7 @@ - Connect the Pico board via a USB cable to your Mac, and make sure it's in the USB Mass Storage firmware upload mode (either hold the BOOTSEL button while plugging the board, or make sure your Flash memory doesn't contain any valid firmware). - Make sure you have a recent nightly Swift toolchain that has Embedded Swift support. -- Before building, you need to install the python dependencies (ideally in a virtual environment): - -```console -cd swift-embedded-examples -mkdir pyenv -cd pyenv -python3 -m venv . -source bin/activate -cd ../Tools -pip3 install -r requirements.txt -``` - - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): - - (determining your toolchain identifier is step 5 in this [matter tutorial](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/)) ``` console $ cd pico-blink $ TOOLCHAINS='' ./build.sh diff --git a/pico-w-blink-sdk/README.md b/pico-w-blink-sdk/README.md index 07801bd1..d8a114af 100644 --- a/pico-w-blink-sdk/README.md +++ b/pico-w-blink-sdk/README.md @@ -22,7 +22,7 @@ This example demonstrates how to integrate with the Pico SDK which is using CMak - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): ``` console $ cd pico-w-blink-sdk -$ export TOOLCHAINS='' +$ export TOOLCHAINS='' $ export PICO_BOARD=pico_w $ export PICO_SDK_PATH='' $ export PICO_TOOLCHAIN_PATH='' diff --git a/pico2-neopixel/README.md b/pico2-neopixel/README.md index beca23b6..7d924f83 100644 --- a/pico2-neopixel/README.md +++ b/pico2-neopixel/README.md @@ -37,7 +37,7 @@ index f6867b5..a2291db 100644 - Build and copy the program in the UF2 format to the Mass Storage device to trigger flashing the program into memory (after which the device will reboot and run the firmware): ``` console $ cd pico2-neopixel -$ TOOLCHAINS='' make +$ TOOLCHAINS='' make $ cp .build/release/Application.uf2 /Volumes/RP2350 ``` - The RGB LED should be animating through the color wheel. diff --git a/stm32-blink/README.md b/stm32-blink/README.md index b4d0bcdf..9289f7d5 100644 --- a/stm32-blink/README.md +++ b/stm32-blink/README.md @@ -12,7 +12,7 @@ This example shows a simple baremetal firmware for an STM32 board that blinks an - Build and upload the program to flash memory of the microcontroller: ```console $ cd stm32-blink -$ TOOLCHAINS='' ./build.sh +$ TOOLCHAINS='' ./build.sh $ st-flash --reset write .build/blink.bin 0x08000000 ``` - The green LED next to the RESET button should now be blinking in a pattern. diff --git a/stm32-lcd-logo/README.md b/stm32-lcd-logo/README.md index 610cc5a3..a0b7f6f0 100644 --- a/stm32-lcd-logo/README.md +++ b/stm32-lcd-logo/README.md @@ -10,7 +10,7 @@ - Build and upload the program to flash memory of the STM: ```console $ cd stm32-lcd-logo -$ TOOLCHAINS='' ./build.sh +$ TOOLCHAINS='' ./build.sh $ st-flash --reset write .build/lcd-logo.bin 0x08000000 ``` - The LCD display on the board should now be showing a bouncing animating Swift logo on a fading background, and the user LED on should be blinking. diff --git a/stm32-neopixel/README.md b/stm32-neopixel/README.md index f0fec270..99d0b51f 100644 --- a/stm32-neopixel/README.md +++ b/stm32-neopixel/README.md @@ -24,7 +24,7 @@ We recommend including a capacitor across the LED strip power supply. - Build and upload the program to flash memory of the STM: ```console $ cd stm32-neopixel -$ export TOOLCHAINS='' +$ export TOOLCHAINS='' $ make $ st-flash --reset write .build/release/Application.bin 0x08000000 ``` diff --git a/stm32-uart-echo/README.md b/stm32-uart-echo/README.md index 98144b2d..b1b9f1d6 100644 --- a/stm32-uart-echo/README.md +++ b/stm32-uart-echo/README.md @@ -14,7 +14,7 @@ $ screen /dev/cu.usbmodem<...> 115200 - Build and upload the program to flash memory of the STM: ```console $ cd stm32-uart-echo -$ export TOOLCHAINS='' +$ export TOOLCHAINS='' $ make $ st-flash --reset write .build/release/Application.bin 0x08000000 ```