Skip to content

Commit 058db82

Browse files
authored
Doc update2 (#143)
Some clean up
1 parent 1159c14 commit 058db82

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed

Sources/EmbeddedSwift/Documentation.docc/CompilerDetails/ABI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The layout of Embedded Swift's class metadata is *different* from full Swift:
3030
- The **destructor pointer** is stored at **offset 1**. This function is invoked by Swift's deallocator when the class instance is destroyed.
3131
- The **ivar destroyer** is stored at **offset 2**. This function is invoked to destroy instance members when creation of the object is cancelled (e.g. in a failable initializer).
3232
- Lastly, the **vtable** is stored at **offset 3**: For each Swift class in the class's inheritance hierarchy, in order starting
33-
from the root class and working down to the most derived class, the function pointers to the implementation of every method of the class in declaration order in stored.
33+
from the root class and working down to the most derived class, the function pointers to the implementation of every method of the class in declaration order is stored.
3434

3535
### Witness Tables ABI
3636

Sources/EmbeddedSwift/Documentation.docc/CompilerDetails/Status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Implementation status of compiler and language features in Embedded Swift, compa
1616
| Metatypes | No, currently only allowed as unused arguments (type hints) |
1717
| Untyped throwing | No, intentionally unsupported long-term (typed throwing should be used instead) |
1818
| Weak references, unowned references | No |
19-
| Non-final generic class methods | No, intentionally unsupported long-term, see <[Embedded Swift -- Non-final generic methods](NonFinalGenericMethods.md)>|
19+
| Non-final generic class methods | No, intentionally unsupported long-term, see <doc:NonFinalGenericMethods>|
2020
| Parameter packs (variadic generics) | No, not yet supported |
2121

2222
## Embedded Standard Library Breakdown

Sources/EmbeddedSwift/Documentation.docc/GettingStarted/Introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ It's also a good mental model to think of the Swift compiler in Embedded Swift m
2222
This results in properties that are a great fit for embedded software development:
2323

2424
- **Small binaries** that can be as tiny as a few hundred bytes for "Hello World"-like programs (fully self-contained).
25-
- **No hidden runtime costs** – Embedded Swift's runtime library does not manage any data structures behind your back, is itself less than a kilobyte in size, and it eligible to be removed if unused.
25+
- **No hidden runtime costs** – Embedded Swift's runtime library does not manage any data structures behind your back, is itself less than a kilobyte in size, and is eligible to be removed if unused.
2626
- **No hidden allocations** which would cause unpredictable performance cliffs.
2727
- **Full C/C++ interoperability** to directly interact with existing C libraries and hardware-specific code, making it easy to integrate with vendor SDKs.
2828
- **Modern language features** like optionals, generics, and strong type safety are all available in Embedded Swift.
@@ -41,7 +41,7 @@ For a detailed introduction and motivation into Embedded Swift, please see "[A V
4141

4242
The Swift toolchain has the ability to produce code for almost any standard ARM and RISC-V platform, and that makes Embedded Swift versatile and not limited to specific platforms or hardware devices. This way, Embedded Swift can potentially target many different microcontroller families and embedded devices.
4343

44-
Boards with active community support include the Raspberry Pi Pico, various STM32 development boards, and several ESP32 variants, with more platforms being regularly added as the community grows.
44+
Boards with active community support include the Raspberry Pi Pico, various STM32 development boards, various nRF52840 based boards and several ESP32 variants, with more platforms being regularly added as the community grows.
4545

4646
## Interoperability with existing SDKs
4747

Sources/EmbeddedSwift/Documentation.docc/GettingStarted/LanguageSubset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ Note that there are no behavior changes in Embedded Swift compared to full Swift
2727

2828
## Further resources
2929

30-
The above lists are describing features that are removed from Embedded Swift *by design*. Since Embedded Swift is currently an experimental preview, there might also be features that are not yet implemented. See the in-development status at [Embedded Swift -- Status](EmbeddedSwiftStatus.md).
30+
The above lists are describing features that are removed from Embedded Swift *by design*. Since Embedded Swift is currently an experimental preview, there might also be features that are not yet implemented. See the in-development status at <doc:Status>.

Sources/EmbeddedSwift/Documentation.docc/GuidedExamples/PicoGuide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ export PICO_SDK_PATH=... # location to your Pico SDK
2323
$ export PICO_TOOLCHAIN_PATH=... # location to the Arm Embedded Toolchain
2424
```
2525

26-
If you have the Wi-Fi enabled Pico W board instead of the regular Pico, note that you will need a slightly different setup described in the [Pico W example project](https://github.com/apple/swift-embedded-examples/tree/main/pico-w-blink-sdk), and just specifying `PICO_BOARD=pico_w` is not going to work.
26+
If you have the Wi-Fi enabled Pico W board instead of the regular Pico, note that you will need a slightly different setup described in the [Pico W example project](https://github.com/apple/swift-embedded-examples/tree/main/rpi-picow-blink-sdk), and just specifying `PICO_BOARD=pico_w` is not going to work.
2727

2828
Install [CMake 3.29](https://cmake.org/) or newer.
2929

@@ -48,8 +48,8 @@ bin/ libexec/
4848

4949
## Building a "blinky" embedded app
5050

51-
The standard "Hello, World" in embedded development is a program that repeatedly blinks an LED. Let's build one. The following setup can be also found in [swift-embedded-examples](https://github.com/apple/swift-embedded-examples/blob/main/pico-blink-sdk/README.md), but we're going to show below that all you need is just three files.
52-
Let's create a new empty directory and prepare a simple structure for a CMake-based project that can be used on top the Pico SDK:
51+
The standard "Hello, World" in embedded development is a program that repeatedly blinks an LED. Let's build one. The following setup can be also found in [swift-embedded-examples](https://github.com/apple/swift-embedded-examples/blob/main/rpi-pico-blink-sdk/README.md), but we're going to show below that all you need is just three files.
52+
Let's create a new empty directory and prepare a simple structure for a CMake-based project that can be used on top of the Pico SDK:
5353

5454
```
5555
embedded-swift-tutorial

Sources/EmbeddedSwift/Documentation.docc/GuidedExamples/STM32BaremetalGuide.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,14 @@ $ brew install stlink
350350
$ st-info --probe
351351
... TODO
352352
$ brew install minicom
353-
$ minicom
354-
... TODO
353+
$ minicom --version
354+
minicom version 2.10 (compiled Feb 22 2025)
355+
Copyright (C) Miquel van Smoorenburg.
356+
357+
This program is free software; you can redistribute it and/or
358+
modify it under the terms of the GNU General Public License
359+
as published by the Free Software Foundation; either version
360+
2 of the License, or (at your option) any later version.
355361
```
356362

357363
Then let's fetch the elf2hex tool:

Sources/EmbeddedSwift/Documentation.docc/SDKSupport/Baremetal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ void ResetISR(void) {
120120
}
121121
```
122122
123-
Both these code snippets are not fully functional, they are only demonstrating the complexity of what the linker script and startup code need to do to initialize handle global variables.
123+
Both these code snippets are not fully functional, they are only demonstrating the complexity of what the linker script and startup code need to do to initialize global variables.
124124
125-
Tip: If this handling is not done correctly, a typical symptom is that global variables "don't work", i.e. reading from them doesn't yield the right value, and writing to them doesn't persist. A good way to double check this is by using a debugging a dumping memory at runtime and checking if it matches the virtual memory layout of the ELF file.
125+
Tip: If this handling is not done correctly, a typical symptom is that global variables "don't work", i.e. reading from them doesn't yield the right value, and writing to them doesn't persist. A good way to double check this is by using a debugger, dumping memory at runtime and checking if it matches the virtual memory layout of the ELF file.
126126
127127
## Vector table and interrupts
128128
@@ -167,7 +167,7 @@ To build an Embedded Swift baremetal project with SwiftPM, you will need a setup
167167

168168
- Your main application target defined in Package.swift.
169169
- A helper C code helper target defined in Package.swift - this will contain your C startup code, vector table and possibly an assembly file.
170-
- Invoke `swift build` with a `--triple` argument that specifies.
170+
- Invoke `swift build` with a `--triple` argument that specifies the target CPU architecture and output object file format.
171171
- Use a `toolset.json` file that defines the common Swift and C compilation flags, and linking flags. This will e.g. enable the Embedded Swift mode when compiling Swift code, and point the linker at the right linker script.
172172

173173
Example file structure:

Sources/EmbeddedSwift/Documentation.docc/SDKSupport/IntegrateWithPico.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Setting up a project that can seamlessly use C APIs from the Pico SDK.
66
77
Development for [Raspberry Pi Pico and Pico W](https://www.raspberrypi.com/products/raspberry-pi-pico/) normally uses the [Pico SDK](https://github.com/raspberrypi/pico-sdk) and the vendor provides several [sample projects in the pico-examples repository](https://github.com/raspberrypi/pico-examples). The SDK and sample project setup is described in:
88

9-
- https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html#sdk-setup
10-
- https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf
9+
- [https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html#sdk-setup](https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html#sdk-setup)
10+
- [https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf)
1111

1212
Before trying to use Swift with the Pico SDK, make sure your environment works and can build the provided C/C++ sample projects.
1313

Sources/EmbeddedSwift/Documentation.docc/SDKSupport/IntegratingWithPlatforms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ For detailed instructions on integrating with the Raspberry Pi Pico SDK, see <do
6666

6767
### ESP32
6868

69-
For ESP microcontrollers using the ESP-IDF framework, see <doc:IntegrateWithESP>. Note that only chips based on RISC-V architecture (e.g. ESP32-C3, ESP32-C6, ESP32-P4) are supported with Embedded Swift. The Xtensa ISA (used in e.g. ESP8266 or ESP32-S2 and ESP32-S3).
69+
For ESP microcontrollers using the ESP-IDF framework, see <doc:IntegrateWithESP>. Note that only chips based on RISC-V architecture (e.g. ESP32-C3, ESP32-C6, ESP32-P4) are supported with Embedded Swift. The Xtensa ISA (used in e.g. ESP8266 or ESP32-S2 and ESP32-S3) is not supported.
7070

7171
### STM32
7272

0 commit comments

Comments
 (0)