Skip to content

Update pico readmes with additional clarity #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/).
Expand Down
2 changes: 1 addition & 1 deletion nrfx-blink-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>'
(.venv) export TOOLCHAINS='<toolchain-identifier>'
(.venv) cmake -B build -G Ninja -DBOARD=nrf52840dk_nrf52840 -DUSE_CCACHE=0 .
(.venv) cmake --build build
```
Expand Down
5 changes: 3 additions & 2 deletions pico-blink-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>'
$ export TOOLCHAINS='<toolchain-identifier>'
$ export PICO_BOARD=pico
$ export PICO_SDK_PATH='<path-to-your-pico-sdk>'
$ export PICO_TOOLCHAIN_PATH='<path-to-the-arm-toolchain>'
$ export PICO_TOOLCHAIN_PATH='<path-to-the-arm-toolchain>' # A default `brew` install will be located at `/Applications/ArmGNUToolchain/[version]/arm-none-eabi`
$ cmake -B build -G Ninja .
$ cmake --build build
```
Expand Down
2 changes: 1 addition & 1 deletion pico-blink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>' ./build.sh
$ TOOLCHAINS='<toolchain-identifier>' ./build.sh
$ cp .build/blink.uf2 /Volumes/RP2040
```
- The green LED should now be blinking in a pattern.
2 changes: 1 addition & 1 deletion pico-w-blink-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>'
$ export TOOLCHAINS='<toolchain-identifier>'
$ export PICO_BOARD=pico_w
$ export PICO_SDK_PATH='<path-to-your-pico-sdk>'
$ export PICO_TOOLCHAIN_PATH='<path-to-the-arm-toolchain>'
Expand Down
2 changes: 1 addition & 1 deletion pico2-neopixel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>' make
$ TOOLCHAINS='<toolchain-identifier>' make
$ cp .build/release/Application.uf2 /Volumes/RP2350
```
- The RGB LED should be animating through the color wheel.
2 changes: 1 addition & 1 deletion stm32-blink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>' ./build.sh
$ TOOLCHAINS='<toolchain-identifier>' ./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.
Expand Down
2 changes: 1 addition & 1 deletion stm32-lcd-logo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Build and upload the program to flash memory of the STM:
```console
$ cd stm32-lcd-logo
$ TOOLCHAINS='<toolchain-name>' ./build.sh
$ TOOLCHAINS='<toolchain-identifier>' ./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.
Expand Down
2 changes: 1 addition & 1 deletion stm32-neopixel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>'
$ export TOOLCHAINS='<toolchain-identifier>'
$ make
$ st-flash --reset write .build/release/Application.bin 0x08000000
```
Expand Down
2 changes: 1 addition & 1 deletion stm32-uart-echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<toolchain-name>'
$ export TOOLCHAINS='<toolchain-identifier>'
$ make
$ st-flash --reset write .build/release/Application.bin 0x08000000
```
Expand Down