apple / swift-embedded-examples

A collection of example projects using Embedded Swift
Apache License 2.0
556 stars 29 forks source link

Raspberry Pi Pico W's LED doesn't blink #12

Closed ilgrandeanonimo closed 4 days ago

ilgrandeanonimo commented 1 month ago

Today I tried to run the Blinky example on my Raspberry Pico Pi W. I sucefully builded the .uf2 file:

but when i install the .uf2 file the led doesn't blink

Build Output:

# Determine file paths
REPOROOT=$(git rev-parse --show-toplevel)
git rev-parse --show-toplevel
++ git rev-parse --show-toplevel
+ REPOROOT=/Users/ilgrandeanonimo/swift-embedded-examples
TOOLSROOT=$REPOROOT/Tools
+ TOOLSROOT=/Users/ilgrandeanonimo/swift-embedded-examples/Tools

# Setup tools and build flags
SWIFT_EXEC=${SWIFT_EXEC:-`xcrun -f swift`}
xcrun -f swift
++ xcrun -f swift
+ SWIFT_EXEC=/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swift
CLANG=${CLANG:-`xcrun -f clang`}
xcrun -f clang
++ xcrun -f clang
+ CLANG=/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/clang
SWIFT_FLAGS="-enable-experimental-feature Embedded -disable-stack-protector"
+ SWIFT_FLAGS='-enable-experimental-feature Embedded -disable-stack-protector'
CLANG_FLAGS="-D__MACH__ -ffreestanding -mcpu=cortex-m0plus -mthumb"
+ CLANG_FLAGS='-D__MACH__ -ffreestanding -mcpu=cortex-m0plus -mthumb'
LD_FLAGS="-static -Wl,-e,_reset -dead_strip -Wl,-no_zero_fill_sections -Wl,-segalign,4 -Wl,-segaddr,__RESET,0x20000000 -Wl,-segaddr,__VECTORS,0x20000100 -Wl,-seg1addr,0x20000200 -Wl,-pagezero_size,0"
+ LD_FLAGS='-static -Wl,-e,_reset -dead_strip -Wl,-no_zero_fill_sections -Wl,-segalign,4 -Wl,-segaddr,__RESET,0x20000000 -Wl,-segaddr,__VECTORS,0x20000100 -Wl,-seg1addr,0x20000200 -Wl,-pagezero_size,0'

XCODE_RESOURCE_DIR=`env TOOLCHAINS="" xcrun clang -print-resource-dir`
env TOOLCHAINS="" xcrun clang -print-resource-dir
++ env TOOLCHAINS= xcrun clang -print-resource-dir
+ XCODE_RESOURCE_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
LD_FLAGS+=" $XCODE_RESOURCE_DIR/lib/darwin/macho_embedded/libclang_rt.soft_static.a"
+ LD_FLAGS+=' /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/macho_embedded/libclang_rt.soft_static.a'

SWIFT_BUILD_FLAGS="--triple armv6m-apple-none-macho --configuration release --verbose"
+ SWIFT_BUILD_FLAGS='--triple armv6m-apple-none-macho --configuration release --verbose'
for SWIFT_FLAG in $SWIFT_FLAGS; do
    SWIFT_BUILD_FLAGS+=" -Xswiftc $SWIFT_FLAG"
done
+ for SWIFT_FLAG in '$SWIFT_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xswiftc -enable-experimental-feature'
+ for SWIFT_FLAG in '$SWIFT_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xswiftc Embedded'
+ for SWIFT_FLAG in '$SWIFT_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xswiftc -disable-stack-protector'

for CLANG_FLAG in $CLANG_FLAGS; do
    SWIFT_BUILD_FLAGS+=" -Xcc $CLANG_FLAG"
done
+ for CLANG_FLAG in '$CLANG_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xcc -D__MACH__'
+ for CLANG_FLAG in '$CLANG_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xcc -ffreestanding'
+ for CLANG_FLAG in '$CLANG_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xcc -mcpu=cortex-m0plus'
+ for CLANG_FLAG in '$CLANG_FLAGS'
+ SWIFT_BUILD_FLAGS+=' -Xcc -mthumb'

PYTHON_EXEC=${PYTHON_EXEC:-`xcrun -f python3`}
xcrun -f python3
++ xcrun -f python3
+ PYTHON_EXEC=/Applications/Xcode.app/Contents/Developer/usr/bin/python3
MACHO2UF2=$TOOLSROOT/macho2uf2.py
+ MACHO2UF2=/Users/ilgrandeanonimo/swift-embedded-examples/Tools/macho2uf2.py

# Build with Swift package manager
$SWIFT_EXEC build $SWIFT_BUILD_FLAGS
+ /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swift build --triple armv6m-apple-none-macho --configuration release --verbose -Xswiftc -enable-experimental-feature -Xswiftc Embedded -Xswiftc -disable-stack-protector -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb
Planning build
Building for production...
Write auxiliary file /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/swift-version--4DD707390B2078BE.txt
/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/clang -target armv6m-apple-none-macho -O2 -DSWIFT_PACKAGE=1 -fblocks -I /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/include --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -fPIC -g -D__MACH__ -ffreestanding -mcpu=cortex-m0plus -mthumb -MD -MT dependencies -MF /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/Support.c.d -c /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/Support.c -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/Support.c.o
/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/clang -target armv6m-apple-none-macho -O2 -DSWIFT_PACKAGE=1 -fblocks -I /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/include --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -fPIC -g -D__MACH__ -ffreestanding -mcpu=cortex-m0plus -mthumb -MD -MT dependencies -MF /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/crt0.S.d -c /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/crt0.S -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/crt0.S.o
/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swiftc -module-name RP2040 -emit-dependencies -emit-module -emit-module-path /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Modules/RP2040.swiftmodule -output-file-map /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/output-file-map.json -parse-as-library -whole-module-optimization -num-threads 8 -c @/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/sources -I /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Modules -target armv6m-apple-none-macho -swift-version 5 -v -O -j8 -DSWIFT_PACKAGE -Xcc -fmodule-map-file=/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/module.modulemap -Xcc -I -Xcc /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/include -module-cache-path /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/ModuleCache -parseable-output -parse-as-library -color-diagnostics -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -g -enable-experimental-feature Embedded -disable-stack-protector -Xcc --sysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -Xcc -g -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb -package-name pico_blink
warning: save unknown driver flag -disable-stack-protector as additional swift-frontend flag
Apple Swift version 6.0-dev (LLVM 7b8e6346027d2b1, Swift 763421cee31dc8f)
Target: armv6m-apple-none-macho
/Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/HAL/Digital.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/HAL/Pins.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/HAL/RP2040.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/HAL/Time.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/Clocks.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/IOBank.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/PLL.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/PPB.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/PadsBank.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/RP2040Hardware.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/Resets.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/SIO.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/Timer.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/Watchdog.swift /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/XOSC.swift -supplementary-output-file-map /var/folders/xc/87dyfbzn53g1n8qhr_6b0dkm0000gp/T/TemporaryDirectory.6M991A/supplementaryOutputs-1 -target armv6m-apple-none-macho -disable-objc-interop -I /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Modules -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -color-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -enable-experimental-feature Embedded -empty-abi-descriptor -resource-dir /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/lib/swift -file-compilation-dir /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink -Xcc -fmodule-map-file=/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Support.build/module.modulemap -Xcc -I -Xcc /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/Support/include -Xcc --sysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -Xcc -g -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb -module-name RP2040 -package-name pico_blink -disable-stack-protector -plugin-path /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/local/lib/swift/host/plugins -enable-default-cmo -parse-as-library -num-threads 8 -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Digital.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Pins.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/RP2040.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Time.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Clocks.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/IOBank.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/PLL.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/PPB.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/PadsBank.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/RP2040Hardware.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Resets.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/SIO.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Timer.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/Watchdog.swift.o -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/RP2040.build/XOSC.swift.o
/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/RP2040Hardware.swift:75:11: warning: initialization of immutable value 'fbdiv' was never used; consider replacing with assignment to '_' or removing it
 73 |       let referenceFrequency = UInt32(12000 * 1000)
 74 | 
 75 |       let fbdiv = vcoFrequency / referenceFrequency
    |           `- warning: initialization of immutable value 'fbdiv' was never used; consider replacing with assignment to '_' or removing it
 76 | 
 77 |       let pdiv = postDivisor1 << 16 | postDivisor2 << 12

/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/RP2040Hardware.swift:77:11: warning: initialization of immutable value 'pdiv' was never used; consider replacing with assignment to '_' or removing it
 75 |       let fbdiv = vcoFrequency / referenceFrequency
 76 | 
 77 |       let pdiv = postDivisor1 << 16 | postDivisor2 << 12
    |           `- warning: initialization of immutable value 'pdiv' was never used; consider replacing with assignment to '_' or removing it
 78 | 
 79 |       let resetTarget: Resets.ResetValue = pll.unsafeAddress == pllUSB.unsafeAddress ? .pll_usb : .pll_sys

/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/RP2040Hardware.swift:88:11: warning: initialization of immutable value 'usbClockKHz' was never used; consider replacing with assignment to '_' or removing it
 86 |     func initializeClocks() {
 87 |       let xoscKHz = UInt16(12000)
 88 |       let usbClockKHz = UInt16(48000)
    |           `- warning: initialization of immutable value 'usbClockKHz' was never used; consider replacing with assignment to '_' or removing it
 89 |       let systemClockKHz = UInt32(125000)
 90 |       let multiplier = UInt16(1) // this is technically hardware dependent (e.g. the adafruit feather has 64 here)

/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/Sources/RP2040/Hardware/RP2040Hardware.swift:90:11: warning: initialization of immutable value 'multiplier' was never used; consider replacing with assignment to '_' or removing it
 88 |       let usbClockKHz = UInt16(48000)
 89 |       let systemClockKHz = UInt32(125000)
 90 |       let multiplier = UInt16(1) // this is technically hardware dependent (e.g. the adafruit feather has 64 here)
    |           `- warning: initialization of immutable value 'multiplier' was never used; consider replacing with assignment to '_' or removing it
 91 |       let KHz = UInt16(1000)
 92 | 
Write auxiliary file /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Blinky.product/Objects.LinkFileList
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/libBlinky.a @/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/Blinky.product/Objects.LinkFileList
Build complete! (3.01s)

# Get the output directory
BUILDROOT=$($SWIFT_EXEC build $SWIFT_BUILD_FLAGS --show-bin-path)
$SWIFT_EXEC build $SWIFT_BUILD_FLAGS --show-bin-path
++ /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swift build --triple armv6m-apple-none-macho --configuration release --verbose -Xswiftc -enable-experimental-feature -Xswiftc Embedded -Xswiftc -disable-stack-protector -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb --show-bin-path
+ BUILDROOT=/Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release

# Link
$CLANG .build/release/Support.build/{Support.c,crt0.S}.o .build/release/Blinky.build/*.o -target armv6m-apple-none-macho -o $BUILDROOT/blinky $LD_FLAGS
+ /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/clang .build/release/Support.build/Support.c.o .build/release/Support.build/crt0.S.o .build/release/Blinky.build/Blinky.swift.o -target armv6m-apple-none-macho -o /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky -static -Wl,-e,_reset -dead_strip -Wl,-no_zero_fill_sections -Wl,-segalign,4 -Wl,-segaddr,__RESET,0x20000000 -Wl,-segaddr,__VECTORS,0x20000100 -Wl,-seg1addr,0x20000200 -Wl,-pagezero_size,0 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/macho_embedded/libclang_rt.soft_static.a
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/macho_embedded/libclang_rt.soft_static.a, building for free standing-armv6m but attempting to link with file built for macOS-armv7
ld: warning: ignoring file /Users/ilgrandeanonimo/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/lib/clang/17/lib/darwin/macho_embedded/libclang_rt.soft_static.a, building for free standing-armv6m but attempting to link with file built for macOS-armv7

# Extract sections from executable into flashable binary
$PYTHON_EXEC $MACHO2UF2 $BUILDROOT/blinky $BUILDROOT/blinky.uf2 --base-address 0x20000000 --segments '__TEXT,__DATA,__VECTORS,__RESET'
+ /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Users/ilgrandeanonimo/swift-embedded-examples/Tools/macho2uf2.py /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky.uf2 --base-address 0x20000000 --segments __TEXT,__DATA,__VECTORS,__RESET
Writing segment __RESET size 24 (0x24) at vmaddr 0x20000000
Writing gap of size 232 (0xe8) at vmaddr 0x20000018
Writing segment __VECTORS size 192 (0x192) at vmaddr 0x20000100
Writing gap of size 64 (0x40) at vmaddr 0x200001c0
Writing segment __TEXT size 4940 (0x4940) at vmaddr 0x20000200
Writing gap of size 20 (0x14) at vmaddr 0x2000154c
Writing segment __DATA size 2064 (0x2064) at vmaddr 0x20001560
Produced /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky.bin with 7536 bytes
Produced /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky.uf2 with total size 15360 (0x3c00) bytes, payload size 7536 (0x1d70) bytes

# Echo final binary path
ls -al $BUILDROOT/blinky.uf2
+ ls -al /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky.uf2
-rw-r--r--@ 1 ilgrandeanonimo  staff  15360 14 Mag 14:08 /Users/ilgrandeanonimo/swift-embedded-examples/pico-blink/.build/armv6m-apple-none-macho/release/blinky.uf2
phausler commented 2 weeks ago

The pico-w does not have a GPIO pin enabled for the LED; instead it uses the wireless chip to extend the GPIOs - this would require some additional HAL code to interact with that chip.

phausler commented 2 weeks ago

You can use the https://github.com/apple/swift-embedded-examples/tree/main/pico-w-blink-sdk example to do that instead. That one is built to use the existing pico sdk and interface for the pico-w

rauhul commented 4 days ago

I think @phausler's solution is correct, please reopen this issue with more details if the solution does not work for you.