-
Notifications
You must be signed in to change notification settings - Fork 52
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
Windows Support #16
Comments
I've gotten this far at least on Linux:
This does not work, unless I add
If I remove main, then it will compile as a library. I tried as both main development branch and 6.0 development branch, both produce the same issue. Use -enable-experimental-feature Embedded means I cannot compile as an isolate executable, and instead its a library and I have to pull into C. BridgingHeader.h //===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2024 Apple Inc. and the Swift project authors.
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
#pragma once
// Define __unused attribute if not already defined
#define __unused __attribute__((unused))
// Define PICO_DEFAULT_UART if not already defined
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_INSTANCE
#define PICO_DEFAULT_UART_INSTANCE uart0
#endif
// Include Pico SDK headers with proper guards
#ifndef PICO_STDLIB_H
#define PICO_STDLIB_H
#include "pico/stdlib.h"
#endif
#ifndef PICO_CYW43_ARCH_H
#define PICO_CYW43_ARCH_H
#include "pico/cyw43_arch.h"
#endif
// Check if the macros are already defined
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif CMakeLists.txt
cd /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk
rm -rf build
mkdir build
export PICO_BOARD=pico_w
export PICO_SDK_PATH=/home/joseph/Documents/swift-embedded-examples/pico-sdk
export PICO_TOOLCHAIN_PATH=/home/joseph/Apps/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin
export TOOLCHAINS=/home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr
cmake -B build -G Ninja .
cmake --build build Using PICO_SDK_PATH from environment ('/home/joseph/Documents/swift-embedded-examples/pico-sdk')
PICO_SDK_PATH is /home/joseph/Documents/swift-embedded-examples/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
-- PICO Include directories: /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_async_context/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_rand/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_lwip/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_driver/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_stdio/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_base/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_timer/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_gpio/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_irq/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_uart/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_base/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_stdlib/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_time/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_platform/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/boot_stage2/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_regs/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_structs/include;/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include;/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/include;/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/generated/pico_base
-- Include directories: -Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_async_context/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_rand/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_lwip/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_driver/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_stdio/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_base/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_timer/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_gpio/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_irq/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_uart/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_base/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_stdlib/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_time/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_platform/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/boot_stage2/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_regs/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_structs/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/include;-Xcc;-I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/generated/pico_base;-Xcc;-I/usr/include;-Xcc;-I/usr/include/arm-none-eabi
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/joseph/Apps/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc
-- The Swift compiler identification is Apple 6.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/joseph/Apps/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/joseph/Apps/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type is Release
Using PICO_BOARD from environment ('pico_w')
Using CMake board configuration from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/boards/pico_w.cmake
Using board configuration from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/boards/include/boards/pico_w.h
-- Found Python3: /usr/bin/python3 (found version "3.12.3") found components: Interpreter
TinyUSB available at /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/btstack
cyw43-driver available at /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver
Pico W Bluetooth build support available.
lwIP available at /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip
Pico W Wi-Fi build support available.
mbedtls available at /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/mbedtls
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build
[13/88] Performing configure step for 'PioasmBuild'
loading initial cache file /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp/PioasmBuild-cache-Release.cmake
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/pioasm
[14/88] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/elf2uf2
[15/88] Generating _swiftcode.o
FAILED: _swiftcode.o /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/_swiftcode.o
cd /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build && /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/bin/swiftc -target armv6m-none-none-eabi -Xcc -mfloat-abi=soft -Xcc -fshort-enums -Xcc -DCYW43_LWIP -Xcc -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND -Xcc -DPICO_DEFAULT_UART=0 -Xcc -DPICO_BOARD=pico_w -Xfrontend -function-sections -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_async_context/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_rand/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_lwip/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_driver/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_stdio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_timer/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_gpio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_irq/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_uart/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_stdlib/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_time/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_platform/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/boot_stage2/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_regs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_structs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/generated/pico_base -Xcc -I/usr/include -Xcc -I/usr/include/arm-none-eabi -import-bridging-header /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/Main.swift -v -c -o /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/_swiftcode.o
Swift version 6.0-dev (LLVM 57177aa1b91540b, Swift 8be62863326595c)
Target: armv6m-none-none-eabi
/home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/bin/swift-frontend -frontend -target armv6m-none-none-eabi -disable-objc-interop -function-sections -empty-abi-descriptor -Xcc -working-directory -Xcc /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build -resource-dir /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/lib/swift -Xcc -mfloat-abi=soft -Xcc -fshort-enums -Xcc -DCYW43_LWIP -Xcc -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND -Xcc -DPICO_DEFAULT_UART=0 -Xcc -DPICO_BOARD=pico_w -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_async_context/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_rand/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_lwip/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_driver/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_stdio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_timer/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_gpio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_irq/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_uart/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_stdlib/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_time/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_platform/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/boot_stage2/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_regs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_structs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/generated/pico_base -Xcc -I/usr/include -Xcc -I/usr/include/arm-none-eabi -import-objc-header /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h -module-name _swiftcode -plugin-path /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/lib/swift/host/plugins -plugin-path /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/local/lib/swift/host/plugins -emit-pch -o /tmp/TemporaryDirectory.EwsOWU/BridgingHeader.pch /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h
/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
32 | #ifndef PICO_CYW43_ARCH_H
33 | #define PICO_CYW43_ARCH_H
34 | #include "pico/cyw43_arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
35 | #endif
36 |
/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
14 | #endif
15 |
16 | #include "cyw43.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
17 | #include "cyw43_country.h"
18 | #include "pico/async_context.h"
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
38 |
39 | #if CYW43_LWIP
40 | #include "lwip/netif.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
41 | #include "lwip/dhcp.h"
42 | #endif
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
38 | #define LWIP_HDR_NETIF_H
39 |
40 | #include "lwip/opt.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
41 |
42 | #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
50 | */
51 | #include "lwipopts.h"
52 | #include "lwip/debug.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
53 |
54 | /**
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
38 | #define LWIP_HDR_DEBUG_H
39 |
40 | #include "lwip/arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
41 | #include "lwip/opt.h"
42 |
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:83:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:83:
81 | #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
82 | #include <stdio.h>
83 | #include <stdlib.h>
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:83:
84 | #endif
85 |
/usr/include/stdlib.h:514:11: note: in file included from /usr/include/stdlib.h:514:
512 |
513 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
514 | # include <sys/types.h> /* we need int32_t... */
| `- note: in file included from /usr/include/stdlib.h:514:
515 |
516 | /* These are the functions that actually do things. The `random', `srandom',
/usr/include/sys/types.h:176:11: note: in file included from /usr/include/sys/types.h:176:
174 | #ifdef __USE_MISC
175 | /* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
176 | # include <endian.h>
| `- note: in file included from /usr/include/sys/types.h:176:
177 |
178 | /* It also defines `fd_set' and the FD_* macros for `select'. */
/usr/include/endian.h:27:10: warning: 'LITTLE_ENDIAN' macro redefined
25 |
26 | #ifdef __USE_MISC
27 | # define LITTLE_ENDIAN __LITTLE_ENDIAN
| `- warning: 'LITTLE_ENDIAN' macro redefined
28 | # define BIG_ENDIAN __BIG_ENDIAN
29 | # define PDP_ENDIAN __PDP_ENDIAN
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:41:9: note: previous definition is here
39 |
40 | #ifndef LITTLE_ENDIAN
41 | #define LITTLE_ENDIAN 1234
| `- note: previous definition is here
42 | #endif
43 |
:
81 | #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
82 | #include <stdio.h>
83 | #include <stdlib.h>
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:83:
84 | #endif
85 |
/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
32 | #ifndef PICO_CYW43_ARCH_H
33 | #define PICO_CYW43_ARCH_H
34 | #include "pico/cyw43_arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
35 | #endif
36 |
/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
14 | #endif
15 |
16 | #include "cyw43.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
17 | #include "cyw43_country.h"
18 | #include "pico/async_context.h"
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
38 |
39 | #if CYW43_LWIP
40 | #include "lwip/netif.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
41 | #include "lwip/dhcp.h"
42 | #endif
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
38 | #define LWIP_HDR_NETIF_H
39 |
40 | #include "lwip/opt.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
41 |
42 | #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
50 | */
51 | #include "lwipopts.h"
52 | #include "lwip/debug.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
53 |
54 | /**
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
38 | #define LWIP_HDR_DEBUG_H
39 |
40 | #include "lwip/arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
41 | #include "lwip/opt.h"
42 |
/usr/include/stdlib.h:514:11: note: in file included from /usr/include/stdlib.h:514:
512 |
513 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
514 | # include <sys/types.h> /* we need int32_t... */
| `- note: in file included from /usr/include/stdlib.h:514:
515 |
516 | /* These are the functions that actually do things. The `random', `srandom',
/usr/include/sys/types.h:176:11: note: in file included from /usr/include/sys/types.h:176:
174 | #ifdef __USE_MISC
175 | /* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
176 | # include <endian.h>
| `- note: in file included from /usr/include/sys/types.h:176:
177 |
178 | /* It also defines `fd_set' and the FD_* macros for `select'. */
/usr/include/endian.h:28:10: warning: 'BIG_ENDIAN' macro redefined
26 | #ifdef __USE_MISC
27 | # define LITTLE_ENDIAN __LITTLE_ENDIAN
28 | # define BIG_ENDIAN __BIG_ENDIAN
| `- warning: 'BIG_ENDIAN' macro redefined
29 | # define PDP_ENDIAN __PDP_ENDIAN
30 | # define BYTE_ORDER __BYTE_ORDER
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:45:9: note: previous definition is here
43 |
44 | #ifndef BIG_ENDIAN
45 | #define BIG_ENDIAN 4321
| `- note: previous definition is here
46 | #endif
47 |
:
81 | #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
82 | #include <stdio.h>
83 | #include <stdlib.h>
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:83:
84 | #endif
85 |
/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
32 | #ifndef PICO_CYW43_ARCH_H
33 | #define PICO_CYW43_ARCH_H
34 | #include "pico/cyw43_arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/BridgingHeader.h:34:
35 | #endif
36 |
/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
14 | #endif
15 |
16 | #include "cyw43.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include/pico/cyw43_arch.h:16:
17 | #include "cyw43_country.h"
18 | #include "pico/async_context.h"
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
38 |
39 | #if CYW43_LWIP
40 | #include "lwip/netif.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src/cyw43.h:40:
41 | #include "lwip/dhcp.h"
42 | #endif
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
38 | #define LWIP_HDR_NETIF_H
39 |
40 | #include "lwip/opt.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/netif.h:40:
41 |
42 | #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
50 | */
51 | #include "lwipopts.h"
52 | #include "lwip/debug.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/opt.h:52:
53 |
54 | /**
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:10: note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
38 | #define LWIP_HDR_DEBUG_H
39 |
40 | #include "lwip/arch.h"
| `- note: in file included from /home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/debug.h:40:
41 | #include "lwip/opt.h"
42 |
/usr/include/stdlib.h:514:11: note: in file included from /usr/include/stdlib.h:514:
512 |
513 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
514 | # include <sys/types.h> /* we need int32_t... */
| `- note: in file included from /usr/include/stdlib.h:514:
515 |
516 | /* These are the functions that actually do things. The `random', `srandom',
/usr/include/sys/types.h:176:11: note: in file included from /usr/include/sys/types.h:176:
174 | #ifdef __USE_MISC
175 | /* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
176 | # include <endian.h>
| `- note: in file included from /usr/include/sys/types.h:176:
177 |
178 | /* It also defines `fd_set' and the FD_* macros for `select'. */
3 warnings generated.
/usr/include/endian.h:30:10: warning: 'BYTE_ORDER' macro redefined
28 | # define BIG_ENDIAN __BIG_ENDIAN
29 | # define PDP_ENDIAN __PDP_ENDIAN
30 | # define BYTE_ORDER __BYTE_ORDER
| `- warning: 'BYTE_ORDER' macro redefined
31 | #endif
32 |
/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include/lwip/arch.h:67:9: note: previous definition is here
65 | */
66 | #ifndef BYTE_ORDER
67 | #define BYTE_ORDER LITTLE_ENDIAN
| `- note: previous definition is here
68 | #endif
69 |
/home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/bin/swift-frontend -frontend -c -primary-file /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/Main.swift -target armv6m-none-none-eabi -disable-objc-interop -function-sections -empty-abi-descriptor -Xcc -working-directory -Xcc /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build -resource-dir /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/lib/swift -Xcc -mfloat-abi=soft -Xcc -fshort-enums -Xcc -DCYW43_LWIP -Xcc -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND -Xcc -DPICO_DEFAULT_UART=0 -Xcc -DPICO_BOARD=pico_w -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/lwip/src/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/lib/cyw43-driver/src -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_async_context/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_rand/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_lwip/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_driver/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_stdio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_timer/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_gpio/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_irq/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/hardware_uart/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_base/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_stdlib/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/common/pico_time/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_platform/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/boot_stage2/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_regs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2040/hardware_structs/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-sdk/src/rp2_common/pico_cyw43_arch/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/include -Xcc -I/home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/generated/pico_base -Xcc -I/usr/include -Xcc -I/usr/include/arm-none-eabi -import-objc-header /tmp/TemporaryDirectory.EwsOWU/BridgingHeader.pch -module-name _swiftcode -plugin-path /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/lib/swift/host/plugins -plugin-path /home/joseph/Apps/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr/local/lib/swift/host/plugins -o /home/joseph/Documents/swift-embedded-examples/pico-w-blink-sdk/build/_swiftcode.o
<unknown>:0: error: unable to load standard library for target 'armv6m-none-none-eabi'
[16/88] Performing build step for 'ELF2UF2Build'
[1/2] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[2/2] Linking CXX executable elf2uf2
[17/88] Performing build step for 'PioasmBuild'
[1/10] Building CXX object CMakeFiles/pioasm.dir/ada_output.cpp.o
[2/10] Building CXX object CMakeFiles/pioasm.dir/pio_disassembler.cpp.o
[3/10] Building CXX object CMakeFiles/pioasm.dir/main.cpp.o
[4/10] Building CXX object CMakeFiles/pioasm.dir/python_output.cpp.o
[5/10] Building CXX object CMakeFiles/pioasm.dir/hex_output.cpp.o
[6/10] Building CXX object CMakeFiles/pioasm.dir/gen/lexer.cpp.o
[7/10] Building CXX object CMakeFiles/pioasm.dir/c_sdk_output.cpp.o
[8/10] Building CXX object CMakeFiles/pioasm.dir/gen/parser.cpp.o
[9/10] Building CXX object CMakeFiles/pioasm.dir/pio_assembler.cpp.o
[10/10] Linking CXX executable pioasm
ninja: build stopped: subcommand failed. |
I did a bit more digging, I think the issue is around https://github.com/apple/swift/blob/219b4a61d4c80e6e67338cad51b22db27f79723e/utils/build-script#L675 The toolchains points to STDLIB and there is where the errors happens: I can get this to build on macOS with the code in the repo as long as I add: set(CMAKE_ASM_COMPILER "arm-none-eabi-as")
set(CMAKE_ASM_COMPILER_ID GNU)
set(CMAKE_ASM_FLAGS "-march=armv6-m") On Linux I tried setting |
Here is the final version for Linux (Ubuntu 24.04) that I got working: export PICO_BOARD=pico_w
export PICO_SDK_PATH=/home/joseph/Documents/swift-embedded-examples/pico-sdk
export PICO_TOOLCHAIN_PATH=/home/joseph/Apps/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin
cmake -B build -G Ninja .
cmake --build build Bash commands for Swift's docker image (Ubuntu 22.04): docker pull swiftlang/swift:nightly-6.0-jammy
docker run --privileged --interactive --tty --name swift-latest -v $(pwd):/mnt swiftlang/swift:nightly-6.0-jammy /bin/bash
cd /mnt/
apt-get update && apt-get install wget gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib gcc-multilib ninja-build python3 xz-utils
wget https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-linux-x86_64.sh
./cmake-3.29.0-linux-x86_64.sh --skip-license --prefix=/usr
git clone https://github.com/raspberrypi/pico-sdk.git
wget "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz?rev=e434b9ea4afc4ed7998329566b764309&hash=CA590209F5774EE1C96E6450E14A3E26" -o arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
xz -d arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
tar -xvf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar
export PICO_BOARD=pico_w
export PICO_SDK_PATH=/mnt/pico-sdk
export PICO_TOOLCHAIN_PATH=/mnt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin
export TOOLCHAINS=/mnt/swift-DEVELOPMENT-SNAPSHOT-2024-06-13-a-ubuntu22.04/usr
cmake -B build -G Ninja .
cmake --build build These are the files I've changed CMakeLists.txt cmake_minimum_required(VERSION 3.13)
set(CMAKE_ASM_COMPILER "arm-none-eabi-as")
set(CMAKE_ASM_COMPILER_ID GNU)
# Set the Swift compiler for CMake
find_program(SWIFTC swiftc REQUIRED)
set(CMAKE_Swift_COMPILER ${SWIFTC})
set(CMAKE_Swift_COMPILER_FORCED TRUE)
set(PICO_ENABLE_TESTS off)
set(PICO_BOARD "pico_w")
# Manually specified include directories
set(MANUAL_INCLUDE_DIRECTORIES
$ENV{PICO_SDK_PATH}/lib/lwip/src/include
$ENV{PICO_SDK_PATH}/lib/cyw43-driver/src
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_async_context/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_rand/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_lwip/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_cyw43_driver/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_stdio/include
$ENV{PICO_SDK_PATH}/src/rp2_common/hardware_base/include
$ENV{PICO_SDK_PATH}/src/rp2_common/hardware_timer/include
$ENV{PICO_SDK_PATH}/src/rp2_common/hardware_gpio/include
$ENV{PICO_SDK_PATH}/src/rp2_common/hardware_irq/include
$ENV{PICO_SDK_PATH}/src/rp2_common/hardware_uart/include
$ENV{PICO_SDK_PATH}/src/common/pico_base/include
$ENV{PICO_SDK_PATH}/src/common/pico_stdlib/include
$ENV{PICO_SDK_PATH}/src/common/pico_time/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_platform/include
$ENV{PICO_SDK_PATH}/src/rp2_common/boot_stage2/include
$ENV{PICO_SDK_PATH}/src/rp2040/hardware_regs/include
$ENV{PICO_SDK_PATH}/src/rp2040/hardware_structs/include
$ENV{PICO_SDK_PATH}/src/rp2_common/pico_cyw43_arch/include
${CMAKE_CURRENT_LIST_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/generated/pico_base
)
list(APPEND PICO_INCLUDE_DIRECTORIES ${MANUAL_INCLUDE_DIRECTORIES})
message(STATUS "PICO Include directories: ${PICO_INCLUDE_DIRECTORIES}")
set(INCLUDE_DIRS "")
foreach(dir ${PICO_INCLUDE_DIRECTORIES})
list(APPEND INCLUDE_DIRS -Xcc -I${dir})
endforeach()
list(APPEND INCLUDE_DIRS -Xcc -I/usr/include -Xcc -I/usr/include/arm-none-eabi)
message(STATUS "Include directories: ${INCLUDE_DIRS}")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_definitions(__unused=__attribute__((unused)))
endif()
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(swift-blinky LANGUAGES C CXX ASM Swift)
pico_sdk_init()
add_executable(swift-blinky
BridgingHeader.h)
#-no-allocations -Osize -Xlinker -dead_strip
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_swiftcode.o
COMMAND
${SWIFTC}
-target armv6m-none-none-eabi
-Xcc -mfloat-abi=soft
-Xcc -fshort-enums
-Xcc -DCYW43_LWIP
-Xcc -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND
-Xcc -DPICO_DEFAULT_UART=0
-Xcc -DPICO_BOARD=pico_w
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library
${INCLUDE_DIRS}
-import-bridging-header ${CMAKE_CURRENT_LIST_DIR}/BridgingHeader.h
${CMAKE_CURRENT_LIST_DIR}/Main.swift
-v
-c -o ${CMAKE_CURRENT_BINARY_DIR}/_swiftcode.o
DEPENDS
${CMAKE_CURRENT_LIST_DIR}/BridgingHeader.h
${CMAKE_CURRENT_LIST_DIR}/Main.swift
)
add_custom_target(swift-blinky-swiftcode DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_swiftcode.o)
target_link_libraries(swift-blinky
pico_stdlib hardware_uart hardware_gpio pico_lwip_arch pico_cyw43_arch_none
${CMAKE_CURRENT_BINARY_DIR}/_swiftcode.o
)
add_dependencies(swift-blinky swift-blinky-swiftcode)
pico_add_extra_outputs(swift-blinky) BridgingHeader.h #pragma once
// Define __unused attribute if not already defined
#define __unused __attribute__((unused))
// Define PICO_DEFAULT_UART if not already defined
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_INSTANCE
#define PICO_DEFAULT_UART_INSTANCE uart0
#endif
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h" |
I have created a simple Docker-based setup for developing embedded Swift applications for the Raspberry Pi Pico and Pico W microcontrollers using Pico-SDK. I have tested it on macOS, Ubuntu, and Windows host. https://github.com/shivarajd/swift-embedded-pico-docker |
I tried to play around with the Pico SDK blink example last night from my windows machine using the latest Swift 6 toolchain and didn't have much luck. I'm not particularly proficient in cmake but it seems like some modifications are required to allow for Windows support using 'swift build' since it seems to be using 'xcrun'. (I would use macOS but I only have a work machine and it's USB ports have been locked down)
I had a look through the various docs regarding embedded Swift and it all seems to be macOS based so far. Are there any docs out there, or plans for docs, for what modifications would be needed for Windows/Linux?
The text was updated successfully, but these errors were encountered: