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 11012e54..8bac29f5 100644 --- a/pico-blink-sdk/README.md +++ b/pico-blink-sdk/README.md @@ -20,12 +20,13 @@ 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): + ``` console $ cd pico-blink-sdk -$ export TOOLCHAINS='' +$ 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..a9ae654a 100644 --- a/pico-blink/README.md +++ b/pico-blink/README.md @@ -13,7 +13,7 @@ - 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 $ cp .build/blink.uf2 /Volumes/RP2040 ``` - The green LED should now be blinking in a pattern. 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 ```